@@ -527,6 +527,55 @@ servingInfo:
527527 }
528528 },
529529 },
530+ {
531+ name : "ConfigMap with APIServer custom profile with empty ciphers and minTLSVersion - update to empty values" ,
532+ configMap : makeConfigMap (true , map [string ]string {
533+ genericOperatorConfigCMKey : makeGenericOperatorConfigYAML (testCipherSuites , tlsVersion12 ),
534+ }),
535+ apiServer : makeAPIServerConfig (withCustomTLSProfile ([]string {}, "" )),
536+ expectError : false ,
537+ validateConfigMap : func (t * testing.T , original , modified * corev1.ConfigMap ) {
538+ // When Custom profile has empty ciphers/minTLSVersion, it should fall back to default Intermediate profile
539+ defaultTLSConfigMap := makeConfigMap (true , map [string ]string {
540+ genericOperatorConfigCMKey : makeGenericOperatorConfigYAML ([]string {}, "" ),
541+ })
542+ if err := validateConfigMapsEqual (defaultTLSConfigMap , modified ); err != nil {
543+ t .Fatalf ("validation failed: %v" , err )
544+ }
545+ },
546+ },
547+ {
548+ name : "ConfigMap with APIServer custom profile with non-empty ciphers and empty minTLSVersion - update minTLSVersion to an empty value" ,
549+ configMap : makeConfigMap (true , map [string ]string {
550+ genericOperatorConfigCMKey : makeGenericOperatorConfigYAML (testCipherSuites , tlsVersion12 ),
551+ }),
552+ apiServer : makeAPIServerConfig (withCustomTLSProfile (testOpenSSLCipherSuites2 , "" )),
553+ expectError : false ,
554+ validateConfigMap : func (t * testing.T , original , modified * corev1.ConfigMap ) {
555+ expectedConfigMap := makeConfigMap (true , map [string ]string {
556+ genericOperatorConfigCMKey : makeGenericOperatorConfigYAML (testCipherSuites2 , "" ),
557+ })
558+ if err := validateConfigMapsEqual (expectedConfigMap , modified ); err != nil {
559+ t .Fatalf ("validation failed: %v" , err )
560+ }
561+ },
562+ },
563+ {
564+ name : "ConfigMap with APIServer custom profile with empty ciphers and non-empty minTLSVersion - update ciphers to an empty value" ,
565+ configMap : makeConfigMap (true , map [string ]string {
566+ genericOperatorConfigCMKey : makeGenericOperatorConfigYAML (testCipherSuites , tlsVersion12 ),
567+ }),
568+ apiServer : makeAPIServerConfig (withCustomTLSProfile ([]string {}, tlsVersion12 )),
569+ expectError : false ,
570+ validateConfigMap : func (t * testing.T , original , modified * corev1.ConfigMap ) {
571+ expectedConfigMap := makeConfigMap (true , map [string ]string {
572+ genericOperatorConfigCMKey : makeGenericOperatorConfigYAML ([]string {}, tlsVersion12 ),
573+ })
574+ if err := validateConfigMapsEqual (expectedConfigMap , modified ); err != nil {
575+ t .Fatalf ("validation failed: %v" , err )
576+ }
577+ },
578+ },
530579 }
531580
532581 for _ , tt := range tests {
0 commit comments