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

Fix how to get image ID on offline deployment #7808

Merged
merged 1 commit into from
Jul 26, 2021

Conversation

oomichi
Copy link
Contributor

@oomichi oomichi commented Jul 19, 2021

What type of PR is this?

/kind bug

What this PR does / why we need it:

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.

Which issue(s) this PR fixes:

Fixes #7788

Does this PR introduce a user-facing change?:

NONE

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.
@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 19, 2021
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 19, 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 19, 2021
@atoato88
Copy link

/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 26, 2021
@k8s-ci-robot k8s-ci-robot merged commit 8f44cd3 into kubernetes-sigs:master Jul 26, 2021
oomichi added a commit to oomichi/kubespray that referenced this pull request Jul 27, 2021
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 added a commit to oomichi/kubespray that referenced this pull request Jul 27, 2021
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.
k8s-ci-robot pushed a commit that referenced this pull request Jul 28, 2021
* Add error handling for registorying images (#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 (#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.
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.
Quehenr added a commit to Quehenr/unstable-laboratory-infrastructure-kubespray that referenced this pull request Aug 2, 2021
* master: (23 commits)
  retry to fetch binary if it fails first time (kubernetes-sigs#7839)
  Update vSphere CPI (kubernetes-sigs#7838)
  doc: Update 'Kubespray vs Kubeadm' (kubernetes-sigs#7834)
  Update MetalLB documentation (kubernetes-sigs#7833)
  Disable OVH CI until  voucher situation is cleared up (kubernetes-sigs#7824)
  Fix how to get image ID on offline deployment (kubernetes-sigs#7808)
  CRI-O: Install libseccomp2 from backports on Debian 10 (kubernetes-sigs#7816)
  fix(misc): contrib/terraform/aws (kubernetes-sigs#7818)
  Separate gvisor_download_url for runsc and shim (kubernetes-sigs#7760)
  Allow failure on tf-elax_ubuntu18-calico (kubernetes-sigs#7814)
  Add containerd on Flatcar Container Linux (kubernetes-sigs#7681)
  Fixup label for oracle linux bootstrap
  Update multus to 3.7.2 (and move to ghcr.io)
  Set default k8s version to 1.21.3
  Add hashes for k8s 1.20.8/.9 and 1.19.12/.13 and 1.21.3
  Fix erroneous ansible args
  Update kube-router to 1.3.0
  Update flannel to 0.14.0 (moved from coreos repo to flannel-io)
  Use dashboard 2.3.1 image
  Set Helm default version to 3.6.3
  ...
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Oct 23, 2021
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.
sakuraiyuta pushed a commit to sakuraiyuta/kubespray that referenced this pull request Apr 16, 2022
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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to register busybox container image for offline deployment
4 participants