Skip to content

Commit abd2876

Browse files
committed
test(api): add envtest cases for servingCerts CEL has() guards
Add two additional envtest cases to exercise each has() guard added in the servingCerts CEL validation fix: - servingCerts present but no namedCertificates: exercises has(self.configuration.apiServer.servingCerts.namedCertificates) - namedCertificates entry with no names field: exercises has(cert.names) Signed-off-by: rutvik23 <rkshirsa@redhat.com> Commit-Message-Assisted-by: Claude (via Claude Code)
1 parent 996ca15 commit abd2876

1 file changed

Lines changed: 90 additions & 1 deletion

File tree

cmd/install/assets/crds/hypershift-operator/tests/hostedclusters.hypershift.openshift.io/stable.hostedclusters.services.testsuite.yaml

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,4 +288,93 @@ tests:
288288
configuration:
289289
apiServer:
290290
additionalCORSAllowedOrigins:
291-
- "https://example.com"
291+
- "https://example.com"
292+
293+
- name: When loadBalancer hostname is set and apiServer has servingCerts but no namedCertificates it should pass
294+
initial: |
295+
apiVersion: hypershift.openshift.io/v1beta1
296+
kind: HostedCluster
297+
spec:
298+
dns:
299+
baseDomain: example.com
300+
platform:
301+
type: AWS
302+
pullSecret:
303+
name: secret
304+
release:
305+
image: quay.io/openshift-release-dev/ocp-release:4.15.11-x86_64
306+
secretEncryption:
307+
aescbc:
308+
activeKey:
309+
name: key
310+
type: aescbc
311+
services:
312+
- service: APIServer
313+
servicePublishingStrategy:
314+
type: LoadBalancer
315+
loadBalancer:
316+
hostname: kas.example.com
317+
- service: Ignition
318+
servicePublishingStrategy:
319+
type: NodePort
320+
nodePort:
321+
address: "127.0.0.1"
322+
- service: Konnectivity
323+
servicePublishingStrategy:
324+
type: NodePort
325+
nodePort:
326+
address: "fd2e:6f44:5dd8:c956::14"
327+
- service: OAuthServer
328+
servicePublishingStrategy:
329+
type: NodePort
330+
nodePort:
331+
address: "fd2e:6f44:5dd8:c956:0000:0000:0000:0014"
332+
configuration:
333+
apiServer:
334+
servingCerts: {}
335+
336+
- name: When loadBalancer hostname is set and namedCertificates entry has no names it should pass
337+
initial: |
338+
apiVersion: hypershift.openshift.io/v1beta1
339+
kind: HostedCluster
340+
spec:
341+
dns:
342+
baseDomain: example.com
343+
platform:
344+
type: AWS
345+
pullSecret:
346+
name: secret
347+
release:
348+
image: quay.io/openshift-release-dev/ocp-release:4.15.11-x86_64
349+
secretEncryption:
350+
aescbc:
351+
activeKey:
352+
name: key
353+
type: aescbc
354+
services:
355+
- service: APIServer
356+
servicePublishingStrategy:
357+
type: LoadBalancer
358+
loadBalancer:
359+
hostname: kas.example.com
360+
- service: Ignition
361+
servicePublishingStrategy:
362+
type: NodePort
363+
nodePort:
364+
address: "127.0.0.1"
365+
- service: Konnectivity
366+
servicePublishingStrategy:
367+
type: NodePort
368+
nodePort:
369+
address: "fd2e:6f44:5dd8:c956::14"
370+
- service: OAuthServer
371+
servicePublishingStrategy:
372+
type: NodePort
373+
nodePort:
374+
address: "fd2e:6f44:5dd8:c956:0000:0000:0000:0014"
375+
configuration:
376+
apiServer:
377+
servingCerts:
378+
namedCertificates:
379+
- servingCertificate:
380+
name: my-cert

0 commit comments

Comments
 (0)