Skip to content

Commit 805d6b6

Browse files
Mikołaj Świątekswiatekm
Mikołaj Świątek
authored andcommitted
Add update-bundle make target
1 parent acc4dda commit 805d6b6

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Refer to the [Operator SDK documentation](https://sdk.operatorframework.io/docs/
3636

3737
Build the manifests, install the CRD and run the operator as a local process:
3838
```bash
39-
make bundle install run
39+
make install run
4040
```
4141

4242
### Deployment with webhooks
@@ -66,7 +66,7 @@ When deploying the operator into the cluster using `make deploy`, an image in th
6666
* `IMG`, to override the entire image specification
6767

6868
```bash
69-
IMG=docker.io/${USER}/opentelemetry-operator:dev-$(git rev-parse --short HEAD)-$(date +%s) make generate bundle container container-push deploy
69+
IMG=docker.io/${USER}/opentelemetry-operator:dev-$(git rev-parse --short HEAD)-$(date +%s) make generate container container-push deploy
7070
```
7171

7272
Your operator will be available in the `opentelemetry-operator-system` namespace.

Makefile

+10-5
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,10 @@ SED ?= $(shell which gsed 2>/dev/null || which sed)
8686
.PHONY: ensure-generate-is-noop
8787
ensure-generate-is-noop: VERSION=$(OPERATOR_VERSION)
8888
ensure-generate-is-noop: USER=open-telemetry
89-
ensure-generate-is-noop: bundle
90-
@# on make bundle config/manager/kustomization.yaml includes changes, which should be ignored for the below check
91-
@git restore config/manager/kustomization.yaml
89+
ensure-generate-is-noop: update-bundle
9290
@git diff -s --exit-code apis/v1alpha1/zz_generated.*.go || (echo "Build failed: a model has been changed but the generated resources aren't up to date. Run 'make generate' and update your PR." && exit 1)
93-
@git diff -s --exit-code bundle config || (echo "Build failed: the bundle, config files has been changed but the generated bundle, config files aren't up to date. Run 'make bundle' and update your PR." && git diff && exit 1)
94-
@git diff -s --exit-code bundle.Dockerfile || (echo "Build failed: the bundle.Dockerfile file has been changed. The file should be the same as generated one. Run 'make bundle' and update your PR." && git diff && exit 1)
91+
@git diff -s --exit-code bundle config || (echo "Build failed: the bundle, config files has been changed but the generated bundle, config files aren't up to date. Run 'make update-bundle' and update your PR." && git diff && exit 1)
92+
@git diff -s --exit-code bundle.Dockerfile || (echo "Build failed: the bundle.Dockerfile file has been changed. The file should be the same as generated one. Run 'make update-bundle' and update your PR." && git diff && exit 1)
9593
@git diff -s --exit-code docs/api.md || (echo "Build failed: the api.md file has been changed but the generated api.md file isn't up to date. Run 'make api-docs' and update your PR." && git diff && exit 1)
9694

9795
.PHONY: all
@@ -398,6 +396,13 @@ bundle: kustomize operator-sdk manifests set-image-controller
398396
$(OPERATOR_SDK) generate kustomize manifests -q
399397
$(KUSTOMIZE) build $(KUSTOMIZATION_DIR) | $(OPERATOR_SDK) generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
400398
$(OPERATOR_SDK) bundle validate ./bundle
399+
400+
# Update the bundle with semantic changes. This will intentionally ignore some changes to metadata, like creation time.
401+
.PHONY: update-bundle
402+
update-bundle: KUSTOMIZATION_BASE = config/manifests
403+
update-bundle: VERSION = $(shell cat versions.txt | grep "operator=" | cut -d "=" -f 2) # the most recent release
404+
update-bundle: USER = open-telemetry
405+
update-bundle: bundle
401406
./hack/ignore-createdAt-bundle.sh
402407

403408
# Build the bundle image, used only for local dev purposes

0 commit comments

Comments
 (0)