Skip to content

Commit 8399557

Browse files
soltyshopenshift-cherrypick-robot
authored and
openshift-cherrypick-robot
committed
Register audit/v1beta1 for master config
1 parent 1c027c1 commit 8399557

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pkg/cmd/server/apis/config/install/install.go

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
apiserverv1alpha1 "k8s.io/apiserver/pkg/apis/apiserver/v1alpha1"
1111
"k8s.io/apiserver/pkg/apis/audit"
1212
auditv1alpha1 "k8s.io/apiserver/pkg/apis/audit/v1alpha1"
13+
auditv1beta1 "k8s.io/apiserver/pkg/apis/audit/v1beta1"
1314

1415
configapi "github.com/openshift/origin/pkg/cmd/server/apis/config"
1516
configapiv1 "github.com/openshift/origin/pkg/cmd/server/apis/config/v1"
@@ -40,6 +41,7 @@ func AddToScheme(scheme *runtime.Scheme) {
4041
// policy file inside master-config.yaml
4142
audit.AddToScheme(scheme)
4243
auditv1alpha1.AddToScheme(scheme)
44+
auditv1beta1.AddToScheme(scheme)
4345
apiserver.AddToScheme(scheme)
4446
apiserverv1alpha1.AddToScheme(scheme)
4547
}

pkg/cmd/server/apis/config/validation/master.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func ValidateAuditConfig(config configapi.AuditConfig, fldPath *field.Path) Vali
242242
} else {
243243
policyConfiguration, ok := config.PolicyConfiguration.(*auditinternal.Policy)
244244
if !ok {
245-
validationResults.AddErrors(field.Invalid(fldPath.Child("policyConfiguration"), config.PolicyConfiguration, "must be of type audit/v1alpha1.Policy"))
245+
validationResults.AddErrors(field.Invalid(fldPath.Child("policyConfiguration"), config.PolicyConfiguration, "must be of type audit/v1beta1.Policy"))
246246
} else {
247247
if err := auditvalidation.ValidatePolicy(policyConfiguration); err != nil {
248248
validationResults.AddErrors(field.Invalid(fldPath.Child("policyConfiguration"), config.PolicyConfiguration, err.ToAggregate().Error()))

0 commit comments

Comments
 (0)