Fix: Using the ./manage-offline-container-images.sh register
command does not create a new container but registers the image in the existing container registry.
#11964
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.
What type of PR is this?
/kind bug
What this PR does / why we need it:
Since I have already created a container registry, I would like to register the image there. However, when I try to register the image using the command below, a new container named 'registry' is created, and the image is registered there instead.
When I checked the script file (
manage-offline-container-images.sh
), it seemed that the container registry was being created using the following steps.The
create_registry
above is determined by the following.Originally, if a registry already exists and you want to push the image there, you need to set the registry address in
REGISTRY_PORT
. I understand that ifREGISTRY_PORT
is not set, it means a container registry is created in the local registry and the image is pushed there.Based on the above settings, it is correct to not execute the procedure if
create_registry
isfalse
, but to execute it if it istrue
. However, as shown inif [ "${create_registry}" ]; then
, the procedure is designed to create a registry if thecreate_registry
variable is set, meaning a local registry is created regardless of whether a push destination container registry is specified or not.To fix the issue, the following changes are necessary.
Which issue(s) this PR fixes:
Fixes #11867
Special notes for your reviewer:
Does this PR introduce a user-facing change?: