-
Notifications
You must be signed in to change notification settings - Fork 606
Expand file tree
/
Copy pathCRIOCredentialProviderConfig.yaml
More file actions
105 lines (105 loc) · 4 KB
/
CRIOCredentialProviderConfig.yaml
File metadata and controls
105 lines (105 loc) · 4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "CRIOCredentialProviderConfig"
crdName: "criocredentialproviderconfigs.config.openshift.io"
featureGates:
- CRIOCredentialProviderConfig
tests:
onCreate:
- name: Should create a minimal CRIOCredentialProviderConfig
initial: |
apiVersion: config.openshift.io/v1
kind: CRIOCredentialProviderConfig
metadata:
name: cluster
spec: {}
expected: |
apiVersion: config.openshift.io/v1
kind: CRIOCredentialProviderConfig
metadata:
name: cluster
spec: {}
- name: Should create a valid CRIOCredentialProviderConfig
initial: |
apiVersion: config.openshift.io/v1
kind: CRIOCredentialProviderConfig
metadata:
name: cluster
spec:
matchImages:
- 123456789.dkr.ecr.us-east-1.amazonaws.com
- "*.azurecr.io"
- gcr.io
- "*.*.registry.io"
- registry.io:8080/path
expected: |
apiVersion: config.openshift.io/v1
kind: CRIOCredentialProviderConfig
metadata:
name: cluster
spec:
matchImages:
- 123456789.dkr.ecr.us-east-1.amazonaws.com
- "*.azurecr.io"
- gcr.io
- "*.*.registry.io"
- registry.io:8080/path
- name: Should reject matchImages with invalid characters
initial: |
apiVersion: config.openshift.io/v1
kind: CRIOCredentialProviderConfig
metadata:
name: cluster
spec:
matchImages:
- "reg!stry.io"
expectedError: "spec.matchImages[0]: Invalid value: \"string\": invalid matchImages value, must be a valid fully qualified domain name in lowercase with optional wildcard, port, and path"
- name: Should reject matchImages with uppercase hostname
initial: |
apiVersion: config.openshift.io/v1
kind: CRIOCredentialProviderConfig
metadata:
name: cluster
spec:
matchImages:
- "Registry.COM"
expectedError: "spec.matchImages[0]: Invalid value: \"string\": invalid matchImages value, must be a valid fully qualified domain name in lowercase with optional wildcard, port, and path"
- name: Should reject matchImages with uppercase in the path
initial: |
apiVersion: config.openshift.io/v1
kind: CRIOCredentialProviderConfig
metadata:
name: cluster
spec:
matchImages:
- "registry.io/PaTh"
expectedError: "spec.matchImages[0]: Invalid value: \"string\": invalid matchImages value, must be a valid fully qualified domain name in lowercase with optional wildcard, port, and path"
- name: Should reject matchImages wildcard in the path
initial: |
apiVersion: config.openshift.io/v1
kind: CRIOCredentialProviderConfig
metadata:
name: cluster
spec:
matchImages:
- "registry.io:8080/pa*th"
expectedError: "spec.matchImages[0]: Invalid value: \"string\": invalid matchImages value, must be a valid fully qualified domain name in lowercase with optional wildcard, port, and path"
- name: Should reject wildcard for partial subdomains
initial: |
apiVersion: config.openshift.io/v1
kind: CRIOCredentialProviderConfig
metadata:
name: cluster
spec:
matchImages:
- "example.app*.com"
expectedError: "spec.matchImages[0]: Invalid value: \"string\": invalid matchImages value, must be a valid fully qualified domain name in lowercase with optional wildcard, port, and path"
- name: Should reject global wildcard '*'
initial: |
apiVersion: config.openshift.io/v1
kind: CRIOCredentialProviderConfig
metadata:
name: cluster
spec:
matchImages:
- "*"
expectedError: "spec.matchImages[0]: Invalid value: \"string\": global wildcard '*' is not allowed"