Skip to content

Commit 0cd76b0

Browse files
fix: update unstructured-runtime dependency to v1.0.1 and refactor release name handling in Observe function (#176)
1 parent e0720c8 commit 0cd76b0

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/go-logr/logr v1.4.3
88
github.com/gobuffalo/flect v1.0.3
99
github.com/krateoplatformops/plumbing v1.6.0
10-
github.com/krateoplatformops/unstructured-runtime v1.0.0
10+
github.com/krateoplatformops/unstructured-runtime v1.0.1
1111
github.com/stretchr/testify v1.11.1
1212
k8s.io/api v0.35.2
1313
k8s.io/apiextensions-apiserver v0.35.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
169169
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
170170
github.com/krateoplatformops/plumbing v1.6.0 h1:bCS9FLE5JjLEdsn9Ei+HfTLHySil+ne7VLW0zKOSBpg=
171171
github.com/krateoplatformops/plumbing v1.6.0/go.mod h1:L8dMKmq9hO1tz9NzJPlryBj618J5w0PYt8z6fzAbBvs=
172-
github.com/krateoplatformops/unstructured-runtime v1.0.0 h1:fawe8qFQfwTpk2l8VmdvPPVfPi2WY4l/yzuZYgS1UMA=
173-
github.com/krateoplatformops/unstructured-runtime v1.0.0/go.mod h1:k85I4xvMIMSlmNbQN93hF5PHBegPqGV4nHZaKCF0/Nk=
172+
github.com/krateoplatformops/unstructured-runtime v1.0.1 h1:ureSvhxqVTGtS92p0d+TakC7X7osvq5ExbX2334OdCs=
173+
github.com/krateoplatformops/unstructured-runtime v1.0.1/go.mod h1:k85I4xvMIMSlmNbQN93hF5PHBegPqGV4nHZaKCF0/Nk=
174174
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
175175
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
176176
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw=

internal/composition/composition.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ type handler struct {
107107

108108
func (h *handler) Observe(ctx context.Context, mg *unstructured.Unstructured) (controller.ExternalObservation, error) {
109109
mg = mg.DeepCopy()
110-
releaseName := compositionMeta.GetReleaseName(mg)
111110

112111
log := xcontext.Logger(ctx)
113112

@@ -128,6 +127,7 @@ func (h *handler) Observe(ctx context.Context, mg *unstructured.Unstructured) (c
128127
}
129128

130129
compositionMeta.SetReleaseName(mg, compositionMeta.CalculateReleaseName(mg, h.safeReleaseName))
130+
releaseName := compositionMeta.GetReleaseName(mg)
131131
if _, p := compositionMeta.GetGracefullyPausedTime(mg); p && compositionMeta.IsGracefullyPaused(mg) {
132132
log.Debug("Composition is gracefully paused, skipping observe.")
133133
h.eventRecorder.Event(mg, event.Normal(reasonReconciliationGracefullyPaused, "Observe", "Reconciliation is paused via the gracefully paused annotation."))

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func main() {
129129
}...)
130130
defer cancel()
131131

132-
rec, err := eventrecorder.CreateWithThrottle(ctx, cfg, "composition-dynamic-controller", nil)
132+
rec, err := eventrecorder.Create(ctx, cfg, "composition-dynamic-controller", nil)
133133
if err != nil {
134134
log.Error(err, "Creating event recorder.")
135135
os.Exit(1)

0 commit comments

Comments
 (0)