Skip to content

Commit

Permalink
[e2e] Restore the manager's image from the bash scripts. (#1830)
Browse files Browse the repository at this point in the history
* [e2e] Return ginkgo exit code

* [e2e] Restore manager's image in sh

* Cleanup and remarks
  • Loading branch information
trasc committed Mar 13, 2024
1 parent 74d17e3 commit df082a9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 0 additions & 2 deletions Makefile
Expand Up @@ -194,14 +194,12 @@ run-test-e2e-%: K8S_VERSION = $(@:run-test-e2e-%=%)
run-test-e2e-%: FORCE
@echo Running e2e for k8s ${K8S_VERSION}
E2E_KIND_VERSION="kindest/node:v$(K8S_VERSION)" KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) CREATE_KIND_CLUSTER=$(CREATE_KIND_CLUSTER) ARTIFACTS="$(ARTIFACTS)/$@" IMAGE_TAG=$(IMAGE_TAG) GINKGO_ARGS="$(GINKGO_ARGS)" ./hack/e2e-test.sh
@$(call clean-manifests)

JOBSET_VERSION = $(shell $(GO_CMD) list -m -f "{{.Version}}" sigs.k8s.io/jobset)
run-test-multikueue-e2e-%: K8S_VERSION = $(@:run-test-multikueue-e2e-%=%)
run-test-multikueue-e2e-%: FORCE
@echo Running multikueue e2e for k8s ${K8S_VERSION}
E2E_KIND_VERSION="kindest/node:v$(K8S_VERSION)" KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) CREATE_KIND_CLUSTER=$(CREATE_KIND_CLUSTER) ARTIFACTS="$(ARTIFACTS)/$@" IMAGE_TAG=$(IMAGE_TAG) GINKGO_ARGS="$(GINKGO_ARGS)" JOBSET_VERSION=$(JOBSET_VERSION) ./hack/multikueue-e2e-test.sh
@$(call clean-manifests)

.PHONY: ci-lint
ci-lint: golangci-lint
Expand Down
9 changes: 9 additions & 0 deletions hack/e2e-common.sh
Expand Up @@ -14,6 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

export KUSTOMIZE="$ROOT_DIR"/bin/kustomize
export GINKGO="$ROOT_DIR"/bin/ginkgo
export KIND="$ROOT_DIR"/bin/kind
export YQ="$ROOT_DIR"/bin/yq


# $1 - cluster name
Expand Down Expand Up @@ -57,3 +61,8 @@ function cluster_kueue_deploy {
fi
}

export INITIAL_IMAGE=$($YQ '.images[] | select(.name == "controller") | [.newName, .newTag] | join(":")' config/components/manager/kustomization.yaml)

function restore_managers_image {
(cd config/components/manager && $KUSTOMIZE edit set image controller=$INITIAL_IMAGE)
}
6 changes: 2 additions & 4 deletions hack/e2e-test.sh
Expand Up @@ -20,9 +20,6 @@ set -o pipefail

SOURCE_DIR="$(cd "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
ROOT_DIR="$SOURCE_DIR/.."
export KUSTOMIZE="$ROOT_DIR"/bin/kustomize
export GINKGO="$ROOT_DIR"/bin/ginkgo
export KIND="$ROOT_DIR"/bin/kind
export E2E_TEST_IMAGE=gcr.io/k8s-staging-perf-tests/sleep:v0.1.0

source ${SOURCE_DIR}/e2e-common.sh
Expand All @@ -35,7 +32,8 @@ function cleanup {
fi
cluster_cleanup $KIND_CLUSTER_NAME
fi
exit 0
#do the image restore here for the case when an error happened during deploy
restore_managers_image
}

function startup {
Expand Down
7 changes: 2 additions & 5 deletions hack/multikueue-e2e-test.sh
Expand Up @@ -20,10 +20,6 @@ set -o pipefail

SOURCE_DIR="$(cd "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
ROOT_DIR="$SOURCE_DIR/.."
export KUSTOMIZE="$ROOT_DIR"/bin/kustomize
export GINKGO="$ROOT_DIR"/bin/ginkgo
export KIND="$ROOT_DIR"/bin/kind
export YQ="$ROOT_DIR"/bin/yq
export E2E_TEST_IMAGE=gcr.io/k8s-staging-perf-tests/sleep:v0.1.0
export MANAGER_KIND_CLUSTER_NAME=${KIND_CLUSTER_NAME}-manager
export WORKER1_KIND_CLUSTER_NAME=${KIND_CLUSTER_NAME}-worker1
Expand All @@ -46,7 +42,8 @@ function cleanup {
cluster_cleanup $WORKER1_KIND_CLUSTER_NAME
cluster_cleanup $WORKER2_KIND_CLUSTER_NAME
fi
exit 0
#do the image restore here for the case when an error happened during deploy
restore_managers_image
}


Expand Down

0 comments on commit df082a9

Please sign in to comment.