Skip to content

Commit

Permalink
enforce ocp based branching model for operator repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
ritmun committed Feb 20, 2024
1 parent ad9b655 commit c2463b9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
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

0 comments on commit c2463b9

Please sign in to comment.