@@ -23,6 +23,8 @@ import (
23
23
authorizationapi "k8s.io/kubernetes/pkg/apis/authorization"
24
24
)
25
25
26
+ // ValidateSubjectAccessReviewSpec validates a SubjectAccessReviewSpec and returns an
27
+ // ErrorList with any errors.
26
28
func ValidateSubjectAccessReviewSpec (spec authorizationapi.SubjectAccessReviewSpec , fldPath * field.Path ) field.ErrorList {
27
29
allErrs := field.ErrorList {}
28
30
if spec .ResourceAttributes != nil && spec .NonResourceAttributes != nil {
@@ -38,6 +40,8 @@ func ValidateSubjectAccessReviewSpec(spec authorizationapi.SubjectAccessReviewSp
38
40
return allErrs
39
41
}
40
42
43
+ // ValidateSelfSubjectAccessReviewSpec validates a SelfSubjectAccessReviewSpec and returns an
44
+ // ErrorList with any errors.
41
45
func ValidateSelfSubjectAccessReviewSpec (spec authorizationapi.SelfSubjectAccessReviewSpec , fldPath * field.Path ) field.ErrorList {
42
46
allErrs := field.ErrorList {}
43
47
if spec .ResourceAttributes != nil && spec .NonResourceAttributes != nil {
@@ -50,10 +54,14 @@ func ValidateSelfSubjectAccessReviewSpec(spec authorizationapi.SelfSubjectAccess
50
54
return allErrs
51
55
}
52
56
57
+ // ValidateSelfSubjectRulesReview validates a SelfSubjectRulesReview and returns an
58
+ // ErrorList with any errors.
53
59
func ValidateSelfSubjectRulesReview (review * authorizationapi.SelfSubjectRulesReview ) field.ErrorList {
54
60
return field.ErrorList {}
55
61
}
56
62
63
+ // ValidateSubjectAccessReview validates a SubjectAccessReview and returns an
64
+ // ErrorList with any errors.
57
65
func ValidateSubjectAccessReview (sar * authorizationapi.SubjectAccessReview ) field.ErrorList {
58
66
allErrs := ValidateSubjectAccessReviewSpec (sar .Spec , field .NewPath ("spec" ))
59
67
objectMetaShallowCopy := sar .ObjectMeta
@@ -64,6 +72,8 @@ func ValidateSubjectAccessReview(sar *authorizationapi.SubjectAccessReview) fiel
64
72
return allErrs
65
73
}
66
74
75
+ // ValidateSelfSubjectAccessReview validates a SelfSubjectAccessReview and returns an
76
+ // ErrorList with any errors.
67
77
func ValidateSelfSubjectAccessReview (sar * authorizationapi.SelfSubjectAccessReview ) field.ErrorList {
68
78
allErrs := ValidateSelfSubjectAccessReviewSpec (sar .Spec , field .NewPath ("spec" ))
69
79
objectMetaShallowCopy := sar .ObjectMeta
@@ -74,6 +84,8 @@ func ValidateSelfSubjectAccessReview(sar *authorizationapi.SelfSubjectAccessRevi
74
84
return allErrs
75
85
}
76
86
87
+ // ValidateLocalSubjectAccessReview validates a LocalSubjectAccessReview and returns an
88
+ // ErrorList with any errors.
77
89
func ValidateLocalSubjectAccessReview (sar * authorizationapi.LocalSubjectAccessReview ) field.ErrorList {
78
90
allErrs := ValidateSubjectAccessReviewSpec (sar .Spec , field .NewPath ("spec" ))
79
91
0 commit comments