-
Notifications
You must be signed in to change notification settings - Fork 159
fix missing variable when building the image on cloudbuild #761
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,17 +15,8 @@ | |
# Args: | ||
# GCE_PD_CSI_STAGING_IMAGE: Staging image repository | ||
REV=$(shell git describe --long --tags --match='v*' --dirty 2>/dev/null || git rev-list -n1 HEAD) | ||
ifdef GCE_PD_CSI_STAGING_VERSION | ||
STAGINGVERSION=${GCE_PD_CSI_STAGING_VERSION} | ||
else | ||
STAGINGVERSION=${REV} | ||
endif | ||
|
||
GCFLAGS="" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GCFLAGS was removed too, is this ok? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They aren't used anymore, but this will allow them to be set from an env. That was my understanding at any rate. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the value of GCFLAGS was set conditionally based on this flag before:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ohh, my fault! i might remove that by mistake :( |
||
ifdef GCE_PD_CSI_DEBUG | ||
GCFLAGS="all=-N -l" | ||
endif | ||
|
||
GCE_PD_CSI_STAGING_VERSION ?= ${REV} | ||
STAGINGVERSION=${GCE_PD_CSI_STAGING_VERSION} | ||
STAGINGIMAGE=${GCE_PD_CSI_STAGING_IMAGE} | ||
DRIVERBINARY=gce-pd-csi-driver | ||
DRIVERWINDOWSBINARY=${DRIVERBINARY}.exe | ||
|
@@ -50,8 +41,10 @@ gce-pd-driver-windows: | |
mkdir -p bin | ||
GOOS=windows go build -mod=vendor -ldflags -X=main.version=$(STAGINGVERSION) -o bin/${DRIVERWINDOWSBINARY} ./cmd/gce-pd-csi-driver/ | ||
|
||
build-container: require-GCE_PD_CSI_STAGING_IMAGE | ||
$(DOCKER) build --build-arg TAG=$(STAGINGVERSION) -t $(STAGINGIMAGE):$(STAGINGVERSION) . | ||
build-container: require-GCE_PD_CSI_STAGING_IMAGE init-buildx | ||
$(DOCKER) buildx build --platform=linux \ | ||
-t $(STAGINGIMAGE):$(STAGINGVERSION) \ | ||
--build-arg STAGINGVERSION=$(STAGINGVERSION) --push . | ||
|
||
build-and-push-windows-container-ltsc2019: require-GCE_PD_CSI_STAGING_IMAGE init-buildx | ||
$(DOCKER) buildx build --file=Dockerfile.Windows --platform=windows \ | ||
|
@@ -77,8 +70,8 @@ build-and-push-windows-container-20H2: require-GCE_PD_CSI_STAGING_IMAGE init-bui | |
--build-arg BASE_IMAGE=$(BASE_IMAGE_20H2) \ | ||
--build-arg STAGINGVERSION=$(STAGINGVERSION) --push . | ||
|
||
build-and-push-multi-arch: build-and-push-container-linux build-and-push-windows-container-ltsc2019 build-and-push-windows-container-1909 build-and-push-windows-container-2004 build-and-push-windows-container-20H2 | ||
$(DOCKER) manifest create --amend $(STAGINGIMAGE):$(STAGINGVERSION) $(STAGINGIMAGE):$(STAGINGVERSION)_linux $(STAGINGIMAGE):$(STAGINGVERSION)_20H2 $(STAGINGIMAGE):$(STAGINGVERSION)_2004 $(STAGINGIMAGE):$(STAGINGVERSION)_1909 $(STAGINGIMAGE):$(STAGINGVERSION)_ltsc2019 | ||
build-and-push-multi-arch: build-and-push-container-linux-amd64 build-and-push-container-linux-arm64 build-and-push-windows-container-ltsc2019 build-and-push-windows-container-1909 build-and-push-windows-container-2004 build-and-push-windows-container-20H2 | ||
$(DOCKER) manifest create --amend $(STAGINGIMAGE):$(STAGINGVERSION) $(STAGINGIMAGE):$(STAGINGVERSION)_linux_amd64 $(STAGINGIMAGE):$(STAGINGVERSION)_linux_arm64 $(STAGINGIMAGE):$(STAGINGVERSION)_20H2 $(STAGINGIMAGE):$(STAGINGVERSION)_2004 $(STAGINGIMAGE):$(STAGINGVERSION)_1909 $(STAGINGIMAGE):$(STAGINGVERSION)_ltsc2019 | ||
STAGINGIMAGE="$(STAGINGIMAGE)" STAGINGVERSION="$(STAGINGVERSION)" WINDOWS_IMAGE_TAGS="$(WINDOWS_IMAGE_TAGS)" WINDOWS_BASE_IMAGES="$(WINDOWS_BASE_IMAGES)" ./manifest_osversion.sh | ||
$(DOCKER) manifest push -p $(STAGINGIMAGE):$(STAGINGVERSION) | ||
|
||
|
@@ -88,17 +81,21 @@ build-and-push-multi-arch-debug: build-and-push-container-linux-debug build-and- | |
$(DOCKER) manifest push -p $(STAGINGIMAGE):$(STAGINGVERSION) | ||
|
||
push-container: build-container | ||
gcloud docker -- push $(STAGINGIMAGE):$(STAGINGVERSION) | ||
|
||
build-and-push-container-linux: require-GCE_PD_CSI_STAGING_IMAGE init-buildx | ||
$(DOCKER) buildx build --platform=linux/amd64,linux/arm64 \ | ||
-t $(STAGINGIMAGE):$(STAGINGVERSION)_linux \ | ||
--build-arg TAG=$(STAGINGVERSION) --push . | ||
build-and-push-container-linux-amd64: require-GCE_PD_CSI_STAGING_IMAGE init-buildx | ||
$(DOCKER) buildx build --platform=linux/amd64 \ | ||
-t $(STAGINGIMAGE):$(STAGINGVERSION)_linux_amd64 \ | ||
--build-arg STAGINGVERSION=$(STAGINGVERSION) --push . | ||
|
||
build-and-push-container-linux-arm64: require-GCE_PD_CSI_STAGING_IMAGE init-buildx | ||
$(DOCKER) buildx build --platform=linux/arm64 \ | ||
-t $(STAGINGIMAGE):$(STAGINGVERSION)_linux_arm64 \ | ||
--build-arg STAGINGVERSION=$(STAGINGVERSION) --push . | ||
|
||
build-and-push-container-linux-debug: require-GCE_PD_CSI_STAGING_IMAGE init-buildx | ||
$(DOCKER) buildx build --file=Dockerfile.debug --platform=linux \ | ||
-t $(STAGINGIMAGE):$(STAGINGVERSION)_linux \ | ||
--build-arg TAG=$(STAGINGVERSION) --push . | ||
--build-arg STAGINGVERSION=$(STAGINGVERSION) --push . | ||
|
||
test-sanity: gce-pd-driver | ||
go test -mod=vendor --v -timeout 30s sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/test/sanity -run ^TestSanity$ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this line and the following?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh my bad! :(
will remove that in a follow up pr