Skip to content

Add CEL test for UpstreamSettingsPolicy CRD #3672

@shaun-nx

Description

@shaun-nx

Overview

As a user of NGF, I would like to add CEL tests for the UpstreamSettingsPolicy CRD so that I can be confident that the CEL validation works as I expect

UACs

  • Add test for the targetRef CEL validation

targetRef validation:

x-kubernetes-validations:
- message: 'TargetRefs Kind must be: Service'
  rule: self.all(t, t.kind=='Service')
- message: TargetRefs Group must be core
  rule: self.exists(t, t.group=='') || self.exists(t, t.group=='core')
- message: TargetRef Name must be unique
  rule: self.all(p1, self.exists_one(p2, p1.name == p2.name))

Metadata

Metadata

Assignees

Labels

testsPull requests that update tests

Type

Projects

Status

👀 In Review

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions