1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-01 15:06:23 +00:00

Use correct labels to delete calico pods

This commit is contained in:
Sebastiaan van Steenis
2019-08-08 19:10:44 +02:00
parent 3f94e86706
commit f1cdff2a3e
2 changed files with 11 additions and 5 deletions

View File

@@ -495,10 +495,9 @@ func RestartClusterPods(ctx context.Context, kubeCluster *Cluster) error {
return fmt.Errorf("Failed to initialize new kubernetes client: %v", err)
}
labelsList := []string{
fmt.Sprintf("%s=%s", KubeAppLabel, CalicoNetworkPlugin),
fmt.Sprintf("%s=%s", KubeAppLabel, FlannelNetworkPlugin),
fmt.Sprintf("%s=%s", KubeAppLabel, CanalNetworkPlugin),
fmt.Sprintf("%s=%s", NameLabel, WeaveNetowrkAppName),
fmt.Sprintf("%s=%s", NameLabel, WeaveNetworkAppName),
fmt.Sprintf("%s=%s", AppLabel, NginxIngressAddonAppName),
fmt.Sprintf("%s=%s", KubeAppLabel, DefaultMonitoringProvider),
fmt.Sprintf("%s=%s", KubeAppLabel, KubeDNSAddonAppName),
@@ -507,6 +506,9 @@ func RestartClusterPods(ctx context.Context, kubeCluster *Cluster) error {
fmt.Sprintf("%s=%s", AppLabel, KubeAPIAuthAppName),
fmt.Sprintf("%s=%s", AppLabel, CattleClusterAgentAppName),
}
for _, calicoLabel := range CalicoNetworkLabels {
labelsList = append(labelsList, fmt.Sprintf("%s=%s", KubeAppLabel, calicoLabel))
}
var errgrp errgroup.Group
labelQueue := util.GetObjectQueue(labelsList)
for w := 0; w < services.WorkerThreads; w++ {