Skip to content
Open
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 @@ -44,6 +44,9 @@ tests:
steps:
cluster_profile: openshift-org-aws
env:
DEPENDS_ON_CANDIDATES: |-
migtools/kubevirt-datamover-plugin RELATED_IMAGE_KUBEVIRT_DATAMOVER_PLUGIN
openshift/oadp-operator MANAGER_IMAGE
OADP_BRANCH: oadp-1.6
OO_BUNDLE: quay-proxy.ci.openshift.org/openshift/ci:konveyor_oadp-operator-bundle_oadp-1.6
OO_INSTALL_MODE: OwnNamespace
Expand All @@ -59,6 +62,7 @@ tests:
- chain: ipi-aws-pre
- ref: oadp-operator-sdk-bundle-image
test:
- ref: oadp-depends-on-build
- as: set-related-image
cli: latest
commands: |
Expand Down Expand Up @@ -86,22 +90,77 @@ tests:
# freshly created Subscription in this ephemeral, single-purpose
# namespace has no pre-existing config.env entries to lose; this
# would need a read-modify-write if that ever stops being true.
PATCH=$(printf '{"spec":{"config":{"env":[{"name":"RELATED_IMAGE_KUBEVIRT_DATAMOVER_CONTROLLER","value":"%s"}]}}}' "${KDM_CONTROLLER_IMAGE}")
#
# This job's own dependency (KDM_CONTROLLER_IMAGE, built by
# ci-operator natively from this PR) is always applied. Any
# cross-repo dependency resolved by the oadp-depends-on-build step
# above (per a Depends-On: line in this PR's description, e.g.
# naming an unmerged kubevirt-datamover-plugin PR) is folded in from
# its manifest file, if present -- see openshift/oadp-operator#2389.
#
# A resolved openshift/oadp-operator dependency is special-cased
# below: oadp-operator's own manager image isn't a RELATED_IMAGE_*
# in this job's context (it's the operator itself, not a component
# it deploys), so it can't go through the Subscription.spec.config.env
# override like everything else here. It's flagged with the sentinel
# name MANAGER_IMAGE (not a real RELATED_IMAGE_* var) and patched
# directly onto the Deployment's own container image further down
# instead. This only covers reconcile-logic-level oadp-operator PRs
# (e.g. how it builds this Deployment's spec) -- an oadp-operator PR
# that changes RBAC/CSV/CRD manifests needs an alternate bundle
# install, which this does not attempt.
ALL_ENV_LINES="RELATED_IMAGE_KUBEVIRT_DATAMOVER_CONTROLLER ${KDM_CONTROLLER_IMAGE}"
if [ -s "${SHARED_DIR}/depends-on-images.txt" ]; then
ALL_ENV_LINES="${ALL_ENV_LINES}
$(cat "${SHARED_DIR}/depends-on-images.txt")"
fi
MANAGER_IMAGE_VALUE=""
SUBSCRIPTION_ENV_LINES=""
while read -r ENV_NAME ENV_VALUE; do
[ -z "${ENV_NAME}" ] && continue
if [ "${ENV_NAME}" = "MANAGER_IMAGE" ]; then
MANAGER_IMAGE_VALUE="${ENV_VALUE}"
else
SUBSCRIPTION_ENV_LINES="${SUBSCRIPTION_ENV_LINES}
${ENV_NAME} ${ENV_VALUE}"
fi
done <<< "${ALL_ENV_LINES}"
ALL_ENV_LINES="${SUBSCRIPTION_ENV_LINES}"
ENTRIES=()
while read -r ENV_NAME ENV_VALUE; do
[ -z "${ENV_NAME}" ] && continue
ENTRIES+=("{\"name\":\"${ENV_NAME}\",\"value\":\"${ENV_VALUE}\"}")
done <<< "${ALL_ENV_LINES}"
JOINED=$(IFS=,; echo "${ENTRIES[*]}")
PATCH=$(printf '{"spec":{"config":{"env":[%s]}}}' "${JOINED}")
oc patch subscription "${SUB}" -n "${OO_INSTALL_NAMESPACE}" --type merge -p "${PATCH}"
echo "Waiting for Deployment to observe RELATED_IMAGE_KUBEVIRT_DATAMOVER_CONTROLLER=${KDM_CONTROLLER_IMAGE}"
echo "Waiting for Deployment to observe:"
while read -r ENV_NAME _; do
[ -n "${ENV_NAME}" ] && echo " ${ENV_NAME}"
done <<< "${ALL_ENV_LINES}"
for _ in $(seq 1 60); do
CURRENT=$(oc get deployment/openshift-adp-controller-manager -n "${OO_INSTALL_NAMESPACE}" -o jsonpath="{.spec.template.spec.containers[?(@.name==\"manager\")].env[?(@.name==\"RELATED_IMAGE_KUBEVIRT_DATAMOVER_CONTROLLER\")].value}" 2>/dev/null || true)
[ "${CURRENT}" = "${KDM_CONTROLLER_IMAGE}" ] && break
ALL_OK=true
while read -r ENV_NAME ENV_VALUE; do
[ -z "${ENV_NAME}" ] && continue
CURRENT=$(oc get deployment/openshift-adp-controller-manager -n "${OO_INSTALL_NAMESPACE}" -o jsonpath="{.spec.template.spec.containers[?(@.name==\"manager\")].env[?(@.name==\"${ENV_NAME}\")].value}" 2>/dev/null || true)
[ "${CURRENT}" != "${ENV_VALUE}" ] && ALL_OK=false
done <<< "${ALL_ENV_LINES}"
[ "${ALL_OK}" = "true" ] && break
sleep 5
done
if [ "${CURRENT}" != "${KDM_CONTROLLER_IMAGE}" ]; then
if [ "${ALL_OK}" != "true" ]; then
echo "Timed out waiting for Deployment spec to reflect the Subscription.spec.config.env override" >&2
oc get subscription "${SUB}" -n "${OO_INSTALL_NAMESPACE}" -o yaml > "${ARTIFACT_DIR}/subscription-${SUB}.yaml" || true
oc get csv -n "${OO_INSTALL_NAMESPACE}" -o yaml > "${ARTIFACT_DIR}/csvs.yaml" || true
oc get deployment -n "${OO_INSTALL_NAMESPACE}" -o yaml > "${ARTIFACT_DIR}/deployments.yaml" || true
exit 1
fi
oc rollout status deployment/openshift-adp-controller-manager -n "${OO_INSTALL_NAMESPACE}" --timeout=180s
if [ -n "${MANAGER_IMAGE_VALUE}" ]; then
echo "Depends-On resolved an oadp-operator PR -- patching the manager Deployment's own container image directly (not a RELATED_IMAGE_* env var, since oadp-operator itself isn't a related-image in this job's context)"
oc set image "deployment/openshift-adp-controller-manager" "manager=${MANAGER_IMAGE_VALUE}" -n "${OO_INSTALL_NAMESPACE}"
oc rollout status deployment/openshift-adp-controller-manager -n "${OO_INSTALL_NAMESPACE}" --timeout=180s
fi
dependencies:
- env: KDM_CONTROLLER_IMAGE
name: kubevirt-datamover-controller-oadp-1.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ tests:
steps:
cluster_profile: openshift-org-aws
env:
DEPENDS_ON_CANDIDATES: |-
migtools/kubevirt-datamover-plugin RELATED_IMAGE_KUBEVIRT_DATAMOVER_PLUGIN
openshift/oadp-operator MANAGER_IMAGE
OADP_BRANCH: oadp-dev
OO_BUNDLE: quay-proxy.ci.openshift.org/openshift/ci:konveyor_oadp-operator-bundle_oadp-dev
OO_INSTALL_MODE: OwnNamespace
Expand All @@ -59,6 +62,7 @@ tests:
- chain: ipi-aws-pre
- ref: oadp-operator-sdk-bundle-image
test:
- ref: oadp-depends-on-build
- as: set-related-image
cli: latest
commands: |
Expand Down Expand Up @@ -86,22 +90,77 @@ tests:
# freshly created Subscription in this ephemeral, single-purpose
# namespace has no pre-existing config.env entries to lose; this
# would need a read-modify-write if that ever stops being true.
PATCH=$(printf '{"spec":{"config":{"env":[{"name":"RELATED_IMAGE_KUBEVIRT_DATAMOVER_CONTROLLER","value":"%s"}]}}}' "${KDM_CONTROLLER_IMAGE}")
#
# This job's own dependency (KDM_CONTROLLER_IMAGE, built by
# ci-operator natively from this PR) is always applied. Any
# cross-repo dependency resolved by the oadp-depends-on-build step
# above (per a Depends-On: line in this PR's description, e.g.
# naming an unmerged kubevirt-datamover-plugin PR) is folded in from
# its manifest file, if present -- see openshift/oadp-operator#2389.
#
# A resolved openshift/oadp-operator dependency is special-cased
# below: oadp-operator's own manager image isn't a RELATED_IMAGE_*
# in this job's context (it's the operator itself, not a component
# it deploys), so it can't go through the Subscription.spec.config.env
# override like everything else here. It's flagged with the sentinel
# name MANAGER_IMAGE (not a real RELATED_IMAGE_* var) and patched
# directly onto the Deployment's own container image further down
# instead. This only covers reconcile-logic-level oadp-operator PRs
# (e.g. how it builds this Deployment's spec) -- an oadp-operator PR
# that changes RBAC/CSV/CRD manifests needs an alternate bundle
# install, which this does not attempt.
ALL_ENV_LINES="RELATED_IMAGE_KUBEVIRT_DATAMOVER_CONTROLLER ${KDM_CONTROLLER_IMAGE}"
if [ -s "${SHARED_DIR}/depends-on-images.txt" ]; then
ALL_ENV_LINES="${ALL_ENV_LINES}
$(cat "${SHARED_DIR}/depends-on-images.txt")"
fi
MANAGER_IMAGE_VALUE=""
SUBSCRIPTION_ENV_LINES=""
while read -r ENV_NAME ENV_VALUE; do
[ -z "${ENV_NAME}" ] && continue
if [ "${ENV_NAME}" = "MANAGER_IMAGE" ]; then
MANAGER_IMAGE_VALUE="${ENV_VALUE}"
else
SUBSCRIPTION_ENV_LINES="${SUBSCRIPTION_ENV_LINES}
${ENV_NAME} ${ENV_VALUE}"
fi
done <<< "${ALL_ENV_LINES}"
ALL_ENV_LINES="${SUBSCRIPTION_ENV_LINES}"
ENTRIES=()
while read -r ENV_NAME ENV_VALUE; do
[ -z "${ENV_NAME}" ] && continue
ENTRIES+=("{\"name\":\"${ENV_NAME}\",\"value\":\"${ENV_VALUE}\"}")
done <<< "${ALL_ENV_LINES}"
JOINED=$(IFS=,; echo "${ENTRIES[*]}")
PATCH=$(printf '{"spec":{"config":{"env":[%s]}}}' "${JOINED}")
oc patch subscription "${SUB}" -n "${OO_INSTALL_NAMESPACE}" --type merge -p "${PATCH}"
echo "Waiting for Deployment to observe RELATED_IMAGE_KUBEVIRT_DATAMOVER_CONTROLLER=${KDM_CONTROLLER_IMAGE}"
echo "Waiting for Deployment to observe:"
while read -r ENV_NAME _; do
[ -n "${ENV_NAME}" ] && echo " ${ENV_NAME}"
done <<< "${ALL_ENV_LINES}"
for _ in $(seq 1 60); do
CURRENT=$(oc get deployment/openshift-adp-controller-manager -n "${OO_INSTALL_NAMESPACE}" -o jsonpath="{.spec.template.spec.containers[?(@.name==\"manager\")].env[?(@.name==\"RELATED_IMAGE_KUBEVIRT_DATAMOVER_CONTROLLER\")].value}" 2>/dev/null || true)
[ "${CURRENT}" = "${KDM_CONTROLLER_IMAGE}" ] && break
ALL_OK=true
while read -r ENV_NAME ENV_VALUE; do
[ -z "${ENV_NAME}" ] && continue
CURRENT=$(oc get deployment/openshift-adp-controller-manager -n "${OO_INSTALL_NAMESPACE}" -o jsonpath="{.spec.template.spec.containers[?(@.name==\"manager\")].env[?(@.name==\"${ENV_NAME}\")].value}" 2>/dev/null || true)
[ "${CURRENT}" != "${ENV_VALUE}" ] && ALL_OK=false
done <<< "${ALL_ENV_LINES}"
[ "${ALL_OK}" = "true" ] && break
sleep 5
done
if [ "${CURRENT}" != "${KDM_CONTROLLER_IMAGE}" ]; then
if [ "${ALL_OK}" != "true" ]; then
echo "Timed out waiting for Deployment spec to reflect the Subscription.spec.config.env override" >&2
oc get subscription "${SUB}" -n "${OO_INSTALL_NAMESPACE}" -o yaml > "${ARTIFACT_DIR}/subscription-${SUB}.yaml" || true
oc get csv -n "${OO_INSTALL_NAMESPACE}" -o yaml > "${ARTIFACT_DIR}/csvs.yaml" || true
oc get deployment -n "${OO_INSTALL_NAMESPACE}" -o yaml > "${ARTIFACT_DIR}/deployments.yaml" || true
exit 1
fi
oc rollout status deployment/openshift-adp-controller-manager -n "${OO_INSTALL_NAMESPACE}" --timeout=180s
if [ -n "${MANAGER_IMAGE_VALUE}" ]; then
echo "Depends-On resolved an oadp-operator PR -- patching the manager Deployment's own container image directly (not a RELATED_IMAGE_* env var, since oadp-operator itself isn't a related-image in this job's context)"
oc set image "deployment/openshift-adp-controller-manager" "manager=${MANAGER_IMAGE_VALUE}" -n "${OO_INSTALL_NAMESPACE}"
oc rollout status deployment/openshift-adp-controller-manager -n "${OO_INSTALL_NAMESPACE}" --timeout=180s
fi
dependencies:
- env: KDM_CONTROLLER_IMAGE
name: kubevirt-datamover-controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ tests:
steps:
cluster_profile: openshift-org-aws
env:
DEPENDS_ON_CANDIDATES: |-
migtools/kubevirt-datamover-controller RELATED_IMAGE_KUBEVIRT_DATAMOVER_CONTROLLER
openshift/velero RELATED_IMAGE_VELERO Dockerfile.ubi
OADP_BRANCH: oadp-1.6
OO_BUNDLE: quay-proxy.ci.openshift.org/openshift/ci:konveyor_oadp-operator-bundle_oadp-1.6
OO_INSTALL_MODE: OwnNamespace
Expand All @@ -59,6 +62,7 @@ tests:
- chain: ipi-aws-pre
- ref: oadp-operator-sdk-bundle-image
test:
- ref: oadp-depends-on-build
- as: set-related-image
cli: latest
commands: |
Expand Down Expand Up @@ -86,15 +90,41 @@ tests:
# freshly created Subscription in this ephemeral, single-purpose
# namespace has no pre-existing config.env entries to lose; this
# would need a read-modify-write if that ever stops being true.
PATCH=$(printf '{"spec":{"config":{"env":[{"name":"RELATED_IMAGE_KUBEVIRT_DATAMOVER_PLUGIN","value":"%s"}]}}}' "${KDM_PLUGIN_IMAGE}")
#
# This job's own dependency (KDM_PLUGIN_IMAGE, built by ci-operator
# natively from this PR) is always applied. Any cross-repo
# dependency resolved by the oadp-depends-on-build step above (per
# a Depends-On: line in this PR's description, e.g. naming an
# unmerged kubevirt-datamover-controller PR) is folded in from its
# manifest file, if present -- see openshift/oadp-operator#2389.
ALL_ENV_LINES="RELATED_IMAGE_KUBEVIRT_DATAMOVER_PLUGIN ${KDM_PLUGIN_IMAGE}"
if [ -s "${SHARED_DIR}/depends-on-images.txt" ]; then
ALL_ENV_LINES="${ALL_ENV_LINES}
$(cat "${SHARED_DIR}/depends-on-images.txt")"
fi
ENTRIES=()
while read -r ENV_NAME ENV_VALUE; do
[ -z "${ENV_NAME}" ] && continue
ENTRIES+=("{\"name\":\"${ENV_NAME}\",\"value\":\"${ENV_VALUE}\"}")
done <<< "${ALL_ENV_LINES}"
JOINED=$(IFS=,; echo "${ENTRIES[*]}")
PATCH=$(printf '{"spec":{"config":{"env":[%s]}}}' "${JOINED}")
oc patch subscription "${SUB}" -n "${OO_INSTALL_NAMESPACE}" --type merge -p "${PATCH}"
echo "Waiting for Deployment to observe RELATED_IMAGE_KUBEVIRT_DATAMOVER_PLUGIN=${KDM_PLUGIN_IMAGE}"
echo "Waiting for Deployment to observe:"
while read -r ENV_NAME _; do
[ -n "${ENV_NAME}" ] && echo " ${ENV_NAME}"
done <<< "${ALL_ENV_LINES}"
for _ in $(seq 1 60); do
CURRENT=$(oc get deployment/openshift-adp-controller-manager -n "${OO_INSTALL_NAMESPACE}" -o jsonpath="{.spec.template.spec.containers[?(@.name==\"manager\")].env[?(@.name==\"RELATED_IMAGE_KUBEVIRT_DATAMOVER_PLUGIN\")].value}" 2>/dev/null || true)
[ "${CURRENT}" = "${KDM_PLUGIN_IMAGE}" ] && break
ALL_OK=true
while read -r ENV_NAME ENV_VALUE; do
[ -z "${ENV_NAME}" ] && continue
CURRENT=$(oc get deployment/openshift-adp-controller-manager -n "${OO_INSTALL_NAMESPACE}" -o jsonpath="{.spec.template.spec.containers[?(@.name==\"manager\")].env[?(@.name==\"${ENV_NAME}\")].value}" 2>/dev/null || true)
[ "${CURRENT}" != "${ENV_VALUE}" ] && ALL_OK=false
done <<< "${ALL_ENV_LINES}"
[ "${ALL_OK}" = "true" ] && break
sleep 5
done
if [ "${CURRENT}" != "${KDM_PLUGIN_IMAGE}" ]; then
if [ "${ALL_OK}" != "true" ]; then
echo "Timed out waiting for Deployment spec to reflect the Subscription.spec.config.env override" >&2
oc get subscription "${SUB}" -n "${OO_INSTALL_NAMESPACE}" -o yaml > "${ARTIFACT_DIR}/subscription-${SUB}.yaml" || true
oc get csv -n "${OO_INSTALL_NAMESPACE}" -o yaml > "${ARTIFACT_DIR}/csvs.yaml" || true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ tests:
steps:
cluster_profile: openshift-org-aws
env:
DEPENDS_ON_CANDIDATES: |-
migtools/kubevirt-datamover-controller RELATED_IMAGE_KUBEVIRT_DATAMOVER_CONTROLLER
openshift/velero RELATED_IMAGE_VELERO Dockerfile.ubi
OADP_BRANCH: oadp-dev
OO_BUNDLE: quay-proxy.ci.openshift.org/openshift/ci:konveyor_oadp-operator-bundle_oadp-dev
OO_INSTALL_MODE: OwnNamespace
Expand All @@ -59,6 +62,7 @@ tests:
- chain: ipi-aws-pre
- ref: oadp-operator-sdk-bundle-image
test:
- ref: oadp-depends-on-build
- as: set-related-image
cli: latest
commands: |
Expand Down Expand Up @@ -86,15 +90,41 @@ tests:
# freshly created Subscription in this ephemeral, single-purpose
# namespace has no pre-existing config.env entries to lose; this
# would need a read-modify-write if that ever stops being true.
PATCH=$(printf '{"spec":{"config":{"env":[{"name":"RELATED_IMAGE_KUBEVIRT_DATAMOVER_PLUGIN","value":"%s"}]}}}' "${KDM_PLUGIN_IMAGE}")
#
# This job's own dependency (KDM_PLUGIN_IMAGE, built by ci-operator
# natively from this PR) is always applied. Any cross-repo
# dependency resolved by the oadp-depends-on-build step above (per
# a Depends-On: line in this PR's description, e.g. naming an
# unmerged kubevirt-datamover-controller PR) is folded in from its
# manifest file, if present -- see openshift/oadp-operator#2389.
ALL_ENV_LINES="RELATED_IMAGE_KUBEVIRT_DATAMOVER_PLUGIN ${KDM_PLUGIN_IMAGE}"
if [ -s "${SHARED_DIR}/depends-on-images.txt" ]; then
ALL_ENV_LINES="${ALL_ENV_LINES}
$(cat "${SHARED_DIR}/depends-on-images.txt")"
fi
ENTRIES=()
while read -r ENV_NAME ENV_VALUE; do
[ -z "${ENV_NAME}" ] && continue
ENTRIES+=("{\"name\":\"${ENV_NAME}\",\"value\":\"${ENV_VALUE}\"}")
done <<< "${ALL_ENV_LINES}"
JOINED=$(IFS=,; echo "${ENTRIES[*]}")
PATCH=$(printf '{"spec":{"config":{"env":[%s]}}}' "${JOINED}")
oc patch subscription "${SUB}" -n "${OO_INSTALL_NAMESPACE}" --type merge -p "${PATCH}"
echo "Waiting for Deployment to observe RELATED_IMAGE_KUBEVIRT_DATAMOVER_PLUGIN=${KDM_PLUGIN_IMAGE}"
echo "Waiting for Deployment to observe:"
while read -r ENV_NAME _; do
[ -n "${ENV_NAME}" ] && echo " ${ENV_NAME}"
done <<< "${ALL_ENV_LINES}"
for _ in $(seq 1 60); do
CURRENT=$(oc get deployment/openshift-adp-controller-manager -n "${OO_INSTALL_NAMESPACE}" -o jsonpath="{.spec.template.spec.containers[?(@.name==\"manager\")].env[?(@.name==\"RELATED_IMAGE_KUBEVIRT_DATAMOVER_PLUGIN\")].value}" 2>/dev/null || true)
[ "${CURRENT}" = "${KDM_PLUGIN_IMAGE}" ] && break
ALL_OK=true
while read -r ENV_NAME ENV_VALUE; do
[ -z "${ENV_NAME}" ] && continue
CURRENT=$(oc get deployment/openshift-adp-controller-manager -n "${OO_INSTALL_NAMESPACE}" -o jsonpath="{.spec.template.spec.containers[?(@.name==\"manager\")].env[?(@.name==\"${ENV_NAME}\")].value}" 2>/dev/null || true)
[ "${CURRENT}" != "${ENV_VALUE}" ] && ALL_OK=false
done <<< "${ALL_ENV_LINES}"
[ "${ALL_OK}" = "true" ] && break
sleep 5
done
if [ "${CURRENT}" != "${KDM_PLUGIN_IMAGE}" ]; then
if [ "${ALL_OK}" != "true" ]; then
echo "Timed out waiting for Deployment spec to reflect the Subscription.spec.config.env override" >&2
oc get subscription "${SUB}" -n "${OO_INSTALL_NAMESPACE}" -o yaml > "${ARTIFACT_DIR}/subscription-${SUB}.yaml" || true
oc get csv -n "${OO_INSTALL_NAMESPACE}" -o yaml > "${ARTIFACT_DIR}/csvs.yaml" || true
Expand Down
Loading