File tree Expand file tree Collapse file tree 3 files changed +35
-5
lines changed Expand file tree Collapse file tree 3 files changed +35
-5
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ func (s *Service) translateAPIToAddon(addons []ekscontrolplanev1.Addon) []*eksad
197197		convertedAddon  :=  & eksaddons.EKSAddon {
198198			Name :                  & addon .Name ,
199199			Version :               & addon .Version ,
200- 			Configuration :         & addon .Configuration ,
200+ 			Configuration :         convertConfiguration ( addon .Configuration ) ,
201201			Tags :                  ngTags (s .scope .Cluster .Name , s .scope .AdditionalTags ()),
202202			ResolveConflict :       convertConflictResolution (* addon .ConflictResolution ),
203203			ServiceAccountRoleARN : addon .ServiceAccountRoleArn ,
@@ -215,3 +215,10 @@ func convertConflictResolution(conflict ekscontrolplanev1.AddonResolution) *stri
215215	}
216216	return  aws .String (eks .ResolveConflictsOverwrite )
217217}
218+ 
219+ func  convertConfiguration (configuration  string ) * string  {
220+ 	if  configuration  ==  ""  {
221+ 		return  nil 
222+ 	}
223+ 	return  & configuration 
224+ }
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ type EKSAddon struct {
3636
3737// IsEqual determines if 2 EKSAddon are equal. 
3838func  (e  * EKSAddon ) IsEqual (other  * EKSAddon , includeTags  bool ) bool  {
39- 	//NOTE: we do not compare the ARN as that is only for existing addons 
39+ 	//  NOTE: we do not compare the ARN as that is only for existing addons 
4040	if  e  ==  other  {
4141		return  true 
4242	}
@@ -49,9 +49,6 @@ func (e *EKSAddon) IsEqual(other *EKSAddon, includeTags bool) bool {
4949	if  ! cmp .Equal (e .Configuration , other .Configuration ) {
5050		return  false 
5151	}
52- 	if  ! cmp .Equal (e .ResolveConflict , other .ResolveConflict ) {
53- 		return  false 
54- 	}
5552
5653	if  includeTags  {
5754		diffTags  :=  e .Tags .Difference (other .Tags )
Original file line number Diff line number Diff line change @@ -54,6 +54,32 @@ func TestAddOnEqual(t *testing.T) {
5454			},
5555			result : gomega .BeTrueBecause ("addon values are equal (except status)" ),
5656		},
57+ 		{
58+ 			orig : & EKSAddon {
59+ 				Version :               ptr ("a" ),
60+ 				ServiceAccountRoleARN : ptr ("b" ),
61+ 				Configuration :         nil ,
62+ 			},
63+ 			other : & EKSAddon {
64+ 				Version :               ptr ("a" ),
65+ 				ServiceAccountRoleARN : ptr ("b" ),
66+ 				Configuration :         nil ,
67+ 			},
68+ 			result : gomega .BeTrueBecause ("addon values are equal with optional nil configuration" ),
69+ 		},
70+ 		{
71+ 			orig : & EKSAddon {
72+ 				Version :               ptr ("a" ),
73+ 				ServiceAccountRoleARN : ptr ("b" ),
74+ 				ResolveConflict :       ptr ("OVERWRITE" ),
75+ 			},
76+ 			other : & EKSAddon {
77+ 				Version :               ptr ("a" ),
78+ 				ServiceAccountRoleARN : ptr ("b" ),
79+ 				ResolveConflict :       nil ,
80+ 			},
81+ 			result : gomega .BeTrueBecause ("addon values are equal with expected diff on resolve conflict" ),
82+ 		},
5783		{
5884			orig : & EKSAddon {
5985				Version :               ptr ("a" ),
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments