From ff695c6586a7a677a2f9f261d64af449f815c8c3 Mon Sep 17 00:00:00 2001 From: Ben Petersen Date: Thu, 28 Feb 2019 10:49:38 -0500 Subject: [PATCH] Revert "Validate URLs from the CR file and additional unit tests for ocp tag" --- examples/cr-console.operator.config.yaml | 16 ---------- hack/test-unit.sh | 17 ---------- manifests/00-crd-operator-config.yaml | 32 ++----------------- .../subresource/configmap/configmap_test.go | 8 ++--- 4 files changed, 7 insertions(+), 66 deletions(-) delete mode 100644 examples/cr-console.operator.config.yaml diff --git a/examples/cr-console.operator.config.yaml b/examples/cr-console.operator.config.yaml deleted file mode 100644 index 1042899d0e..0000000000 --- a/examples/cr-console.operator.config.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: operator.openshift.io/v1 -kind: Console -metadata: - name: cluster -spec: - managementState: Managed - authentication: - # 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/" diff --git a/hack/test-unit.sh b/hack/test-unit.sh index 025bc56cbd..d2a7814b83 100755 --- a/hack/test-unit.sh +++ b/hack/test-unit.sh @@ -26,20 +26,3 @@ 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 diff --git a/manifests/00-crd-operator-config.yaml b/manifests/00-crd-operator-config.yaml index e18769724d..30d0613d7e 100644 --- a/manifests/00-crd-operator-config.yaml +++ b/manifests/00-crd-operator-config.yaml @@ -13,32 +13,6 @@ spec: subresources: status: {} versions: - - 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: - pattern: ^((https):\/\/?)[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/?))$ - type: string - description: Logout Redirect must be a valid URL - customization: - 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 + - name: v1 + served: true + storage: true diff --git a/pkg/console/subresource/configmap/configmap_test.go b/pkg/console/subresource/configmap/configmap_test.go index b120501002..420e9756ac 100644 --- a/pkg/console/subresource/configmap/configmap_test.go +++ b/pkg/console/subresource/configmap/configmap_test.go @@ -27,8 +27,8 @@ clusterInfo: consoleBaseAddress: https://` + host + ` consoleBasePath: "" customization: - branding: ` + DEFAULT_BRAND + ` - documentationBaseURL: ` + DEFAULT_DOC_URL + ` + branding: okd + documentationBaseURL: https://docs.okd.io/4.0/ servingInfo: bindAddress: https://0.0.0.0:8443 certFile: /var/serving-cert/tls.crt @@ -171,8 +171,8 @@ func TestNewYamlConfig(t *testing.T) { args: args{ host: host, logoutRedirect: "", - brand: DEFAULT_BRAND, - docURL: DEFAULT_DOC_URL, + brand: "okd", + docURL: "https://docs.okd.io/4.0/", }, want: exampleYaml, },