Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions examples/cr-console.operator.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: operator.openshift.io/v1
kind: Console
metadata:
name: cluster
spec:
managementState: Managed
authentication:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, @zherman0, authentication belongs on the other config, should remove from this example file.

# the logout redirect must be a valid URI that starts with http(s)
# valid examples: http://localhost:8080/logout.html, https://www.redhat.com/log/out/
logoutRedirect: "https://www.redhat.com/i/should/logout"
customization:
brand: okd
# the documentation base must be a valid URI that starts with http(s) AND it must have a trailing slash
# the trailing slash is required because additional values will be appended
# valid examples: https://localhost:9999/docs/, http://192.168.1.5:3000/doc/location/
documentationBaseURL: "https://www.redhat.com/someplace/for/docs/"
17 changes: 17 additions & 0 deletions hack/test-unit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,20 @@ do
os::log::info "Testing ${PACKAGE}"
go test $PACKAGE
done

OCP_PACKAGES_TO_TEST=(
"github.com/openshift/console-operator/pkg/console/subresource/configmap"
"github.com/openshift/console-operator/pkg/console/subresource/deployment"
"github.com/openshift/console-operator/pkg/console/subresource/oauthclient"
"github.com/openshift/console-operator/pkg/console/subresource/route"
"github.com/openshift/console-operator/pkg/console/subresource/secret"
"github.com/openshift/console-operator/pkg/console/subresource/service"
"github.com/openshift/console-operator/pkg/console/subresource/util"
"github.com/openshift/console-operator/pkg/console/version"
)

for PACKAGE in "${OCP_PACKAGES_TO_TEST[@]}"
do
os::log::info "Testing with tag ocp ${PACKAGE}"
go test -tags "ocp" $PACKAGE
done
32 changes: 29 additions & 3 deletions manifests/00-crd-operator-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,32 @@ spec:
subresources:
status: {}
versions:
- name: v1
served: true
storage: true
- name: v1
served: true
storage: true
validation:
openAPIV3Schema:
properties:
spec:
properties:
managementState:
pattern: ^(Managed|Unmanaged|Removed|Forced)$
type: string
description: managementState indicates whether and how the operator
should manage the component
authentication:
properties:
logoutRedirect:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Late comment, but just realized, authentication.logoutRedirect is on console.config.openshift.io, not console.operator.openshift.io (the top level user-facing console config, not the config for the operator). This exists here: https://github.com/openshift/cluster-config-operator/blob/master/manifests/0000_05_config-operator_01_console.crd.yaml

  • We should remove this, PR it there against that file.
  • Also, lets ensure it handles "" / unset as these are unset by default and optional.

pattern: ^((https):\/\/?)[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/?))$
type: string
description: Logout Redirect must be a valid URL
customization:
Copy link
Contributor

@benjaminapetersen benjaminapetersen Feb 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, customization.documentationBaseURL and customization.Brand should handle ""/unset. I'm betting these do not. Fast-follow!

  • handle "" / unset as these are unset by default and optional.

properties:
documentationBaseURL:
pattern: ^((https):\/\/?)[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/?))\/$
type: string
description: Document base URL must be a valid URL that ends in a trailing slash
brand:
pattern: ^(ocp|origin|okd|dedicated|online|azure)$
type: string
description: Brand must be be one of six values - azure|dedicated|ocp|okd|online|origin
8 changes: 4 additions & 4 deletions pkg/console/subresource/configmap/configmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ clusterInfo:
consoleBaseAddress: https://` + host + `
consoleBasePath: ""
customization:
branding: okd
documentationBaseURL: https://docs.okd.io/4.0/
branding: ` + DEFAULT_BRAND + `
documentationBaseURL: ` + DEFAULT_DOC_URL + `
servingInfo:
bindAddress: https://0.0.0.0:8443
certFile: /var/serving-cert/tls.crt
Expand Down Expand Up @@ -171,8 +171,8 @@ func TestNewYamlConfig(t *testing.T) {
args: args{
host: host,
logoutRedirect: "",
brand: "okd",
docURL: "https://docs.okd.io/4.0/",
brand: DEFAULT_BRAND,
docURL: DEFAULT_DOC_URL,
},
want: exampleYaml,
},
Expand Down