@@ -412,6 +412,41 @@ func TestModifyConfigMap(t *testing.T) {
412412 }
413413 },
414414 },
415+ {
416+ name : "ConfigMap with invalid YAML - no modification" ,
417+ configMap : makeConfigMap (true , map [string ]string {
418+ genericOperatorConfigCMKey : `this is not valid YAML: {{{
419+ malformed: [unclosed
420+ ` ,
421+ }),
422+ apiServer : makeAPIServerConfig (withCustomTLSProfile (testOpenSSLCipherSuites , configv1 .VersionTLS13 )),
423+ expectError : false ,
424+ validateConfigMap : func (t * testing.T , original , modified * corev1.ConfigMap ) {
425+ if err := validateConfigMapsEqual (original , modified ); err != nil {
426+ t .Fatalf ("validation failed: %v" , err )
427+ }
428+ },
429+ },
430+ {
431+ name : "ConfigMap with wrong apiVersion - no modification" ,
432+ configMap : makeConfigMap (true , map [string ]string {
433+ genericOperatorConfigCMKey : `apiVersion: v1
434+ kind: GenericOperatorConfig
435+ servingInfo:
436+ bindAddress: 0.0.0.0:8443
437+ cipherSuites:
438+ - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
439+ minTLSVersion: VersionTLS12
440+ ` ,
441+ }),
442+ apiServer : makeAPIServerConfig (withCustomTLSProfile (testOpenSSLCipherSuites , configv1 .VersionTLS13 )),
443+ expectError : false ,
444+ validateConfigMap : func (t * testing.T , original , modified * corev1.ConfigMap ) {
445+ if err := validateConfigMapsEqual (original , modified ); err != nil {
446+ t .Fatalf ("validation failed: %v" , err )
447+ }
448+ },
449+ },
415450 {
416451 name : "ConfigMap with valid GenericOperatorConfig - annotation=false - no modification" ,
417452 configMap : makeConfigMap (false , map [string ]string {
0 commit comments