Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] SDCICD-1241 enforce sync between operator version vars and operator branch names #338

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 5 additions & 0 deletions boilerplate/openshift/golang-osd-operator/prow-config
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ build_root:
images:
- dockerfile_path: build/Dockerfile
to: unused
promotion:
to:
# keep updated to current ocp release branch
- name: "4.16"
namespace: ocp
resources:
'*':
limits:
Expand Down
13 changes: 10 additions & 3 deletions boilerplate/openshift/golang-osd-operator/standard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ endif
COMMIT_NUMBER=$(shell git rev-list `git rev-list --parents HEAD | grep -E "^[a-f0-9]{40}$$"`..HEAD --count)
CURRENT_COMMIT=$(shell git rev-parse --short=7 HEAD)
OPERATOR_VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(COMMIT_NUMBER)-$(CURRENT_COMMIT)
VERSION_BRANCH=release-$(VERSION_MAJOR).$(VERSION_MINOR)

OPERATOR_IMAGE=$(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME)
OPERATOR_IMAGE_TAG=v$(OPERATOR_VERSION)
Expand Down Expand Up @@ -296,10 +297,12 @@ prow-config:
# Targets used by prow
######################

# validate: Ensure code generation has not been forgotten; and ensure
# generated and boilerplate code has not been modified.
# validate: Ensure
# 1. code generation has not been forgotten;
# 2. generated and boilerplate code has not been modified
# 3. specified major and minor version match release branch
.PHONY: validate
validate: boilerplate-freeze-check generate-check
validate: boilerplate-freeze-check generate-check branch-version-check

# lint: Perform static analysis.
.PHONY: lint
Expand Down Expand Up @@ -377,6 +380,10 @@ container-lint:
container-validate:
${BOILERPLATE_CONTAINER_MAKE} validate

.PHONY: branch-version-check
branch-version-check:
@(if shell git branch --list $(VERSION_BRANCH); then git checkout $(VERSION_BRANCH); else echo Version set to $(VERSION_MAJOR).$(VERSION_MINOR), but branch $(VERSION_BRANCH) not found.; exit 1; fi)

.PHONY: container-coverage
container-coverage:
${BOILERPLATE_CONTAINER_MAKE} coverage
Expand Down