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

Avoid corrective changes when downloading packages via archive #674

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

deric
Copy link
Collaborator

@deric deric commented Feb 8, 2024

Summary

Deleting downloaded archives might lead to corrective changes, like:

Notice: /Stage[main]/Kubernetes::Packages/Archive[containerd-1.6.28-linux-amd64.tar.gz]/ensure: current_value 'absent', should be 'present' (noop) (corrective)
Info: /Stage[main]/Kubernetes::Packages/Archive[containerd-1.6.28-linux-amd64.tar.gz]: Scheduling refresh of Service[containerd]
Notice: /Stage[main]/Kubernetes::Packages/Archive[etcd-v3.4.30-linux-amd64.tar.gz]/ensure: current_value 'absent', should be 'present' (noop) (corrective)
Info: /Stage[main]/Kubernetes::Packages/Archive[etcd-v3.4.30-linux-amd64.tar.gz]: Scheduling refresh of Service[etcd]

The archive[cleanup] should have the same value for all archives.

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified. (For example puppet apply)

@deric deric requested review from bastelfreak and a team as code owners February 8, 2024 10:29
@@ -422,7 +427,7 @@
checksum => $runc_source_checksum,
checksum_verify => $runc_source_checksum_verify,
extract => false,
cleanup => false,
cleanup => $archive_cleanup,
Copy link
Contributor

Choose a reason for hiding this comment

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

since this archive resource has extract => false, maybe this isn't needed?

@@ -469,7 +474,7 @@
extract => true,
extract_command => 'tar xfz %s --strip-components=1 -C /usr/bin/',
extract_path => '/',
cleanup => true,
cleanup => $archive_cleanup,
Copy link
Contributor

Choose a reason for hiding this comment

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

$containerd_archive_cleanup ?

@@ -494,7 +499,7 @@
extract => true,
extract_command => 'tar xfz %s --strip-components=1 -C /usr/local/bin/',
extract_path => '/usr/local/bin',
cleanup => true,
cleanup => $archive_cleanup,
Copy link
Contributor

Choose a reason for hiding this comment

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

$etc_archive_checksum_cleanup ?

Copy link
Contributor

@waipeng waipeng left a comment

Choose a reason for hiding this comment

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

@deric thanks for this! We are encountering the same issue.

I've made a few comments on the commit. In addition, I think we can do the following to determine the $_cleanup value

    if $containerd_archive_checksum and $containerd_archive_checksum =~ /.+/ {
      $containerd_archive_checksum_verify = true
      $containerd_archive_creates = undef
      $containerd_archive_cleanup = false
    }

what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants