Skip to content
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

[2.16] Fix how to get image ID on offline deployment #7829

Merged
merged 2 commits into from
Jul 28, 2021

Conversation

oomichi
Copy link
Contributor

@oomichi oomichi commented Jul 27, 2021

What type of PR is this?

/kind bug

What this PR does / why we need it:

This is a backport pull request for v2.16.
The original pull request is #7808

Previously IDs of container images were gotten from tar files of container images but that way was wrong.
If multiple json files are contained in a tar file, the script got multiple IDs and tried to pass these IDs on docker tag command. Then the command was failed.

This updates the script to get image IDs from docker image inspect command to fix this issue.
In addition, this adds a check a registry container exists already or not before deploying registry container to avoid a container conflict failure.

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 27, 2021
@k8s-ci-robot k8s-ci-robot requested review from bozzo and holmsten July 27, 2021 02:11
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 27, 2021
@floryut
Copy link
Member

floryut commented Jul 27, 2021

We need to backport #7824 as OVH is no longer valid :/

@oomichi
Copy link
Contributor Author

oomichi commented Jul 27, 2021

We need to backport #7824 as OVH is no longer valid :/

Thanks for letting me know that, @floryut
OK, I will create another pr for that.

@oomichi
Copy link
Contributor Author

oomichi commented Jul 27, 2021

#7830 is ready for backporting.

oomichi added 2 commits July 27, 2021 23:28
When running the script, I faced the following error but it was
difficult to know the root problem due to lack of error handling.

  docker tag" requires exactly 2 arguments.
  See 'docker tag --help'.

  Usage:  docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]

  Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE

To investigate such errors easily, this adds an error handling.
Previously IDs of container images were gotten from tar files of container
images but that way was wrong. If multiple json files are contained in a
tar file, the script got multiple IDs and tried to pass these IDs on
`docker tag` command. Then the command was failed.

This updates the script to get image IDs from `docker image inspect` command
to fix this issue.
In addition, this adds a check a registry container exists already or not
before deploying registry container to avoid a container conflict failure.
@oomichi
Copy link
Contributor Author

oomichi commented Jul 27, 2021

just rebased after backporting necessary pull request for solving CI job failure.

Copy link
Member

@floryut floryut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 28, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: floryut, oomichi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 28, 2021
@k8s-ci-robot k8s-ci-robot merged commit 247d062 into kubernetes-sigs:release-2.16 Jul 28, 2021
rtsp pushed a commit to rtsp/kubespray that referenced this pull request Jul 30, 2021
…#7829)

* Add error handling for registorying images (kubernetes-sigs#7787)

When running the script, I faced the following error but it was
difficult to know the root problem due to lack of error handling.

  docker tag" requires exactly 2 arguments.
  See 'docker tag --help'.

  Usage:  docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]

  Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE

To investigate such errors easily, this adds an error handling.

* Fix how to get image ID on offline deployment (kubernetes-sigs#7808)

Previously IDs of container images were gotten from tar files of container
images but that way was wrong. If multiple json files are contained in a
tar file, the script got multiple IDs and tried to pass these IDs on
`docker tag` command. Then the command was failed.

This updates the script to get image IDs from `docker image inspect` command
to fix this issue.
In addition, this adds a check a registry container exists already or not
before deploying registry container to avoid a container conflict failure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants