Skip to content

Commit ff91c53

Browse files
committed
Test for ocp tag build and validation for urls in the CR file
1 parent 690d4c1 commit ff91c53

File tree

3 files changed

+41
-5
lines changed

3 files changed

+41
-5
lines changed

hack/test-unit.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,20 @@ do
2626
os::log::info "Testing ${PACKAGE}"
2727
go test $PACKAGE
2828
done
29+
30+
OCP_PACKAGES_TO_TEST=(
31+
"github.com/openshift/console-operator/pkg/console/subresource/configmap"
32+
"github.com/openshift/console-operator/pkg/console/subresource/deployment"
33+
"github.com/openshift/console-operator/pkg/console/subresource/oauthclient"
34+
"github.com/openshift/console-operator/pkg/console/subresource/route"
35+
"github.com/openshift/console-operator/pkg/console/subresource/secret"
36+
"github.com/openshift/console-operator/pkg/console/subresource/service"
37+
"github.com/openshift/console-operator/pkg/console/subresource/util"
38+
"github.com/openshift/console-operator/pkg/console/version"
39+
)
40+
41+
for PACKAGE in "${OCP_PACKAGES_TO_TEST[@]}"
42+
do
43+
os::log::info "Testing with tag ocp ${PACKAGE}"
44+
go test -tags "ocp" $PACKAGE
45+
done

manifests/00-crd-operator-config.yaml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,25 @@ spec:
1313
subresources:
1414
status: {}
1515
versions:
16-
- name: v1
17-
served: true
18-
storage: true
16+
- name: v1
17+
served: true
18+
storage: true
19+
validation:
20+
openAPIV3Schema:
21+
properties:
22+
spec:
23+
properties:
24+
authentication:
25+
properties:
26+
logoutRedirect:
27+
pattern: ^((http|https):\/\/?)[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/?))$
28+
type: string
29+
customization:
30+
properties:
31+
documentationBaseURL:
32+
#pattern: ^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+\/$
33+
pattern: ^((http|https):\/\/?)[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/?))\/$
34+
type: string
35+
brand:
36+
pattern: ^(ocp|origin|okd|dedicated|online)$
37+
type: string

pkg/console/subresource/configmap/configmap_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ clusterInfo:
2727
consoleBaseAddress: https://` + host + `
2828
consoleBasePath: ""
2929
customization:
30-
branding: okd
31-
documentationBaseURL: https://docs.okd.io/4.0/
30+
branding: ` + DEFAULT_BRAND + `
31+
documentationBaseURL: ` + DEFAULT_DOC_URL + `
3232
servingInfo:
3333
bindAddress: https://0.0.0.0:8443
3434
certFile: /var/serving-cert/tls.crt

0 commit comments

Comments
 (0)