Skip to content

Commit

Permalink
Use field names instead of field values for some examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
DangerOnTheRanger committed Feb 2, 2023
1 parent 39263f5 commit 3448066
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions keps/sig-api-machinery/3488-cel-admission-control/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ spec:
validations:
- expression: "self.name.startsWith('xyz-')"
name: name-prefix
messageExpression: "'{} must start with xyz-'.format([self.name])"
message: "self.name must start with xyz-"
reason: Unauthorized
- expression: "self.name.contains('bad')"
name: bad-name
Expand All @@ -885,7 +885,7 @@ spec:
reason: Invalid
- expression: "self.name.contains('suspicious')"
name: suspicious-name
messageExpression: "'{} contains suspicious'.format([self.name])"
message: "'self.name contains suspicious'"
code: 400
reason: Invalid
```
Expand Down Expand Up @@ -2880,7 +2880,7 @@ For example, to validate all containers:
validations:
- scope: "spec.containers[*]"
expression: "scope.name.startsWith('xyz-')"
messageExpression: "'{} does not start with \'xyz\'-'.format([scope.name])"
message: "scope.name does not start with 'xyz'"
```

To make it possible to access the path information in the scope, we can offer a
Expand Down Expand Up @@ -2915,7 +2915,7 @@ Note: We considered extending to a list of scopes, e.g.:
validations:
- scopes: ["spec.containers[*]", "initContainers[*]", "spec.ephemeralContainers[*]"]
expression: "scope.name.startsWith('xyz-')"
messageExpression: "'{} does not start with \'xyz\''.format([scope.name])"
message: "scope.name does not start with 'xyz'"
```

But feedback was this is signficantly more difficult to understand.
Expand Down

0 comments on commit 3448066

Please sign in to comment.