-
Notifications
You must be signed in to change notification settings - Fork 190
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
K8SPXC-1342 community bundle generation. #1843
base: main
Are you sure you want to change the base?
Conversation
…rcona-xtradb-cluster-operator into K8SPXC-1342_bundle_generation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@jvpasinatto could you please review? @nmarukovich could you please fix conflicts? |
…rcona-xtradb-cluster-operator into K8SPXC-1342_bundle_generation
# https://github.com/redhat-openshift-ecosystem/certification-releases/blob/main/4.9/ga/troubleshooting.md#get-supported-versions | ||
file_name='percona-xtradb-cluster-operator' | ||
|
||
if [ ${MODE} == "cluster" ]; then |
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.
[shellcheck (suggestion)] reported by reviewdog 🐶
if [ ${MODE} == "cluster" ]; then | |
if [ "${MODE}" == "cluster" ]; then |
mode="Cluster" | ||
rulesLevel="ClusterPermissions" | ||
|
||
elif [ ${MODE} == "namespace" ]; then |
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.
[shellcheck (suggestion)] reported by reviewdog 🐶
elif [ ${MODE} == "namespace" ]; then | |
elif [ "${MODE}" == "namespace" ]; then |
.annotations["com.redhat.openshift.versions"] = env(openshift_supported_versions)' \ | ||
bundle.annotations.yaml >"${bundle_directory}/metadata/annotations.yaml" | ||
|
||
if [ ${DISTRIBUTION} == 'community' ]; then |
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.
[shellcheck (suggestion)] reported by reviewdog 🐶
if [ ${DISTRIBUTION} == 'community' ]; then | |
if [ "${DISTRIBUTION}" == 'community' ]; then |
"${bundle_directory}/metadata/annotations.yaml" | ||
|
||
# certified-operators | ||
elif [ ${DISTRIBUTION} == 'redhat' ]; then |
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.
[shellcheck (suggestion)] reported by reviewdog 🐶
elif [ ${DISTRIBUTION} == 'redhat' ]; then | |
elif [ "${DISTRIBUTION}" == 'redhat' ]; then |
"${bundle_directory}/metadata/annotations.yaml" | ||
|
||
# redhat-marketplace | ||
elif [ ${DISTRIBUTION} == 'marketplace' ]; then |
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.
[shellcheck (suggestion)] reported by reviewdog 🐶
elif [ ${DISTRIBUTION} == 'marketplace' ]; then | |
elif [ "${DISTRIBUTION}" == 'marketplace' ]; then |
.spec.install.spec.deployments = [( env(deployment) | .[] |{ "name": .metadata.name, "spec": .spec} )] | | ||
.spec.minKubeVersion = env(minKubeVer)' bundle.csv.yaml >"${bundle_directory}/manifests/${file_name}.clusterserviceversion.yaml" | ||
|
||
if [ ${DISTRIBUTION} == "community" ]; then |
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.
[shellcheck (suggestion)] reported by reviewdog 🐶
if [ ${DISTRIBUTION} == "community" ]; then | |
if [ "${DISTRIBUTION}" == "community" ]; then |
if [ ${DISTRIBUTION} == "community" ]; then | ||
update_yaml_images "bundles/$DISTRIBUTION/manifests/${file_name}.clusterserviceversion.yaml" | ||
|
||
elif [ ${DISTRIBUTION} == "redhat" ]; then |
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.
[shellcheck (suggestion)] reported by reviewdog 🐶
elif [ ${DISTRIBUTION} == "redhat" ]; then | |
elif [ "${DISTRIBUTION}" == "redhat" ]; then |
.metadata.name = strenv(name_certified)' \ | ||
"${bundle_directory}/manifests/${file_name}.clusterserviceversion.yaml" | ||
|
||
elif [ ${DISTRIBUTION} == "marketplace" ]; then |
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.
[shellcheck (suggestion)] reported by reviewdog 🐶
elif [ ${DISTRIBUTION} == "marketplace" ]; then | |
elif [ "${DISTRIBUTION}" == "marketplace" ]; then |
fi | ||
|
||
update_yaml_images() { | ||
local yaml_file="$1" |
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.
[shfmt] reported by reviewdog 🐶
local yaml_file="$1" | |
local yaml_file="$1" |
if [ ! -f "$yaml_file" ]; then | ||
echo "Error: File '$yaml_file' does not exist." | ||
return 1 | ||
fi |
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.
[shfmt] reported by reviewdog 🐶
if [ ! -f "$yaml_file" ]; then | |
echo "Error: File '$yaml_file' does not exist." | |
return 1 | |
fi | |
if [ ! -f "$yaml_file" ]; then | |
echo "Error: File '$yaml_file' does not exist." | |
return 1 | |
fi |
return 1 | ||
fi | ||
|
||
local temp_file=$(mktemp) |
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.
[shfmt] reported by reviewdog 🐶
local temp_file=$(mktemp) | |
local temp_file=$(mktemp) |
sed -E 's/(("image":|containerImage:|image:)[ ]*"?)([^"]+)("?)/\1docker.io\/\3\4/g' "$yaml_file" > "$temp_file" | ||
mv "$temp_file" "$yaml_file" |
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.
[shfmt] reported by reviewdog 🐶
sed -E 's/(("image":|containerImage:|image:)[ ]*"?)([^"]+)("?)/\1docker.io\/\3\4/g' "$yaml_file" > "$temp_file" | |
mv "$temp_file" "$yaml_file" | |
sed -E 's/(("image":|containerImage:|image:)[ ]*"?)([^"]+)("?)/\1docker.io\/\3\4/g' "$yaml_file" >"$temp_file" | |
mv "$temp_file" "$yaml_file" |
sed -E 's/(("image":|containerImage:|image:)[ ]*"?)([^"]+)("?)/\1docker.io\/\3\4/g' "$yaml_file" > "$temp_file" | ||
mv "$temp_file" "$yaml_file" | ||
|
||
echo "File '$yaml_file' updated successfully." |
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.
[shfmt] reported by reviewdog 🐶
echo "File '$yaml_file' updated successfully." | |
echo "File '$yaml_file' updated successfully." |
|
||
ANNOTATIONS="${labels}" envsubst <bundle.Dockerfile >"${bundle_directory}/Dockerfile" | ||
|
||
awk '{gsub(/^[ \t]+/, " "); print}' "${bundle_directory}/Dockerfile" > "${bundle_directory}/Dockerfile.new" && mv "${bundle_directory}/Dockerfile.new" "${bundle_directory}/Dockerfile" |
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.
[shfmt] reported by reviewdog 🐶
awk '{gsub(/^[ \t]+/, " "); print}' "${bundle_directory}/Dockerfile" > "${bundle_directory}/Dockerfile.new" && mv "${bundle_directory}/Dockerfile.new" "${bundle_directory}/Dockerfile" | |
awk '{gsub(/^[ \t]+/, " "); print}' "${bundle_directory}/Dockerfile" >"${bundle_directory}/Dockerfile.new" && mv "${bundle_directory}/Dockerfile.new" "${bundle_directory}/Dockerfile" |
.spec.minKubeVersion = env(minKubeVer)' bundle.csv.yaml >"${bundle_directory}/manifests/${file_name}.clusterserviceversion.yaml" | ||
|
||
if [ ${DISTRIBUTION} == "community" ]; then | ||
update_yaml_images "bundles/$DISTRIBUTION/manifests/${file_name}.clusterserviceversion.yaml" |
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.
[shfmt] reported by reviewdog 🐶
update_yaml_images "bundles/$DISTRIBUTION/manifests/${file_name}.clusterserviceversion.yaml" | |
update_yaml_images "bundles/$DISTRIBUTION/manifests/${file_name}.clusterserviceversion.yaml" |
# delete blank lines. | ||
sed -i '' '/^$/d' "${bundle_directory}/manifests/${file_name}.clusterserviceversion.yaml" | ||
|
||
if >/dev/null command -v tree; then tree -C "${bundle_directory}"; fi |
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.
[shfmt] reported by reviewdog 🐶
if >/dev/null command -v tree; then tree -C "${bundle_directory}"; fi | |
if >/dev/null command -v tree; then tree -C "${bundle_directory}"; fi |
commit: a8f6c52 |
CHANGE DESCRIPTION
Problem:
Short explanation of the problem.
community bundle generation.
Cause:
Short explanation of the root cause of the issue if applicable.
Solution:
Short explanation of the solution we are providing with this PR.
CHECKLIST
Jira
Needs Doc
) and QA (Needs QA
)?Tests
compare/*-oc.yml
)?Config/Logging/Testability