-
Notifications
You must be signed in to change notification settings - Fork 88
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
fix: Remove previous RELATED_IMAGES before adding new ones #967
Conversation
Signed-off-by: Anatolii Bazko <[email protected]>
envVarName=$(cat "${OPERATOR_FILE}" | yq -r '.spec.template.spec.containers[0].env['${i}'].name') | ||
if [[ ${envVarName} =~ plugin_registry_image ]] || [[ ${envVarName} =~ devfile_registry_image ]]; then | ||
yq -riY 'del(.spec.template.spec.containers[0].env['${i}'])' ${OPERATOR_FILE} | ||
i=$((i-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.
- I'd remove this decrement and put the following increment into else block.
- Shouldn't you change the total number of env vars too?
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.
- I've thought about it but this approach sounds more explicit
- It does not matter, there are no errors,
yq
returnsnull
as a string
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.
- I have opposite opinion, but ok.
- That's logically wrong.
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.
- It is not a c++ or java. We have to processed all records, other doesn't matter
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.
That's a source of errors. If yq
behavior changes or someone add another line that doesn't tolerate index error... but up to you...
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: flacatus, mmorhun, tolusha The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Anatolii Bazko [email protected]
What does this PR do?
Remove previous RELATED_IMAGES before adding new ones to
config/manager/manager.yaml
Screenshot/screencast of this PR
N/A
What issues does this PR fix or reference?
eclipse-che/che#20171
How to test this PR?
Run twice, make sure that content of the
config/manager/manager.yaml
is not changes after the second try../olm/addDigests.sh -w . -s bundle/stable/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml -o config/manager/manager.yaml -t 7.32.0
PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.