Skip to content

ci-operator/templates/openshift: Remove unnecessary exports for PULL_SECRET and similar #3586

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ objects:
cp "$(command -v openshift-install)" /tmp
mkdir /tmp/artifacts/installer

export EXPIRATION_DATE=$(date -d '4 hours' --iso=minutes --utc)
export SSH_PUB_KEY=$(cat "${SSH_PUB_KEY_PATH}")
export PULL_SECRET=$(cat "${PULL_SECRET_PATH}")
EXPIRATION_DATE=$(date -d '4 hours' --iso=minutes --utc)
SSH_PUB_KEY=$(cat "${SSH_PUB_KEY_PATH}")
PULL_SECRET=$(cat "${PULL_SECRET_PATH}")

if [[ "${CLUSTER_TYPE}" == "aws" ]]; then
cat > /tmp/artifacts/installer/install-config.yaml << EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ objects:
echo "Installing from release ${RELEASE_IMAGE_LATEST}"
fi

export EXPIRATION_DATE=$(date -d '4 hours' --iso=minutes --utc)
export SSH_PUB_KEY=$(cat "${SSH_PUB_KEY_PATH}")
export PULL_SECRET=$(cat "${PULL_SECRET_PATH}")
EXPIRATION_DATE=$(date -d '4 hours' --iso=minutes --utc)
SSH_PUB_KEY=$(cat "${SSH_PUB_KEY_PATH}")
PULL_SECRET=$(cat "${PULL_SECRET_PATH}")

if [[ "${CLUSTER_TYPE}" == "aws" ]]; then
cat > /tmp/artifacts/installer/install-config.yaml << EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ objects:
echo "Installing from release ${RELEASE_IMAGE_LATEST}"
fi

export EXPIRATION_DATE=$(date -d '4 hours' --iso=minutes --utc)
export SSH_PUB_KEY=$(cat "${SSH_PUB_KEY_PATH}")
export PULL_SECRET=$(cat "${PULL_SECRET_PATH}")
EXPIRATION_DATE=$(date -d '4 hours' --iso=minutes --utc)
SSH_PUB_KEY=$(cat "${SSH_PUB_KEY_PATH}")
PULL_SECRET=$(cat "${PULL_SECRET_PATH}")

cat > /tmp/artifacts/installer/install-config.yaml << EOF
apiVersion: v1beta4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@ objects:
echo "Installing from release ${RELEASE_IMAGE_LATEST}"
fi

export EXPIRATION_DATE=$(date -d '4 hours' --iso=minutes --utc)
export SSH_PUB_KEY=$(cat "${SSH_PUB_KEY_PATH}")
export PULL_SECRET=$(cat "${PULL_SECRET_PATH}")
EXPIRATION_DATE=$(date -d '4 hours' --iso=minutes --utc)
SSH_PUB_KEY=$(cat "${SSH_PUB_KEY_PATH}")
PULL_SECRET=$(cat "${PULL_SECRET_PATH}")

# create a new floating ip tagged with CLUSTER_NAME so it can be deleted later
LB_FIP=$(openstack floating ip create --description $CLUSTER_NAME $OPENSTACK_EXTERNAL_NETWORK --format value -c 'floating_ip_address')
Expand Down Expand Up @@ -324,7 +324,7 @@ objects:
fi
}
function nuke() {
export PREFIX=$(grep cluster_id /tmp/artifacts/installer/terraform.tfvars | cut -d '"' -f4)
PREFIX=$(grep cluster_id /tmp/artifacts/installer/terraform.tfvars | cut -d '"' -f4)
openstack server list -c ID -f value --name $PREFIX | xargs openstack server delete

openstack router remove subnet $PREFIX-external-router $PREFIX-service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ objects:
cp "$(command -v openshift-install)" /tmp
mkdir /tmp/artifacts/installer

export EXPIRATION_DATE=$(date -d '4 hours' --iso=minutes --utc)
export SSH_PUB_KEY=$(cat "${SSH_PUB_KEY_PATH}")
export PULL_SECRET=$(cat "${PULL_SECRET_PATH}")
EXPIRATION_DATE=$(date -d '4 hours' --iso=minutes --utc)
SSH_PUB_KEY=$(cat "${SSH_PUB_KEY_PATH}")
PULL_SECRET=$(cat "${PULL_SECRET_PATH}")

if [[ "${CLUSTER_TYPE}" == "aws" ]]; then
cat > /tmp/artifacts/installer/install-config.yaml << EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,9 @@ objects:
echo "Installing from release ${RELEASE_IMAGE_LATEST}"
fi

export EXPIRATION_DATE=$(date -d '4 hours' --iso=minutes --utc)
export SSH_PUB_KEY=$(cat "${SSH_PUB_KEY_PATH}")
export PULL_SECRET=$(cat "${PULL_SECRET_PATH}")
EXPIRATION_DATE=$(date -d '4 hours' --iso=minutes --utc)
SSH_PUB_KEY=$(cat "${SSH_PUB_KEY_PATH}")
PULL_SECRET=$(cat "${PULL_SECRET_PATH}")

if [[ "${CLUSTER_TYPE}" == "aws" ]]; then
cat > /tmp/artifacts/installer/install-config.yaml << EOF
Expand Down Expand Up @@ -332,8 +332,8 @@ objects:
EOF
elif [[ "${CLUSTER_TYPE}" == "vsphere" ]]; then
# Get user and password from TFVARS_PATH
export VSPHERE_USER=$(grep -oP 'vsphere_user="\K[^"]+' ${TFVARS_PATH})
export VSPHERE_PASSWORD=$(grep -oP 'vsphere_password="\K[^"]+' ${TFVARS_PATH})
VSPHERE_USER=$(grep -oP 'vsphere_user="\K[^"]+' ${TFVARS_PATH})
VSPHERE_PASSWORD=$(grep -oP 'vsphere_password="\K[^"]+' ${TFVARS_PATH})
cat > /tmp/artifacts/installer/install-config.yaml << EOF
apiVersion: v1beta4
baseDomain: ${BASE_DOMAIN}
Expand Down Expand Up @@ -370,9 +370,9 @@ objects:
cp -r /var/lib/openshift-install/upi/${CLUSTER_TYPE}/* /tmp/tf

# Create terraform.tfvars
export BOOTSTRAP_URL="http://${JOB_NAME_SAFE}-bootstrap-exporter-${NAMESPACE}.svc.ci.openshift.org/bootstrap.ign"
export MASTER_IGN=$(cat /tmp/artifacts/installer/master.ign)
export WORKER_IGN=$(cat /tmp/artifacts/installer/worker.ign)
BOOTSTRAP_URL="http://${JOB_NAME_SAFE}-bootstrap-exporter-${NAMESPACE}.svc.ci.openshift.org/bootstrap.ign"
MASTER_IGN=$(cat /tmp/artifacts/installer/master.ign)
WORKER_IGN=$(cat /tmp/artifacts/installer/worker.ign)

cat > /tmp/tf/terraform.tfvars <<-EOF
machine_cidr = "139.178.73.0/26"
Expand Down Expand Up @@ -513,8 +513,8 @@ objects:
if [ -f /tmp/artifacts/installer/.openshift_install_state.json ]
then
# Remove VSPHERE_USER and VSPHERE_PASSWORD from install state json
export VSPHERE_USER=$(grep -oP 'vsphere_user="\K[^"]+' ${TFVARS_PATH})
export VSPHERE_PASSWORD=$(grep -oP 'vsphere_password="\K[^"]+' ${TFVARS_PATH})
VSPHERE_USER=$(grep -oP 'vsphere_user="\K[^"]+' ${TFVARS_PATH})
VSPHERE_PASSWORD=$(grep -oP 'vsphere_password="\K[^"]+' ${TFVARS_PATH})
sed -i "s;${VSPHERE_USER};REDACTED;g" /tmp/artifacts/installer/.openshift_install_state.json
sed -i "s;${VSPHERE_PASSWORD};REDACTED;g" /tmp/artifacts/installer/.openshift_install_state.json

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ objects:

mkdir /tmp/artifacts/installer

export SSH_PUB_KEY=$(cat "${OPENSHIFT_INSTALL_SSH_PUB_KEY_PATH}")
export PULL_SECRET=$(cat "${OPENSHIFT_INSTALL_PULL_SECRET_PATH}")
SSH_PUB_KEY=$(cat "${OPENSHIFT_INSTALL_SSH_PUB_KEY_PATH}")
PULL_SECRET=$(cat "${OPENSHIFT_INSTALL_PULL_SECRET_PATH}")

if [[ "${CLUSTER_TYPE}" == "gcp" ]]; then
cat > /tmp/artifacts/installer/install-config.yaml << EOF
Expand Down Expand Up @@ -250,7 +250,7 @@ objects:
EOF
elif [[ "${CLUSTER_TYPE}" == "aws" ]]; then
export AWS_SHARED_CREDENTIALS_FILE="/etc/openshift-installer/.awscred"
export EXPIRATION_DATE=$(date -d '4 hours' --iso=minutes --utc)
EXPIRATION_DATE=$(date -d '4 hours' --iso=minutes --utc)
cat > /tmp/artifacts/installer/install-config.yaml << EOF
apiVersion: v1beta4
baseDomain: test.ose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,9 @@ objects:
cp "$(command -v openshift-install)" /tmp
mkdir /tmp/artifacts/installer

export EXPIRATION_DATE=$(date -d '4 hours' --iso=minutes --utc)
export SSH_PUB_KEY=$(cat "${SSH_PUB_KEY_PATH}")
export PULL_SECRET=$(cat "${PULL_SECRET_PATH}")
EXPIRATION_DATE=$(date -d '4 hours' --iso=minutes --utc)
SSH_PUB_KEY=$(cat "${SSH_PUB_KEY_PATH}")
PULL_SECRET=$(cat "${PULL_SECRET_PATH}")

if [[ "${CLUSTER_TYPE}" == "aws" ]]; then
cat > /tmp/artifacts/installer/install-config.yaml << EOF
Expand Down