-
Notifications
You must be signed in to change notification settings - Fork 79
QoL: add early checks for being logged in to quay.io #1207
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 |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # WILL_PUBLISH is true when the e2e goals will publish new operator image(s) | ||
| # to quay. This enables the check to conditionally execute only when needed. | ||
| WILL_PUBLISH := false | ||
| ifneq ($(HOST_REPO_PATH),) | ||
| WILL_PUBLISH := true | ||
| endif | ||
| ifneq ($(MEMBER_REPO_PATH),) | ||
| WILL_PUBLISH := true | ||
| endif | ||
| ifneq ($(REG_REPO_PATH),) | ||
| WILL_PUBLISH := true | ||
| endif | ||
|
|
||
| .PHONY: check-quay-login-if-needed | ||
| check-quay-login-if-needed: | ||
| @if [ "${WILL_PUBLISH}" = "true" -o "${PUSH_SANDBOX_IMAGE}" = "true" ]; then \ | ||
| podman login --get-login quay.io >/dev/null; \ | ||
| fi | ||
|
|
||
| .PHONY: check-quay-login | ||
| check-quay-login: | ||
| @podman login --get-login quay.io >/dev/null | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ deploy-sandbox-ui: HOST_NS=$(shell oc get projects -l app=host-operator --output | |
| deploy-sandbox-ui: REGISTRATION_SERVICE_API=https://$(shell oc get route registration-service -n ${HOST_NS} -o custom-columns=":spec.host" | tr -d '\n')/api/v1 | ||
| deploy-sandbox-ui: HOST_OPERATOR_API=https://$(shell oc get route api -n ${HOST_NS} -o custom-columns=":spec.host" | tr -d '\n') | ||
| deploy-sandbox-ui: RHDH=https://rhdh-${SANDBOX_UI_NS}.$(shell oc get ingress.config.openshift.io/cluster -o jsonpath='{.spec.domain}') | ||
| deploy-sandbox-ui: | ||
| deploy-sandbox-ui: check-quay-login-if-needed | ||
|
Contributor
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. we could add it to
Contributor
Author
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 idea is to perform the check as early as possible. So we really need to find the 'entry points' into the different 'flows' that we invoke using make and figure out a proper place where to add this check. This is my stab at the entry point to the flow of deploying the UI. @rsoaresd, could you please take a look and tell what good places this check should be put?
Contributor
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. Sure, going to take a look! Just saw the PR and the comment, sorry for the delay
Contributor
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. @metlos, if the goal is to check as early as possible, I suggest adding at the top level of For now,
@mfrancisc has a good point too, if we add future make targets, we could miss adding the early check for being logged into quay.io |
||
| $(MAKE) check-sso-credentials | ||
| @echo "sandbox ui will be deployed in '${SANDBOX_UI_NS}' namespace" | ||
| $(MAKE) create-namespace SANDBOX_UI_NS=${SANDBOX_UI_NS} | ||
|
|
@@ -216,7 +216,7 @@ build-sandbox-ui-e2e-tests: | |
|
|
||
| # Run Developer Sandbox UI e2e tests image using podman | ||
| .PHONY: test-sandbox-ui-in-container | ||
| test-sandbox-ui-in-container: build-sandbox-ui-e2e-tests | ||
| test-sandbox-ui-in-container: check-quay-login build-sandbox-ui-e2e-tests | ||
| @echo "pushing Developer Sandbox UI image..." | ||
| $(MAKE) push-sandbox-plugin | ||
| @echo "running the e2e tests in podman container..." | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,7 +62,7 @@ prepare-and-deploy-e2e: prepare-e2e deploy-e2e | |
| @echo "To clean the cluster run 'make clean-e2e-resources'" | ||
|
|
||
| .PHONY: verify-migration-and-deploy-e2e | ||
| verify-migration-and-deploy-e2e: prepare-projects e2e-deploy-latest e2e-migration-setup get-publish-and-install-operators e2e-migration-verify | ||
| verify-migration-and-deploy-e2e: check-quay-login-if-needed prepare-projects e2e-deploy-latest e2e-migration-setup get-publish-and-install-operators e2e-migration-verify | ||
|
Contributor
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. it looks like you already added the check as part of
Contributor
Author
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. Yes, that's the whole point of this PR. To do the login check earlier during the build, particularly prior to deploying the latest from the repo (the The reason to put this check also into I'm not sure I actually cover all the 'entry points' in the best possible way but I hope what is in this PR is at least a good starting point.
Collaborator
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. btw, do you still face the issue after using the generated token? |
||
|
|
||
| .PHONY: e2e-migration-setup | ||
| e2e-migration-setup: | ||
|
|
@@ -307,7 +307,7 @@ get-publish-install-and-register-operators: get-and-publish-host-operator get-an | |
| get-publish-and-install-operators: get-and-publish-host-operator create-host-resources get-and-publish-member-operator | ||
|
|
||
| .PHONY: get-and-publish-member-operator | ||
| get-and-publish-member-operator: ksctl | ||
| get-and-publish-member-operator: check-quay-login-if-needed ksctl | ||
| ifneq (${MEMBER_NS_2},"") | ||
| ifneq (${MEMBER_NS_2},) | ||
| $(eval MEMBER_NS_2_PARAM = -mn2 ${MEMBER_NS_2}) | ||
|
|
@@ -336,7 +336,7 @@ else | |
| endif | ||
|
|
||
| .PHONY: get-and-publish-host-operator | ||
| get-and-publish-host-operator: ksctl | ||
| get-and-publish-host-operator: check-quay-login-if-needed ksctl | ||
| ifneq (${REG_REPO_PATH},"") | ||
| ifneq (${REG_REPO_PATH},) | ||
| $(eval REG_REPO_PATH_PARAM = -rr ${REG_REPO_PATH}) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
wouldn't it be easier to execute the check everytime when any makefile target is executed and the
WILL_PUBLISHis true?at first, we would need to set the variable aslo when
PUSH_SANDBOX_IMAGEistrue:and then either use
.EXTRA_PREREQSwhich is in available in GNU Make 4.3+ (not sure how this would work with Macor second option do it via
.SHELLSTATUS, which should work everywhereThere 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.
found another option - this could also work: