Skip to content

Commit 7a1f8aa

Browse files
authored
Merge pull request kubernetes#128554 from ritazh/webhookmatchcondition-doc-comment
Add WebhookMatchCondition doc comment
2 parents a885e44 + 151599d commit 7a1f8aa

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

staging/src/k8s.io/apiserver/pkg/apis/apiserver/types.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,13 @@ type WebhookMatchCondition struct {
401401
// If version specified by subjectAccessReviewVersion in the request variable is v1beta1,
402402
// the contents would be converted to the v1 version before evaluating the CEL expression.
403403
//
404+
// - 'resourceAttributes' describes information for a resource access request and is unset for non-resource requests. e.g. has(request.resourceAttributes) && request.resourceAttributes.namespace == 'default'
405+
// - 'nonResourceAttributes' describes information for a non-resource access request and is unset for resource requests. e.g. has(request.nonResourceAttributes) && request.nonResourceAttributes.path == '/healthz'.
406+
// - 'user' is the user to test for. e.g. request.user == 'alice'
407+
// - 'groups' is the groups to test for. e.g. ('group1' in request.groups)
408+
// - 'extra' corresponds to the user.Info.GetExtra() method from the authenticator.
409+
// - 'uid' is the information about the requesting user. e.g. request.uid == '1'
410+
//
404411
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
405412
Expression string
406413
}

staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1/types.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ type WebhookMatchCondition struct {
164164
// If version specified by subjectAccessReviewVersion in the request variable is v1beta1,
165165
// the contents would be converted to the v1 version before evaluating the CEL expression.
166166
//
167+
// - 'resourceAttributes' describes information for a resource access request and is unset for non-resource requests. e.g. has(request.resourceAttributes) && request.resourceAttributes.namespace == 'default'
168+
// - 'nonResourceAttributes' describes information for a non-resource access request and is unset for resource requests. e.g. has(request.nonResourceAttributes) && request.nonResourceAttributes.path == '/healthz'.
169+
// - 'user' is the user to test for. e.g. request.user == 'alice'
170+
// - 'groups' is the groups to test for. e.g. ('group1' in request.groups)
171+
// - 'extra' corresponds to the user.Info.GetExtra() method from the authenticator.
172+
// - 'uid' is the information about the requesting user. e.g. request.uid == '1'
173+
//
167174
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
168175
Expression string `json:"expression"`
169176
}

staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/types.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,13 @@ type WebhookMatchCondition struct {
615615
// If version specified by subjectAccessReviewVersion in the request variable is v1beta1,
616616
// the contents would be converted to the v1 version before evaluating the CEL expression.
617617
//
618+
// - 'resourceAttributes' describes information for a resource access request and is unset for non-resource requests. e.g. has(request.resourceAttributes) && request.resourceAttributes.namespace == 'default'
619+
// - 'nonResourceAttributes' describes information for a non-resource access request and is unset for resource requests. e.g. has(request.nonResourceAttributes) && request.nonResourceAttributes.path == '/healthz'.
620+
// - 'user' is the user to test for. e.g. request.user == 'alice'
621+
// - 'groups' is the groups to test for. e.g. ('group1' in request.groups)
622+
// - 'extra' corresponds to the user.Info.GetExtra() method from the authenticator.
623+
// - 'uid' is the information about the requesting user. e.g. request.uid == '1'
624+
//
618625
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
619626
Expression string `json:"expression"`
620627
}

staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/types.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,13 @@ type WebhookMatchCondition struct {
586586
// If version specified by subjectAccessReviewVersion in the request variable is v1beta1,
587587
// the contents would be converted to the v1 version before evaluating the CEL expression.
588588
//
589+
// - 'resourceAttributes' describes information for a resource access request and is unset for non-resource requests. e.g. has(request.resourceAttributes) && request.resourceAttributes.namespace == 'default'
590+
// - 'nonResourceAttributes' describes information for a non-resource access request and is unset for resource requests. e.g. has(request.nonResourceAttributes) && request.nonResourceAttributes.path == '/healthz'.
591+
// - 'user' is the user to test for. e.g. request.user == 'alice'
592+
// - 'groups' is the groups to test for. e.g. ('group1' in request.groups)
593+
// - 'extra' corresponds to the user.Info.GetExtra() method from the authenticator.
594+
// - 'uid' is the information about the requesting user. e.g. request.uid == '1'
595+
//
589596
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
590597
Expression string `json:"expression"`
591598
}

0 commit comments

Comments
 (0)