Skip to content

Commit

Permalink
add gardener shoot.gardener.cloud/no-cleanup=true labels to prevent d…
Browse files Browse the repository at this point in the history
…angling volumesnapshots, closes #15 (#17)
  • Loading branch information
majst01 authored Sep 15, 2021
1 parent 58c4bbd commit f7b77f6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions controllers/storageclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,11 @@ var (
// Node DaemonSet
nodeRoleLabels = map[string]string{"app": lbCSINodeName, "role": "node"}
csiNodeDaemonSet = apps.DaemonSet{
ObjectMeta: metav1.ObjectMeta{Name: lbCSINodeName, Namespace: namespace},
ObjectMeta: metav1.ObjectMeta{
Name: lbCSINodeName,
Namespace: namespace,
Labels: map[string]string{"shoot.gardener.cloud/no-cleanup": "true"},
},
Spec: apps.DaemonSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: nodeRoleLabels},
UpdateStrategy: apps.DaemonSetUpdateStrategy{
Expand Down Expand Up @@ -849,7 +853,13 @@ func (r *DurosReconciler) deployStorageClass(ctx context.Context, projectID stri
log.Info("clusterrolebindinding", "name", crb.Name, "operation", op)
}

sts := &apps.StatefulSet{ObjectMeta: metav1.ObjectMeta{Name: lbCSIControllerName, Namespace: namespace}}
sts := &apps.StatefulSet{
ObjectMeta: metav1.ObjectMeta{
Name: lbCSIControllerName,
Namespace: namespace,
Labels: map[string]string{"shoot.gardener.cloud/no-cleanup": "true"},
},
}
op, err := controllerutil.CreateOrUpdate(ctx, r.Shoot, sts, func() error {

controllerRoleLabels := map[string]string{"app": "lb-csi-plugin", "role": "controller"}
Expand Down

0 comments on commit f7b77f6

Please sign in to comment.