Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

fix: Fix installer for custom package URL's. #4364

Merged
merged 1 commit into from
Apr 12, 2021

Conversation

cpuguy83
Copy link
Member

Reason for Change:

Ran into this in CI where I'm trying to test new packages.
runc that's already installed in the vm image is older than the minimum
version of the new package, as such the package installation fails and
cluster provisioning errors out.

apt has functionality to fix dependency problems found while using
dpkg.

This adds a helper function to replace dpkg install with one that
basically calls apt-get update && apt-get install -f after a failed
install (update is required as well, otherwise the package list is out
of date).

Issue Fixed:

Credit Where Due:

Does this change contain code from or inspired by another project?

  • No
  • Yes

If "Yes," did you notify that project's maintainers and provide attribution?

  • No
  • Yes

Requirements:

Notes:

Ran into this in CI where I'm trying to test new packages.
runc that's already installed in the vm image is older than the minimum
version of the new package, as such the package installation fails and
cluster provisioning errors out.

apt has functionality to fix dependency problems found while using
`dpkg`.

This adds a helper function to replace `dpkg install` with one that
basically calls `apt-get update && apt-get install -f` after a failed
install (update is required as well, otherwise the package list is out
of date).
@cpuguy83 cpuguy83 changed the title [fix] Fix installer for custom package URL's. fix: Fix installer for custom package URL's. Apr 12, 2021
@codecov
Copy link

codecov bot commented Apr 12, 2021

Codecov Report

Merging #4364 (f5ace6b) into master (c6d89ee) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4364   +/-   ##
=======================================
  Coverage   72.09%   72.09%           
=======================================
  Files         141      141           
  Lines       21665    21665           
=======================================
  Hits        15619    15619           
  Misses       5094     5094           
  Partials      952      952           
Impacted Files Coverage Δ
pkg/engine/templates_generated.go 43.56% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6d89ee...f5ace6b. Read the comment docs.

dpkg_install() {
retries=$1; wait_sleep=$2; shift && shift;
for i in $(seq 1 $retries); do
wait_for_apt_locks; dpkg -i "${1}" && break; apt-get update --fix-missing; do_apt_get_install -f && break
Copy link
Member

Choose a reason for hiding this comment

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

clever usage of the -f there in the new do_apt_get_install func

Copy link
Member

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

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

/lgtm

@acs-bot
Copy link

acs-bot commented Apr 12, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpuguy83, jackfrancis

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

@jackfrancis jackfrancis merged commit fa12ee3 into Azure:master Apr 12, 2021
@cpuguy83 cpuguy83 deleted the fix_dpkg_install branch April 12, 2021 19:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants