Skip to content

Commit 3d6179c

Browse files
committed
Import ExternalArtifact CRD
Signed-off-by: Stefan Prodan <[email protected]>
1 parent 2e1ef03 commit 3d6179c

File tree

7 files changed

+15
-10
lines changed

7 files changed

+15
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ config/release/
1919
config/crd/bases/ocirepositories.yaml
2020
config/crd/bases/gitrepositories.yaml
2121
config/crd/bases/buckets.yaml
22+
config/crd/bases/externalartifacts.yaml
2223

2324
build/
2425

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ ENVTEST_ARCH ?= amd64
3838
GITREPO_CRD ?= config/crd/bases/gitrepositories.yaml
3939
BUCKET_CRD ?= config/crd/bases/buckets.yaml
4040
OCIREPO_CRD ?= config/crd/bases/ocirepositories.yaml
41+
EA_CRD ?= config/crd/bases/externalartifacts.yaml
4142

4243
# Keep a record of the version of the downloaded source CRDs. It is used to
4344
# detect and download new CRDs when the SOURCE_VER changes.
@@ -90,12 +91,15 @@ $(BUCKET_CRD):
9091
$(OCIREPO_CRD):
9192
curl -s https://raw.githubusercontent.com/fluxcd/source-controller/${SOURCE_VER}/config/crd/bases/source.toolkit.fluxcd.io_ocirepositories.yaml -o $(OCIREPO_CRD)
9293

94+
$(EA_CRD):
95+
curl -s https://raw.githubusercontent.com/fluxcd/source-controller/${SOURCE_VER}/config/crd/bases/source.toolkit.fluxcd.io_externalartifacts.yaml -o $(EA_CRD)
96+
9397
# Download the CRDs the controller depends on
94-
download-crd-deps: $(SOURCE_CRD_VER) $(GITREPO_CRD) $(BUCKET_CRD) $(OCIREPO_CRD)
98+
download-crd-deps: $(SOURCE_CRD_VER) $(GITREPO_CRD) $(BUCKET_CRD) $(OCIREPO_CRD) $(EA_CRD)
9599

96100
# Delete the downloaded CRD dependencies.
97101
cleanup-crd-deps:
98-
rm -f $(GITREPO_CRD) $(BUCKET_CRD) $(OCIREPO_CRD)
102+
rm -f $(GITREPO_CRD) $(BUCKET_CRD) $(OCIREPO_CRD) $(EA_CRD)
99103

100104
# Install CRDs into a cluster
101105
install: manifests

config/default/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33
namespace: kustomize-system
44
resources:
5-
- https://github.com/fluxcd/source-controller/releases/download/v1.6.0/source-controller.crds.yaml
6-
- https://github.com/fluxcd/source-controller/releases/download/v1.6.0/source-controller.deployment.yaml
5+
- https://github.com/fluxcd/source-controller/releases/download/v1.7.0-rc.1/source-controller.crds.yaml
6+
- https://github.com/fluxcd/source-controller/releases/download/v1.7.0-rc.1/source-controller.deployment.yaml
77
- ../crd
88
- ../rbac
99
- ../manager

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ require (
3232
github.com/fluxcd/pkg/ssa v0.53.0
3333
github.com/fluxcd/pkg/tar v0.14.0
3434
github.com/fluxcd/pkg/testserver v0.13.0
35-
github.com/fluxcd/source-controller/api v1.6.0
35+
github.com/fluxcd/source-controller/api v1.7.0-rc.1
3636
github.com/getsops/sops/v3 v3.10.2
3737
github.com/google/cel-go v0.26.1
3838
github.com/hashicorp/vault/api v1.20.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ github.com/fluxcd/pkg/tar v0.14.0 h1:9Gku8FIvPt2bixKldZnzXJ/t+7SloxePlzyVGOK8GVQ
217217
github.com/fluxcd/pkg/tar v0.14.0/go.mod h1:+rOWYk93qLEJ8WwmkvJOkB8i0dna1mrwJFybE8i9Udo=
218218
github.com/fluxcd/pkg/testserver v0.13.0 h1:xEpBcEYtD7bwvZ+i0ZmChxKkDo/wfQEV3xmnzVybSSg=
219219
github.com/fluxcd/pkg/testserver v0.13.0/go.mod h1:akRYv3FLQUsme15na9ihECRG6hBuqni4XEY9W8kzs8E=
220-
github.com/fluxcd/source-controller/api v1.6.0 h1:IxfjUczJ2pzbXIef6iQ0RHEH4AYA9anJfTGK8dzwODM=
221-
github.com/fluxcd/source-controller/api v1.6.0/go.mod h1:ZJcAi0nemsnBxjVgmJl0WQzNvB0rMETxQMTdoFosmMw=
220+
github.com/fluxcd/source-controller/api v1.7.0-rc.1 h1:FPTZJqLFJQHjP53m1IXN1JzuE0s6KPAU2JepFuXAlDE=
221+
github.com/fluxcd/source-controller/api v1.7.0-rc.1/go.mod h1:sbJibK4Ik+2AuTRRLXPA+n2u6nLUIGaxC07ava+RqeM=
222222
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
223223
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
224224
github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=

internal/controller/kustomization_indexers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ import (
2020
"context"
2121
"fmt"
2222

23+
"github.com/fluxcd/pkg/apis/meta"
2324
"github.com/fluxcd/pkg/runtime/conditions"
2425
ctrl "sigs.k8s.io/controller-runtime"
2526
"sigs.k8s.io/controller-runtime/pkg/client"
2627
"sigs.k8s.io/controller-runtime/pkg/handler"
2728
"sigs.k8s.io/controller-runtime/pkg/reconcile"
2829

2930
"github.com/fluxcd/pkg/runtime/dependency"
30-
sourcev1 "github.com/fluxcd/source-controller/api/v1"
3131

3232
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
3333
)
@@ -36,7 +36,7 @@ func (r *KustomizationReconciler) requestsForRevisionChangeOf(indexKey string) h
3636
return func(ctx context.Context, obj client.Object) []reconcile.Request {
3737
log := ctrl.LoggerFrom(ctx)
3838
repo, ok := obj.(interface {
39-
GetArtifact() *sourcev1.Artifact
39+
GetArtifact() *meta.Artifact
4040
})
4141
if !ok {
4242
log.Error(fmt.Errorf("expected an object conformed with GetArtifact() method, but got a %T", obj),

internal/controller/suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ func applyGitRepository(objKey client.ObjectKey, artifactName string,
331331
Reason: sourcev1.GitOperationSucceedReason,
332332
},
333333
},
334-
Artifact: &sourcev1.Artifact{
334+
Artifact: &meta.Artifact{
335335
Path: url,
336336
URL: url,
337337
Revision: revision,

0 commit comments

Comments
 (0)