-
Notifications
You must be signed in to change notification settings - Fork 56
snc.sh: Get pullspec from mirrored release.txt #149
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,19 +10,30 @@ YQ=${YQ:-yq} | |
| OPENSHIFT_INSTALL=${OPENSHIFT_INSTALL:-./openshift-install} | ||
| CRC_VM_NAME=${CRC_VM_NAME:-crc} | ||
| BASE_DOMAIN=${CRC_BASE_DOMAIN:-testing} | ||
| QUAY_REGISTRY=${QUAY_REGISTRY:-quay.io/openshift-release-dev/ocp-release} | ||
| MIRROR=${MIRROR:-https://mirror.openshift.com/pub/openshift-v4/clients/ocp} | ||
| CRC_PV_DIR="/mnt/pv-data" | ||
| SSH="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i id_rsa_crc" | ||
|
|
||
| # If user defined the OPENSHIFT_VERSION environment variable then use it. | ||
| # Otherwise use the tagged version if available | ||
| function get_openshift_version { | ||
| if [ "${OPENSHIFT_VERSION}" != "" ]; then | ||
| OPENSHIFT_RELEASE_VERSION=$OPENSHIFT_VERSION | ||
| if test -n "${OPENSHIFT_VERSION}"; then | ||
| OPENSHIFT_RELEASE_VERSION=$OPENSHIFT_VERSION | ||
| echo "Using release ${OPENSHIFT_RELEASE_VERSION} from OPENSHIFT_VERSION" | ||
| else | ||
| OPENSHIFT_RELEASE_VERSION=$(git describe --exact-match --tags HEAD 2>/dev/null) | ||
| if test -n "${OPENSHIFT_RELEASE_VERSION}"; then | ||
| echo "Using release ${OPENSHIFT_RELEASE_VERSION} from local Git tags" | ||
| else | ||
| OPENSHIFT_RELEASE_VERSION=$(git describe --exact-match --tags HEAD 2>/dev/null) | ||
| OPENSHIFT_RELEASE_VERSION="$(curl -L "${MIRROR}/latest/release.txt | sed -n 's/^ *Version: //p')" | ||
| if test -n "${OPENSHIFT_RELEASE_VERSION}"; then | ||
| echo "Using release ${OPENSHIFT_RELEASE_VERSION} from the latest mirror" | ||
| else | ||
| echo "Unable to determine an OpenShift release version. You may want to set the OPENSHIFT_VERSION environment variable explicitly. | ||
| exit 1 | ||
| fi | ||
| fi | ||
| } | ||
| fi | ||
|
|
||
|
|
||
| function create_json_description { | ||
| openshiftInstallerVersion=$(${OPENSHIFT_INSTALL} version) | ||
|
|
@@ -32,7 +43,7 @@ function create_json_description { | |
| | ${JQ} ".buildInfo.buildTime = \"$(date -u --iso-8601=seconds)\"" \ | ||
| | ${JQ} ".buildInfo.openshiftInstallerVersion = \"${openshiftInstallerVersion}\"" \ | ||
| | ${JQ} ".buildInfo.sncVersion = \"git${sncGitHash}\"" \ | ||
| | ${JQ} ".clusterInfo.openshiftVersion = \"${OPENSHIFT_RELEASE_VERSION:-git}\"" \ | ||
| | ${JQ} ".clusterInfo.openshiftVersion = \"${OPENSHIFT_RELEASE_VERSION}\"" \ | ||
| | ${JQ} ".clusterInfo.clusterName = \"${CRC_VM_NAME}\"" \ | ||
| | ${JQ} ".clusterInfo.baseDomain = \"${BASE_DOMAIN}\"" \ | ||
| | ${JQ} ".clusterInfo.appsDomain = \"apps-${CRC_VM_NAME}.${BASE_DOMAIN}\"" >${INSTALL_DIR}/crc-bundle-info.json | ||
|
|
@@ -96,11 +107,7 @@ get_openshift_version | |
| # Download the oc binary if not present in current directory | ||
| if ! which $OC; then | ||
| if [[ ! -e oc ]] ; then | ||
| if [ "${OPENSHIFT_RELEASE_VERSION}" != "" ]; then | ||
| curl -L https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${OPENSHIFT_RELEASE_VERSION}/openshift-client-linux-${OPENSHIFT_RELEASE_VERSION}.tar.gz | tar zx oc | ||
| else | ||
| curl -L https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/linux/oc.tar.gz | tar zx oc | ||
| fi | ||
| curl -L "${MIRROR}/${OPENSHIFT_RELEASE_VERSION}/openshift-client-linux-${OPENSHIFT_RELEASE_VERSION}.tar.gz" | tar zx oc | ||
|
Member
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. 👍 |
||
| fi | ||
| OC=./oc | ||
| fi | ||
|
|
@@ -126,12 +133,9 @@ if [ "${OPENSHIFT_PULL_SECRET}" = "" ]; then | |
| exit 1 | ||
| fi | ||
|
|
||
| # Use the release payload for the latest known openshift release as indicated by git tags | ||
| if [ "${OPENSHIFT_RELEASE_VERSION}" != "" ]; then | ||
| OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE=${QUAY_REGISTRY}:${OPENSHIFT_RELEASE_VERSION} | ||
| export OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE | ||
| echo "Setting OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE to ${OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE}" | ||
| fi | ||
| OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE="$(curl -l "${MIRROR}/${OPENSHIFT_RELEASE_VERSION}/release.txt" | sed -n 's/^Pull From: //p')" | ||
|
Member
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. 👍 |
||
| export OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE | ||
| echo "Setting OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE to ${OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE}" | ||
|
|
||
| # Generate a new ssh keypair for this cluster | ||
| rm id_rsa_crc* || true | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@wking So is this correct assumption that
mirror.openshift.comis source of truth when it comes to OCP releases? Recently when 4.3 rc bits happened those were not appeared on mirror.openshift.com atleast for a day or two. If you says this is way forward and every bits should be present here then we can merge it.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.
They're supposed to get pushed up around when the release is tagged into the candidate channel, with
latest*symlinks bumped around when a release is tagged into fast/stable. If that's not what's happening, talk to ART.