Skip to content

Commit

Permalink
feat: exported finalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
bugbuilder committed Oct 24, 2024
1 parent ab15f92 commit 01a71cb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions templates/pkg/resource/descriptor.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

const (
finalizerString = "finalizers.{{ .APIGroup }}/{{ .CRD.Kind }}"
FinalizerString = "finalizers.{{ .APIGroup }}/{{ .CRD.Kind }}"
)

var (
Expand Down Expand Up @@ -75,8 +75,8 @@ func (d *resourceDescriptor) IsManaged(
// https://github.com/kubernetes-sigs/controller-runtime/issues/994 is
// fixed. This should be able to be:
//
// return k8sctrlutil.ContainsFinalizer(obj, finalizerString)
return containsFinalizer(obj, finalizerString)
// return k8sctrlutil.ContainsFinalizer(obj, FinalizerString)
return containsFinalizer(obj, FinalizerString)
}

// Remove once https://github.com/kubernetes-sigs/controller-runtime/issues/994
Expand Down Expand Up @@ -105,7 +105,7 @@ func (d *resourceDescriptor) MarkManaged(
// Should not happen. If it does, there is a bug in the code
panic("nil RuntimeMetaObject in AWSResource")
}
k8sctrlutil.AddFinalizer(obj, finalizerString)
k8sctrlutil.AddFinalizer(obj, FinalizerString)
}

// MarkUnmanaged removes the supplied resource from management by ACK. What
Expand All @@ -120,7 +120,7 @@ func (d *resourceDescriptor) MarkUnmanaged(
// Should not happen. If it does, there is a bug in the code
panic("nil RuntimeMetaObject in AWSResource")
}
k8sctrlutil.RemoveFinalizer(obj, finalizerString)
k8sctrlutil.RemoveFinalizer(obj, FinalizerString)
}

// MarkAdopted places descriptors on the custom resource that indicate the
Expand Down

0 comments on commit 01a71cb

Please sign in to comment.