@@ -145,9 +145,8 @@ func (h *Unidler) Unidle(ctx context.Context, namespace *corev1.Namespace, opLog
145
145
}
146
146
for _ , deploy := range deployments .Items {
147
147
// if the idled annotation is true
148
- av , aok := deploy .ObjectMeta .Annotations ["idling.amazee.io/idled" ]
149
148
lv , lok := deploy .ObjectMeta .Labels ["idling.amazee.io/idled" ]
150
- if aok && av == "true" || lok && lv == "true" {
149
+ if lok && lv == "true" {
151
150
opLog .Info (fmt .Sprintf ("Deployment %s - Replicas %v - %s" , deploy .ObjectMeta .Name , * deploy .Spec .Replicas , namespace .Name ))
152
151
if * deploy .Spec .Replicas == 0 {
153
152
// default to scaling to 1 replica
@@ -166,14 +165,13 @@ func (h *Unidler) Unidle(ctx context.Context, namespace *corev1.Namespace, opLog
166
165
"replicas" : newReplicas ,
167
166
},
168
167
"metadata" : map [string ]interface {}{
169
- "labels" : map [string ]* string {
170
- "idling.amazee.io/idled" : nil ,
168
+ "labels" : map [string ]interface {} {
169
+ "idling.amazee.io/idled" : "false" ,
171
170
"idling.amazee.io/force-idled" : nil ,
172
171
"idling.amazee.io/force-scaled" : nil ,
173
172
},
174
- "annotations" : map [string ]* string {
173
+ "annotations" : map [string ]interface {} {
175
174
"idling.amazee.io/idled-at" : nil ,
176
- "idling.amazee.io/idled" : nil ,
177
175
},
178
176
},
179
177
})
0 commit comments