Skip to content

Commit 6bf9175

Browse files
authored
Don't try to uncordon on startup in Queue Processor mode (#743)
1 parent e561eb0 commit 6bf9175

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

cmd/node-termination-handler.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func main() {
113113
nthConfig.Print()
114114
log.Fatal().Err(err).Msg("Unable to instantiate probes service,")
115115
}
116-
imdsDisabled := nthConfig.EnableSQSTerminationDraining
116+
imdsDisabled := nthConfig.EnableSQSTerminationDraining
117117

118118
imds := ec2metadata.New(nthConfig.MetadataURL, nthConfig.MetadataTries)
119119

@@ -139,7 +139,7 @@ func main() {
139139

140140
nthConfig.Print()
141141

142-
if nthConfig.EnableScheduledEventDraining {
142+
if !imdsDisabled && nthConfig.EnableScheduledEventDraining {
143143
stopCh := make(chan struct{})
144144
go func() {
145145
time.Sleep(8 * time.Second)
@@ -164,19 +164,19 @@ func main() {
164164
defer close(cancelChan)
165165

166166
monitoringFns := map[string]monitor.Monitor{}
167-
if !imdsDisabled {
168-
if nthConfig.EnableSpotInterruptionDraining {
169-
imdsSpotMonitor := spotitn.NewSpotInterruptionMonitor(imds, interruptionChan, cancelChan, nthConfig.NodeName)
170-
monitoringFns[spotITN] = imdsSpotMonitor
171-
}
172-
if nthConfig.EnableScheduledEventDraining {
173-
imdsScheduledEventMonitor := scheduledevent.NewScheduledEventMonitor(imds, interruptionChan, cancelChan, nthConfig.NodeName)
174-
monitoringFns[scheduledMaintenance] = imdsScheduledEventMonitor
175-
}
176-
if nthConfig.EnableRebalanceMonitoring || nthConfig.EnableRebalanceDraining {
177-
imdsRebalanceMonitor := rebalancerecommendation.NewRebalanceRecommendationMonitor(imds, interruptionChan, nthConfig.NodeName)
178-
monitoringFns[rebalanceRecommendation] = imdsRebalanceMonitor
179-
}
167+
if !imdsDisabled {
168+
if nthConfig.EnableSpotInterruptionDraining {
169+
imdsSpotMonitor := spotitn.NewSpotInterruptionMonitor(imds, interruptionChan, cancelChan, nthConfig.NodeName)
170+
monitoringFns[spotITN] = imdsSpotMonitor
171+
}
172+
if nthConfig.EnableScheduledEventDraining {
173+
imdsScheduledEventMonitor := scheduledevent.NewScheduledEventMonitor(imds, interruptionChan, cancelChan, nthConfig.NodeName)
174+
monitoringFns[scheduledMaintenance] = imdsScheduledEventMonitor
175+
}
176+
if nthConfig.EnableRebalanceMonitoring || nthConfig.EnableRebalanceDraining {
177+
imdsRebalanceMonitor := rebalancerecommendation.NewRebalanceRecommendationMonitor(imds, interruptionChan, nthConfig.NodeName)
178+
monitoringFns[rebalanceRecommendation] = imdsRebalanceMonitor
179+
}
180180
}
181181
if nthConfig.EnableSQSTerminationDraining {
182182
cfg := aws.NewConfig().WithRegion(nthConfig.AWSRegion).WithEndpoint(nthConfig.AWSEndpoint).WithSTSRegionalEndpoint(endpoints.RegionalSTSEndpoint)

0 commit comments

Comments
 (0)