Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit 07f4873

Browse files
committed
set image
1 parent d8780b0 commit 07f4873

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+75
-70
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ _artifacts
3939

4040
# Goreleaser
4141
dist
42+
43+
# test ephemeral input
44+
test/metadata.yaml

Makefile

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ E2E_FOCUS := "functional tests"
3737
TOOLS_DIR := hack/tools
3838
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin
3939
BIN_DIR := bin
40-
TEST_E2E_DIR := test/e2e
40+
TEST_DIR := test
41+
TEST_E2E_DIR := $(TEST_DIR)/e2e
42+
TEST_METADATA_YAML := $(TEST_DIR)/metadata.yaml
4143

4244
# Binaries.
4345
KUSTOMIZE := $(TOOLS_BIN_DIR)/kustomize
@@ -197,10 +199,14 @@ test: generate fmt vet crds
197199
go test ./... -coverprofile cover.out
198200

199201
# Run e2e tests
200-
e2e:
202+
.PHONY: e2e $(TEST_METADATA_YAML)
203+
$(TEST_METADATA_YAML):
204+
cat $(METADATA_TEMPLATE) | sed 's/MAJOR/$(VERSION_MAJOR)/g' | sed 's/MINOR/$(VERSION_MINOR)/g' | sed 's/CONTRACT/$(VERSION_CONTRACT)/g' > $@
205+
206+
e2e: $(TEST_METADATA_YAML)
201207
# This is the name used inside the component.yaml for the container that runs the manager
202208
# The image gets loaded inside kind from ./test/e2e/config/packet-dev.yaml
203-
$(E2E_FLAGS) $(MAKE) -C test/e2e run
209+
$(E2E_FLAGS) $(MAKE) -C $(TEST_E2E_DIR) run
204210

205211
# Build manager binary
206212
manager: $(MANAGER)
@@ -222,11 +228,11 @@ uninstall: crds
222228
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
223229
deploy: crds
224230
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
225-
$(KUSTOMIZE) build config/default | kubectl apply -f -
231+
$(KUSTOMIZE) build config/release | kubectl apply -f -
226232

227233
# Generate manifests e.g. CRD, RBAC etc.
228234
crds: controller-gen
229-
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
235+
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/resources/crd/bases
230236

231237
# Run go fmt against code
232238
fmt:
@@ -305,15 +311,12 @@ endif
305311

306312
manifest: kustomize semver release-manifests release-clusterctl release-cluster-template
307313

308-
release:
309-
goreleaser release --rm-dist --snapshot --skip-publish --debug
310-
311-
release/publish:
312-
goreleaser release --rm-dist
313-
314314
release-manifests: semver $(RELEASE_MANIFEST) $(RELEASE_METADATA) $(RELEASE_CLUSTER_TEMPLATE)
315-
$(RELEASE_MANIFEST): $(RELEASE_DIR) ## Builds the manifests to publish with a release
316-
$(KUSTOMIZE) build config/default > $@
315+
release-version:
316+
KUSTOMIZE_ENABLE_ALPHA_COMMANDS=true $(KUSTOMIZE) config set config/release image-tag $(VERSION)
317+
318+
$(RELEASE_MANIFEST): $(RELEASE_DIR) release-version ## Builds the manifests to publish with a release
319+
$(KUSTOMIZE) build config/release > $@
317320

318321
$(RELEASE_METADATA): semver $(RELEASE_DIR) $(METADATA_TEMPLATE)
319322
cat $(METADATA_TEMPLATE) | sed 's/MAJOR/$(VERSION_MAJOR)/g' | sed 's/MINOR/$(VERSION_MINOR)/g' | sed 's/CONTRACT/$(VERSION_CONTRACT)/g' > $@

README.md

Lines changed: 2 additions & 1 deletion

config/default/manager_image_patch.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

config/kustomization.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

config/managerless/kustomization.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ namespace: cluster-api-provider-packet-system
99
namePrefix: cluster-api-provider-packet-
1010

1111
# Labels to add to all resources and selectors.
12-
#commonLabels:
13-
# someName: someValue
12+
commonLabels:
13+
cluster.x-k8s.io/provider: infrastructure-packet
1414

15-
bases:
16-
- ../crd
17-
- ../rbac
18-
- ../namespace
15+
resources:
16+
- ../resources/crd
17+
- ../resources/rbac
18+
- ../resources/namespace
Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
# Adds namespace to all resources.
22
namespace: cluster-api-provider-packet-system
3-
43
# Value of this field is prepended to the
54
# names of all resources, e.g. a deployment named
65
# "wordpress" becomes "alices-wordpress".
76
# Note that it should also match with the prefix (text before '-') of the namespace
87
# field above.
98
namePrefix: cluster-api-provider-packet-
10-
119
# Labels to add to all resources and selectors.
1210
commonLabels:
1311
cluster.x-k8s.io/provider: infrastructure-packet
14-
15-
bases:
16-
- ../crd
17-
- ../rbac
18-
- ../namespace
19-
- ../manager
12+
resources:
13+
- ../resources/crd
14+
- ../resources/rbac
15+
- ../resources/namespace
16+
- ../resources/manager
2017
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
2118
# crd/kustomization.yaml
2219
#- ../webhook
2320
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
2421
#- ../certmanager
2522
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
2623
#- ../prometheus
27-
24+
images:
25+
- name: packet-controller # images with this name
26+
newTag: v0.3.0 # {"type":"string","x-kustomize":{"setter":{"name":"image-tag","value":"v0.3.0"}}}
27+
newName: packethost/cluster-api-provider-packet # and this name
2828
patchesStrategicMerge:
29-
# Protect the /metrics endpoint by putting it behind auth.
30-
# If you want your controller-manager to expose the /metrics
31-
# endpoint w/o any authn/z, please comment the following line.
29+
# Protect the /metrics endpoint by putting it behind auth.
30+
# If you want your controller-manager to expose the /metrics
31+
# endpoint w/o any authn/z, please comment the following line.
3232
- manager_auth_proxy_patch.yaml
33-
- manager_image_patch.yaml

0 commit comments

Comments
 (0)