Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build environment
# -----------------
FROM golang:1.25-trixie AS builder
FROM golang:1.25.6-bookworm AS builder
LABEL stage=builder

ARG DEBIAN_FRONTEND=noninteractive
Expand All @@ -21,6 +21,7 @@ RUN go mod download

# COPY apis/ apis/
COPY internal/ internal/
COPY pkg/ pkg/
COPY main.go main.go

# Build
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/krateoplatformops/composition-dynamic-controller

go 1.25.3
go 1.25.6

require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/go-logr/logr v1.4.3
github.com/gobuffalo/flect v1.0.3
github.com/krateoplatformops/plumbing v1.3.1
github.com/krateoplatformops/plumbing v1.6.0
github.com/krateoplatformops/unstructured-runtime v1.0.0
github.com/stretchr/testify v1.11.1
k8s.io/api v0.35.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/krateoplatformops/plumbing v1.3.1 h1:DQc/ohBiGfI6mC3l2T+3ZvtSR0r3hOLqdxu73xjZUDM=
github.com/krateoplatformops/plumbing v1.3.1/go.mod h1:51a1TKAoCXRHH7cJB8kiYZcIV8ci3PLPtabqBdoD9Zg=
github.com/krateoplatformops/plumbing v1.6.0 h1:bCS9FLE5JjLEdsn9Ei+HfTLHySil+ne7VLW0zKOSBpg=
github.com/krateoplatformops/plumbing v1.6.0/go.mod h1:L8dMKmq9hO1tz9NzJPlryBj618J5w0PYt8z6fzAbBvs=
github.com/krateoplatformops/unstructured-runtime v1.0.0 h1:fawe8qFQfwTpk2l8VmdvPPVfPi2WY4l/yzuZYgS1UMA=
github.com/krateoplatformops/unstructured-runtime v1.0.0/go.mod h1:k85I4xvMIMSlmNbQN93hF5PHBegPqGV4nHZaKCF0/Nk=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
Expand Down
12 changes: 6 additions & 6 deletions internal/composition/composition.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
xcontext "github.com/krateoplatformops/unstructured-runtime/pkg/context"

"github.com/krateoplatformops/composition-dynamic-controller/internal/chartinspector"
compositionMeta "github.com/krateoplatformops/composition-dynamic-controller/internal/meta"
compositionMeta "github.com/krateoplatformops/composition-dynamic-controller/pkg/meta"
unstructuredtools "github.com/krateoplatformops/unstructured-runtime/pkg/tools/unstructured"

"github.com/krateoplatformops/composition-dynamic-controller/internal/rbacgen"
Expand Down Expand Up @@ -176,7 +176,7 @@ func (h *handler) Observe(ctx context.Context, mg *unstructured.Unstructured) (c
return controller.ExternalObservation{}, fmt.Errorf("finding helm release: %w", err)
}
if rel == nil {
log.Debug("Composition not found.")
log.Debug("Release not found.")
return controller.ExternalObservation{
ResourceExists: false,
ResourceUpToDate: false,
Expand Down Expand Up @@ -557,8 +557,8 @@ func (h *handler) Update(ctx context.Context, mg *unstructured.Unstructured) err
return fmt.Errorf("getting helm release: %w", err)
}
if upgradedRel == nil {
log.Debug("Composition not found after upgrade.")
return fmt.Errorf("composition not found after upgrade")
log.Debug("Release not found after upgrade.")
return fmt.Errorf("release not found after upgrade")
}

previousDigest, err := maps.NestedString(mg.Object, "status", "digest")
Expand Down Expand Up @@ -674,8 +674,8 @@ func (h *handler) Delete(ctx context.Context, mg *unstructured.Unstructured) err
return fmt.Errorf("finding helm release: %w", err)
}
if rel == nil {
log.Debug("Composition not found, nothing to uninstall.", "package", pkg.URL)
h.eventRecorder.Event(mg, event.Normal(reasonDeleted, "Delete", fmt.Sprintf("Composition not found, nothing to uninstall: %s", mg.GetName())))
log.Debug("Release not found, nothing to uninstall.", "package", pkg.URL)
h.eventRecorder.Event(mg, event.Normal(reasonDeleted, "Delete", fmt.Sprintf("Release not found, nothing to uninstall: %s", mg.GetName())))
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion internal/composition/composition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"k8s.io/apimachinery/pkg/types"

"github.com/gobuffalo/flect"
compositionMeta "github.com/krateoplatformops/composition-dynamic-controller/internal/meta"
"github.com/krateoplatformops/composition-dynamic-controller/internal/tools/archive"
compositionMeta "github.com/krateoplatformops/composition-dynamic-controller/pkg/meta"
"github.com/krateoplatformops/plumbing/kubeutil/event"
"github.com/krateoplatformops/plumbing/kubeutil/eventrecorder"
"github.com/krateoplatformops/unstructured-runtime/pkg/controller"
Expand Down
2 changes: 1 addition & 1 deletion internal/tools/archive/getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"strings"

compositionMeta "github.com/krateoplatformops/composition-dynamic-controller/internal/meta"
compositionMeta "github.com/krateoplatformops/composition-dynamic-controller/pkg/meta"

"github.com/krateoplatformops/unstructured-runtime/pkg/logging"
"github.com/krateoplatformops/unstructured-runtime/pkg/pluralizer"
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (

"github.com/go-logr/logr"
"github.com/krateoplatformops/composition-dynamic-controller/internal/composition"
"github.com/krateoplatformops/composition-dynamic-controller/internal/meta"
"github.com/krateoplatformops/composition-dynamic-controller/internal/tools/archive"
"github.com/krateoplatformops/composition-dynamic-controller/internal/tools/dynamic"
"github.com/krateoplatformops/composition-dynamic-controller/pkg/meta"
"github.com/krateoplatformops/plumbing/env"
"github.com/krateoplatformops/plumbing/kubeutil/event"
"github.com/krateoplatformops/plumbing/kubeutil/eventrecorder"
Expand Down
File renamed without changes.
File renamed without changes.
Loading