Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e69fd47

Browse files
garbage collect only resources that belongs to the specific CR
1 parent d677b43 commit e69fd47

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

‎config/manager/kustomization.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ kind: Kustomization
1313
images:
1414
- name: controller
1515
newName: itayankri/osrm-operator
16-
newTag: v1.5.0
16+
newTag: latest

‎controllers/osrmcluster_controller.go‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,9 @@ func (r *OSRMClusterReconciler) getChildResources(ctx context.Context, instance
449449

450450
func (r *OSRMClusterReconciler) garbageCollection(ctx context.Context, instance *osrmv1alpha1.OSRMCluster) error {
451451
labelSelector := fmt.Sprintf(
452-
"%s in (%s),%s,%s notin (%d)",
452+
"%s in (%s),%s in (%s),%s,%s notin (%d)",
453+
metadata.NameLabelKey,
454+
instance.Name,
453455
metadata.ComponentLabelKey,
454456
metadata.ComponentLabelProfile,
455457
metadata.GenerationLabelKey,

‎internal/metadata/labels.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ const (
1414
ComponentLabelProfile ComponentLabelValue = "profile"
1515
)
1616

17-
const NameLabel = "app.kubernetes.io/name"
17+
const NameLabelKey = "app.kubernetes.io/name"
1818
const PartOfLabelKey = "app.kubernetes.io/part-of"
1919
const ComponentLabelKey = "app.kubernetes.io/component"
2020
const GenerationLabelKey = "osrmcluster.itayankri/cluster-generation"
2121

2222
func GetLabels(instance *osrmv1alpha1.OSRMCluster, componentName ComponentLabelValue) map[string]string {
2323
labels := map[string]string{
24-
NameLabel: instance.Name,
24+
NameLabelKey: instance.Name,
2525
PartOfLabelKey: "osrmcluster",
2626
ComponentLabelKey: string(componentName),
2727
GenerationLabelKey: strconv.FormatInt(instance.ObjectMeta.Generation, 10),

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /