File tree Expand file tree Collapse file tree 4 files changed +22
-8
lines changed 
internal/mode/static/state Expand file tree Collapse file tree 4 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -809,7 +809,13 @@ func TestBuildConfiguration(t *testing.T) {
809809					"ca.crt" : "cert-1" ,
810810				},
811811			},
812- 			CACert : []byte ("cert-1" ),
812+ 			CertBundle : graph .NewCertificateBundle (
813+ 				types.NamespacedName {Namespace : "test" , Name : "configmap-1" },
814+ 				"ConfigMap" ,
815+ 				& graph.Certificate {
816+ 					CACert : []byte ("cert-1" ),
817+ 				},
818+ 			),
813819		},
814820		{Namespace : "test" , Name : "configmap-2" }: {
815821			Source : & apiv1.ConfigMap {
@@ -821,7 +827,13 @@ func TestBuildConfiguration(t *testing.T) {
821827					"ca.crt" : []byte ("cert-2" ),
822828				},
823829			},
824- 			CACert : []byte ("cert-2" ),
830+ 			CertBundle : graph .NewCertificateBundle (
831+ 				types.NamespacedName {Namespace : "test" , Name : "configmap-2" },
832+ 				"ConfigMap" ,
833+ 				& graph.Certificate {
834+ 					CACert : []byte ("cert-2" ),
835+ 				},
836+ 			),
825837		},
826838	}
827839
Original file line number Diff line number Diff line change @@ -11,9 +11,7 @@ import (
1111// CaCertConfigMap represents a ConfigMap resource that holds CA Cert data. 
1212type  CaCertConfigMap  struct  {
1313	// Source holds the actual ConfigMap resource. Can be nil if the ConfigMap does not exist. 
14- 	Source  * apiv1.ConfigMap 
15- 	// CACert holds the actual CA Cert data. 
16- 	CACert      []byte 
14+ 	Source      * apiv1.ConfigMap 
1715	CertBundle  * CertificateBundle 
1816}
1917
Original file line number Diff line number Diff line change @@ -900,7 +900,9 @@ func TestBuildGraph(t *testing.T) {
900900			ReferencedCaCertConfigMaps : map [types.NamespacedName ]* CaCertConfigMap {
901901				client .ObjectKeyFromObject (cm ): {
902902					Source : cm ,
903- 					CACert : []byte (caBlock ),
903+ 					CertBundle : NewCertificateBundle (client .ObjectKeyFromObject (cm ), "ConfigMap" , & Certificate {
904+ 						CACert : []byte (caBlock ),
905+ 					}),
904906				},
905907			},
906908			BackendTLSPolicies : map [types.NamespacedName ]* BackendTLSPolicy {
@@ -1162,7 +1164,9 @@ func TestIsReferenced(t *testing.T) {
11621164		ReferencedCaCertConfigMaps : map [types.NamespacedName ]* CaCertConfigMap {
11631165			client .ObjectKeyFromObject (baseConfigMap ): {
11641166				Source : baseConfigMap ,
1165- 				CACert : []byte (caBlock ),
1167+ 				CertBundle : NewCertificateBundle (client .ObjectKeyFromObject (baseConfigMap ), "ConfigMap" , & Certificate {
1168+ 					CACert : []byte (caBlock ),
1169+ 				}),
11661170			},
11671171		},
11681172	}
Original file line number Diff line number Diff line change @@ -64,10 +64,10 @@ func (r *secretResolver) resolve(nsname types.NamespacedName) error {
6464		// Not always guaranteed to have a ca certificate in the secret. 
6565		if  _ , exists  :=  secret .Data [CAKey ]; exists  {
6666			cert .CACert  =  secret .Data [CAKey ]
67+ 			validationErr  =  validateCA (cert .CACert )
6768		}
6869
6970		validationErr  =  validateTLS (cert .TLSCert , cert .TLSPrivateKey )
70- 		validationErr  =  validateCA (cert .CACert )
7171
7272		certBundle  =  NewCertificateBundle (nsname , secret .Kind , cert )
7373	}
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments