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

Ensure image version consistency #426

Open
wants to merge 2 commits into
base: cleanup-dockerfile
Choose a base branch
from

Conversation

riya-kaushal7997
Copy link

Description

Set IMAGETAG through semver.mk and removed the unnecessary hardcoded fields

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Backward compatibility is not broken

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Image is tagged successfully
master-1-Engi0eItYtB5p:~/csm/drivers/csi-powerstore # make tag
which: no gosec in (/root/go/pkg/mod/golang.org/[email protected]/bin:/root/go/bin:/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/go/bin:/root/csm/utilities/bin:/usr/local/go/bin:/root/csm/utilities/bin:/usr/local/go/bin:/root/csm/utilities/bin)
go run core/semver/semver.go -f mk >semver.mk
make -f docker.mk tag TAGMSG='"CSI Spec 1.6"'
make[1]: Entering directory '/root/csm/drivers/csi-powerstore'
MAJOR 2 MINOR 7 PATCH 0 RELNOTE  SEMVER 2.7.0 IMAGETAG v2.7.0 TAGMSG CSI Spec 1.6
git tag -d v2.7.0
Deleted tag 'v2.7.0' (was 90c80e4)
git tag -a -m "CSI Spec 1.6" v2.7.0
make[1]: Leaving directory '/root/csm/drivers/csi-powerstore'
  • Image is built successfully
master-1-Engi0eItYtB5p:~/csm/drivers/csi-powerstore # make docker
which: no gosec in (/root/go/pkg/mod/golang.org/[email protected]/bin:/root/go/bin:/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/go/bin:/root/csm/utilities/bin:/usr/local/go/bin:/root/csm/utilities/bin:/usr/local/go/bin:/root/csm/utilities/bin)
go run core/semver/semver.go -f mk >semver.mk
make -f docker.mk docker
.......
MAJOR 2 MINOR 7 PATCH 0 RELNOTE  SEMVER 2.7.0 IMAGETAG v2.7.0
docker build -t "dellemc/csi-powerstore:v2.7.0" --build-arg GOIMAGE=golang:1.23 --build-arg BASEIMAGE=quay.io/dell/container-storage-modules/csm-base-image:nightly .
Sending build context to Docker daemon  4.752MB
Step 1/16 : ARG GOIMAGE
.......
Successfully built 496b64a1b98c
Successfully tagged dellemc/csi-powerstore:v2.7.0

docker.mk Outdated
@echo "MAJOR $(MAJOR) MINOR $(MINOR) PATCH $(PATCH) RELNOTE $(RELNOTE) SEMVER $(SEMVER)"
@echo "$(DOCKER_FILE)"
$(BUILDER) build --pull -f $(DOCKER_FILE) -t "$(DOCKER_REGISTRY)/$(DOCKER_IMAGE_NAME):v$(MAJOR).$(MINOR).$(PATCH)$(RELNOTE)" --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) --build-arg BASEIMAGE=$(CSM_BASEIMAGE) .
@echo "MAJOR $(MAJOR) MINOR $(MINOR) PATCH $(PATCH) RELNOTE $(RELNOTE) SEMVER $(SEMVER) IMAGETAG $(IMAGETAG)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line still needed? Seems redundant as the Make line will show the values.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary echo statement

docker.mk Outdated
@echo "MAJOR $(MAJOR) MINOR $(MINOR) PATCH $(PATCH) RELNOTE $(RELNOTE) SEMVER $(SEMVER)"
@echo "$(DOCKER_FILE) --no-cache"
$(BUILDER) build --pull --no-cache -f $(DOCKER_FILE) -t "$(DOCKER_REGISTRY)/$(DOCKER_IMAGE_NAME):v$(MAJOR).$(MINOR).$(PATCH)$(RELNOTE)" --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) --build-arg BASEIMAGE=$(CSM_BASEIMAGE) .
@echo "MAJOR $(MAJOR) MINOR $(MINOR) PATCH $(PATCH) RELNOTE $(RELNOTE) SEMVER $(SEMVER) IMAGETAG $(IMAGETAG)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line still needed? Seems redundant as the Make line will show the values.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary echo statement

docker.mk Outdated Show resolved Hide resolved
docker.mk Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants