Skip to content

Commit 6d7664f

Browse files
committed
Add make update target
This target updates all the generated content. It's more convenient than needing to list all the individual targets.
1 parent 419c160 commit 6d7664f

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ We gratefully welcome improvements to documentation as well as to code.
1919
* `make lint` to run linters
2020
* `make fmt` to format Go code
2121
* `make vet` to run `go vet`
22-
* `make generate` to generate code and manifests based on Go struct definitions for CRDs.
22+
* `make update` to generate code and manifests based on Go struct definitions for CRDs.
2323

2424
`make precommit` includes all of the above.
2525

@@ -40,15 +40,15 @@ gh pr create
4040
The following command should be run to make sure the project manifests are up-to-date:
4141

4242
```bash
43-
make generate manifests bundle api-docs reset
43+
make update
4444
```
4545

4646
The local changes after running the command should be added to the pull request:
4747

4848
The following `make` target is run on CI to verify the project structure:
4949

5050
```bash
51-
make ensure-generate-is-noop
51+
make ensure-update-is-noop
5252
```
5353

5454
### Adding new components - webhook, API

Makefile

+10-9
Original file line numberDiff line numberDiff line change
@@ -123,22 +123,23 @@ MIN_OPENSHIFT_VERSION ?= 4.12
123123
## consistent with Linux.
124124
SED ?= $(shell which gsed 2>/dev/null || which sed)
125125

126-
.PHONY: ensure-generate-is-noop
127-
ensure-generate-is-noop: VERSION=$(OPERATOR_VERSION)
128-
ensure-generate-is-noop: DOCKER_USER=open-telemetry
129-
ensure-generate-is-noop: set-image-controller generate bundle
130-
@# on make bundle config/manager/kustomization.yaml includes changes, which should be ignored for the below check
131-
@git restore config/manager/kustomization.yaml
126+
.PHONY: ensure-update-is-noop
127+
ensure-update-is-noop: VERSION=$(OPERATOR_VERSION)
128+
ensure-update-is-noop: DOCKER_USER=open-telemetry
129+
ensure-update-is-noop: set-image-controller update
132130
@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)
133131
@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)
134-
@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)
132+
@git diff -s --exit-code docs/api || (echo "Build failed: a model has been changed but the generated docs/api/*.md files aren't up to date. Run 'make api-docs' and update your PR." && git diff && exit 1)
135133

136134
.PHONY: all
137135
all: manager targetallocator operator-opamp-bridge
138136

139137
# No lint here, as CI runs it separately
140138
.PHONY: ci
141-
ci: generate fmt vet test ensure-generate-is-noop
139+
ci: generate fmt vet test ensure-update-is-noop
140+
141+
.PHONY: update
142+
update: generate manifests bundle api-docs reset
142143

143144
# Build manager binary
144145
.PHONY: manager
@@ -257,7 +258,7 @@ test: envtest
257258
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(KUBE_VERSION) -p path)" go test ${GOTEST_OPTS} ./...
258259

259260
.PHONY: precommit
260-
precommit: generate fmt vet lint test ensure-generate-is-noop reset
261+
precommit: fmt vet lint test ensure-update-is-noop
261262

262263
# Run go fmt against code
263264
.PHONY: fmt

0 commit comments

Comments
 (0)