@@ -114,17 +114,6 @@ func Test_attributesChangeSet(t *testing.T) {
114
114
b * Attributes
115
115
changeSet []* elbv2.LoadBalancerAttribute
116
116
}{
117
- {
118
- name : "a and b contain a default AccessLogsS3Bucket value, expect no change" ,
119
- a : MustNewAttributes ([]* elbv2.LoadBalancerAttribute {lbAttribute (AccessLogsS3BucketKey , "true" )}),
120
- b : MustNewAttributes ([]* elbv2.LoadBalancerAttribute {lbAttribute (AccessLogsS3BucketKey , "true" )}),
121
- },
122
- {
123
- name : "a contains a non-default AccessLogsS3Bucket, b contains default, change to default" ,
124
- a : MustNewAttributes ([]* elbv2.LoadBalancerAttribute {lbAttribute (AccessLogsS3BucketKey , "some bucket" )}),
125
- b : MustNewAttributes (nil ),
126
- changeSet : []* elbv2.LoadBalancerAttribute {lbAttribute (AccessLogsS3BucketKey , "" )},
127
- },
128
117
{
129
118
name : "a and b contain empty defaults, no change" ,
130
119
a : MustNewAttributes (nil ),
@@ -137,22 +126,22 @@ func Test_attributesChangeSet(t *testing.T) {
137
126
changeSet : []* elbv2.LoadBalancerAttribute {lbAttribute (DeletionProtectionEnabledKey , "true" )},
138
127
},
139
128
{
140
- name : fmt .Sprintf ("a contains default, b contains non-default AccessLogsS3EnabledKey, make a change " ),
141
- a : MustNewAttributes (nil ),
142
- b : MustNewAttributes ([]* elbv2.LoadBalancerAttribute {lbAttribute (AccessLogsS3EnabledKey , "true" )}),
143
- changeSet : []* elbv2.LoadBalancerAttribute {lbAttribute (AccessLogsS3EnabledKey , "true" )},
129
+ name : fmt .Sprintf ("enable AccessLogS3 " ),
130
+ a : MustNewAttributes ([] * elbv2. LoadBalancerAttribute { lbAttribute ( AccessLogsS3EnabledKey , "false" ), lbAttribute ( AccessLogsS3BucketKey , "" ), lbAttribute ( AccessLogsS3PrefixKey , "" )} ),
131
+ b : MustNewAttributes ([]* elbv2.LoadBalancerAttribute {lbAttribute (AccessLogsS3EnabledKey , "true" ), lbAttribute ( AccessLogsS3BucketKey , "bucket" ), lbAttribute ( AccessLogsS3PrefixKey , "prefix" ) }),
132
+ changeSet : []* elbv2.LoadBalancerAttribute {lbAttribute (AccessLogsS3EnabledKey , "true" ), lbAttribute ( AccessLogsS3BucketKey , "bucket" ), lbAttribute ( AccessLogsS3PrefixKey , "prefix" ) },
144
133
},
145
134
{
146
- name : fmt .Sprintf ("a contains default, b contains non-default AccessLogsS3BucketKey, make a change " ),
147
- a : MustNewAttributes (nil ),
148
- b : MustNewAttributes ([]* elbv2.LoadBalancerAttribute {lbAttribute (AccessLogsS3BucketKey , "some bucket" )}),
149
- changeSet : []* elbv2.LoadBalancerAttribute {lbAttribute (AccessLogsS3BucketKey , "some bucket " )},
135
+ name : fmt .Sprintf ("disable AccessLogS3, don't change bucket/prefix when it's unchanged. " ),
136
+ a : MustNewAttributes ([] * elbv2. LoadBalancerAttribute { lbAttribute ( AccessLogsS3EnabledKey , "true" ), lbAttribute ( AccessLogsS3BucketKey , "bucket" ), lbAttribute ( AccessLogsS3PrefixKey , "prefix" )} ),
137
+ b : MustNewAttributes ([]* elbv2.LoadBalancerAttribute {lbAttribute (AccessLogsS3EnabledKey , "false" ), lbAttribute ( AccessLogsS3BucketKey , " bucket" ), lbAttribute ( AccessLogsS3PrefixKey , "prefix " )}),
138
+ changeSet : []* elbv2.LoadBalancerAttribute {lbAttribute (AccessLogsS3EnabledKey , "false " )},
150
139
},
151
140
{
152
- name : fmt .Sprintf ("a contains default, b contains non-default AccessLogsS3PrefixKey, make a change " ),
153
- a : MustNewAttributes (nil ),
154
- b : MustNewAttributes ([]* elbv2.LoadBalancerAttribute {lbAttribute (AccessLogsS3PrefixKey , "some prefix " )}),
155
- changeSet : []* elbv2.LoadBalancerAttribute {lbAttribute (AccessLogsS3PrefixKey , "some prefix " )},
141
+ name : fmt .Sprintf ("disable AccessLogS3, don't change bucket/prefix when it's changed " ),
142
+ a : MustNewAttributes ([] * elbv2. LoadBalancerAttribute { lbAttribute ( AccessLogsS3EnabledKey , "true" ), lbAttribute ( AccessLogsS3BucketKey , "bucket" ), lbAttribute ( AccessLogsS3PrefixKey , "prefix" )} ),
143
+ b : MustNewAttributes ([]* elbv2.LoadBalancerAttribute {lbAttribute (AccessLogsS3EnabledKey , "false" ), lbAttribute ( AccessLogsS3BucketKey , "" ), lbAttribute ( AccessLogsS3PrefixKey , " " )}),
144
+ changeSet : []* elbv2.LoadBalancerAttribute {lbAttribute (AccessLogsS3EnabledKey , "false " )},
156
145
},
157
146
{
158
147
name : fmt .Sprintf ("a contains default, b contains non-default IdleTimeoutTimeoutSecondsKey, make a change" ),
0 commit comments