Skip to content

Commit

Permalink
Merge pull request #3305 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…3284-to-release-1.7

[release-1.7] CI: always build Linux and Windows images
  • Loading branch information
k8s-ci-robot authored Mar 16, 2023
2 parents 4e728f5 + a52bfdc commit d73681a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
17 changes: 5 additions & 12 deletions scripts/ci-build-azure-ccm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,8 @@ main() {
if [[ "$(can_reuse_artifacts)" =~ "false" ]]; then
echo "Build Linux Azure amd64 cloud controller manager"
make -C "${AZURE_CLOUD_PROVIDER_ROOT}" build-ccm-image-amd64 push-ccm-image-amd64
if [[ -n "${TEST_WINDOWS:-}" ]]; then
echo "Building Linux amd64 and Windows ${WINDOWS_IMAGE_VERSION} amd64 cloud node managers"
echo "Building Linux amd64 and Windows ${WINDOWS_IMAGE_VERSION} amd64 cloud node managers"
make -C "${AZURE_CLOUD_PROVIDER_ROOT}" build-node-image-linux-amd64 push-node-image-linux-amd64 push-node-image-windows-"${WINDOWS_IMAGE_VERSION}"-amd64 manifest-node-manager-image-windows-"${WINDOWS_IMAGE_VERSION}"-amd64
else
echo "Building Linux amd64 cloud node manager"
make -C "${AZURE_CLOUD_PROVIDER_ROOT}" build-node-image-linux-amd64 push-node-image-linux-push-name-amd64
fi
fi
}

Expand All @@ -79,13 +74,11 @@ can_reuse_artifacts() {
fi
done

if [[ -n "${TEST_WINDOWS:-}" ]]; then
FULL_VERSION=$(docker manifest inspect mcr.microsoft.com/windows/nanoserver:${WINDOWS_IMAGE_VERSION} | jq -r '.manifests[0].platform["os.version"]')
if ! docker manifest inspect "${REGISTRY}/${CNM_IMAGE_NAME}:${IMAGE_TAG}" | grep -q "\"os.version\": \"${FULL_VERSION}\""; then
echo "false" && return
fi
FULL_VERSION=$(docker manifest inspect mcr.microsoft.com/windows/nanoserver:${WINDOWS_IMAGE_VERSION} | jq -r '.manifests[0].platform["os.version"]')
if ! docker manifest inspect "${REGISTRY}/${CNM_IMAGE_NAME}:${IMAGE_TAG}" | grep -q "\"os.version\": \"${FULL_VERSION}\""; then
echo "false" && return
fi

echo "true"
}

Expand Down
13 changes: 7 additions & 6 deletions scripts/ci-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,16 @@ setup() {
export CCM_COUNT="${CCM_COUNT:-1}"
export WORKER_MACHINE_COUNT="${WORKER_MACHINE_COUNT:-2}"
export EXP_CLUSTER_RESOURCE_SET="true"

# this requires k8s 1.22+
if [[ -n "${K8S_FEATURE_GATES:-}" ]]; then
export K8S_FEATURE_GATES="${K8S_FEATURE_GATES:-},WindowsHostProcessContainers=true"
else
export K8S_FEATURE_GATES="WindowsHostProcessContainers=true"
fi

# TODO figure out a better way to account for expected Windows node count
if [[ -n "${TEST_WINDOWS:-}" ]]; then
export WINDOWS_WORKER_MACHINE_COUNT="${WINDOWS_WORKER_MACHINE_COUNT:-2}"
if [[ -n "${K8S_FEATURE_GATES:-}" ]]; then
export K8S_FEATURE_GATES="${K8S_FEATURE_GATES:-},WindowsHostProcessContainers=true"
else
export K8S_FEATURE_GATES="WindowsHostProcessContainers=true"
fi
fi
}

Expand Down

0 comments on commit d73681a

Please sign in to comment.