Skip to content

Commit 66d41ff

Browse files
committed
Clean up previously tried workarounds.
1 parent e11c7a3 commit 66d41ff

File tree

3 files changed

+6
-26
lines changed

3 files changed

+6
-26
lines changed

Makefile

+2-5
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,11 @@ build-and-push-windows-container-ltsc2019: require-GCE_PD_CSI_STAGING_IMAGE init
6262

6363
build-and-push-multi-arch: build-and-push-container-linux-amd64 build-and-push-container-linux-arm64 build-and-push-windows-container-ltsc2019
6464
$(DOCKER) manifest create $(STAGINGIMAGE):$(STAGINGVERSION) $(STAGINGIMAGE):$(STAGINGVERSION)_linux_amd64 $(STAGINGIMAGE):$(STAGINGVERSION)_linux_arm64 $(STAGINGIMAGE):$(STAGINGVERSION)_ltsc2019
65-
# $(DOCKER) manifest annotate --os linux --arch arm64 $(STAGINGIMAGE):$(STAGINGVERSION) $(STAGINGIMAGE):$(STAGINGVERSION)_linux_arm64
6665
STAGINGIMAGE="$(STAGINGIMAGE)" STAGINGVERSION="$(STAGINGVERSION)" WINDOWS_IMAGE_TAGS="$(WINDOWS_IMAGE_TAGS)" WINDOWS_BASE_IMAGES="$(WINDOWS_BASE_IMAGES)" ./manifest_osversion.sh
6766
$(DOCKER) manifest push -p $(STAGINGIMAGE):$(STAGINGVERSION)
68-
$(DOCKER) manifest inspect $(STAGINGIMAGE):$(STAGINGVERSION)
6967

7068
build-and-push-multi-arch-debug: build-and-push-container-linux-debug build-and-push-windows-container-ltsc2019
71-
# TODO: make this command the same as the above
72-
$(DOCKER) manifest create --amend $(STAGINGIMAGE):$(STAGINGVERSION) $(STAGINGIMAGE):$(STAGINGVERSION)_linux $(STAGINGIMAGE):$(STAGINGVERSION)_ltsc2019
69+
$(DOCKER) manifest create $(STAGINGIMAGE):$(STAGINGVERSION) $(STAGINGIMAGE):$(STAGINGVERSION)_linux $(STAGINGIMAGE):$(STAGINGVERSION)_ltsc2019
7370
STAGINGIMAGE="$(STAGINGIMAGE)" STAGINGVERSION="$(STAGINGVERSION)" WINDOWS_IMAGE_TAGS="ltsc2019" WINDOWS_BASE_IMAGES="$(BASE_IMAGE_LTSC2019)" ./manifest_osversion.sh
7471
$(DOCKER) manifest push -p $(STAGINGIMAGE):$(STAGINGVERSION)
7572

@@ -133,7 +130,7 @@ init-buildx:
133130
$(DOCKER) run --rm --privileged multiarch/qemu-user-static --reset --credential yes --persistent yes
134131
# Ensure we use a builder that can leverage it (the default on linux will not)
135132
-$(DOCKER) buildx rm multiarch-multiplatform-builder
136-
$(DOCKER) buildx create --use --name=multiarch-multiplatform-builder --driver-opt network=host --driver-opt image=moby/buildkit:v0.16.0
133+
$(DOCKER) buildx create --use --name=multiarch-multiplatform-builder --driver-opt network=host --driver-opt image=moby/buildkit:v0.20.0
137134
# Register gcloud as a Docker credential helper.
138135
# Required for "docker buildx build --push".
139136
gcloud auth configure-docker --quiet

manifest_osversion.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ for ((i=0;i<${#imagetags[@]};++i)); do
3232
image_folder=$(echo "${IMAGETAG}" | sed "s|/|_|g" | sed "s/:/-/")
3333
echo ${manifest_folder}
3434

35+
# Needed for Windows nodes to correctly recognize the version of image to pull.
36+
# Populates the os.version field of the multi-arch image manifest.
3537
docker manifest annotate --os windows --arch amd64 --os-version ${full_version} ${STAGINGIMAGE}:${STAGINGVERSION} ${IMAGETAG}
36-
# sed -i -r "s/(\"os\"\:\"windows\")/\0,\"os.version\":$full_version/" \
37-
# "${HOME}/.docker/manifests/${manifest_folder}/${image_folder}"
3838

3939
# manifest after transformations
4040
cat "${HOME}/.docker/manifests/${manifest_folder}/${image_folder}"

test/k8s-integration/cluster.go

+2-19
Original file line numberDiff line numberDiff line change
@@ -59,27 +59,10 @@ func clusterDownGKE(gceZone, gceRegion string) error {
5959
return nil
6060
}
6161

62-
const hardcodeBuildChange = `/template:/,/spec:/s/spec:$/spec:\n\ \ \ \ \ \ nodeSelector:\n\ \ \ \ \ \ \ \ kubernetes.io\/os: linux/`
63-
6462
func buildKubernetes(k8sDir, command string) error {
65-
// TODO: REMOVE THESE HARDCODED LINES
66-
cmd := exec.Command("sed", "-i", hardcodeBuildChange, fmt.Sprintf("%s/cluster/addons/node-problem-detector/npd.yaml", k8sDir))
67-
cmd.Env = os.Environ()
68-
err := runCommand(fmt.Sprintf("Make hardcoded change in path=%s", k8sDir), cmd)
69-
if err != nil {
70-
return fmt.Errorf("failed to make hardcoded changes before building Kubernetes: %w", err)
71-
}
72-
73-
cmd = exec.Command("cat", fmt.Sprintf("%s/cluster/addons/node-problem-detector/npd.yaml", k8sDir))
74-
cmd.Env = os.Environ()
75-
err = runCommand(fmt.Sprintf("Check hardcoded change in path=%s", k8sDir), cmd)
76-
if err != nil {
77-
return fmt.Errorf("failed to check hardcoded changes before building Kubernetes: %w", err)
78-
}
79-
80-
cmd = exec.Command("make", "-C", k8sDir, command)
63+
cmd := exec.Command("make", "-C", k8sDir, command)
8164
cmd.Env = os.Environ()
82-
err = runCommand(fmt.Sprintf("Running command in kubernetes/kubernetes path=%s", k8sDir), cmd)
65+
err := runCommand(fmt.Sprintf("Running command in kubernetes/kubernetes path=%s", k8sDir), cmd)
8366
if err != nil {
8467
return fmt.Errorf("failed to build Kubernetes: %w", err)
8568
}

0 commit comments

Comments
 (0)