Skip to content

Commit 833c0c2

Browse files
committed
Support modern TLS security Profile
1 parent 191249b commit 833c0c2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

openshift-kube-apiserver/admission/customresourcevalidation/apiserver/validate_apiserver.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ func validateTLSSecurityProfileType(fieldPath *field.Path, profile *configv1.TLS
184184
string(configv1.TLSProfileOldType),
185185
string(configv1.TLSProfileIntermediateType),
186186
string(configv1.TLSProfileCustomType),
187+
string(configv1.TLSProfileModernType),
187188
}
188189

189190
switch profile.Type {
@@ -200,7 +201,9 @@ func validateTLSSecurityProfileType(fieldPath *field.Path, profile *configv1.TLS
200201
errs = append(errs, field.Required(fieldPath.Child("intermediate"), fmt.Sprintf(typeProfileMismatchFmt, profile.Type)))
201202
}
202203
case configv1.TLSProfileModernType:
203-
errs = append(errs, field.NotSupported(fieldPath.Child("type"), profile.Type, availableTypes))
204+
if profile.Modern == nil {
205+
errs = append(errs, field.Required(fieldPath.Child("modern"), fmt.Sprintf(typeProfileMismatchFmt, profile.Type)))
206+
}
204207
case configv1.TLSProfileCustomType:
205208
if profile.Custom == nil {
206209
errs = append(errs, field.Required(fieldPath.Child("custom"), fmt.Sprintf(typeProfileMismatchFmt, profile.Type)))
@@ -247,10 +250,6 @@ func haveRequiredHTTP2CipherSuites(suites []string) bool {
247250
func validateMinTLSVersion(fieldPath *field.Path, version configv1.TLSProtocolVersion) field.ErrorList {
248251
errs := field.ErrorList{}
249252

250-
if version == configv1.VersionTLS13 {
251-
return append(errs, field.NotSupported(fieldPath, version, []string{string(configv1.VersionTLS10), string(configv1.VersionTLS11), string(configv1.VersionTLS12)}))
252-
}
253-
254253
if _, err := libgocrypto.TLSVersion(string(version)); err != nil {
255254
errs = append(errs, field.Invalid(fieldPath, version, err.Error()))
256255
}

0 commit comments

Comments
 (0)