Skip to content

Puppet produces invalid list of sources that it cannot correct anymore #1133

@XSpielinbox

Description

@XSpielinbox

Describe the Bug

Leaving out the repos in an apt::source definition results in a main component being added implicitly. This however can result in an invalid apt-source when the release is /:
When there is apt-source with the content like deb https://pkgs.k8s.io/core:/stable:/v1.28/deb / main, this is invalid (absolute Suite Component).
When now working around this by defining

release => '/',
repos    => '',

this however still results in an error like the following:

Error: Could not prefetch package provider 'apt': Execution of '/usr/bin/apt-mark showmanual' returned 100: E: Malformed entry 3 in list file /etc/apt/sources.list.d/kubernetes.list (absolute Suite Component)
E: The list of sources could not be read.
Error: Failed to apply catalog: Execution of '/usr/bin/apt-mark showmanual' returned 100: E: Malformed entry 3 in list file /etc/apt/sources.list.d/kubernetes.list (absolute Suite Component)
E: The list of sources could not be read.

So puppet was able to successfully add the main component to the source but is unable to remove it again. One has to manually edit the corresponding source entry to something different before puppet will change it again.

Expected Behavior

Puppet is in all cases able to correct the error in an apt source definition.

Steps to Reproduce

Steps to reproduce the behavior:

  1. run puppet agent -t with an apt::source, that does not specify repos. // alternatively add it manually to the source
  2. change the apt::source to a repos ''.
  3. try to rerun puppet agent -t

Environment

  • Version 9.0.2
  • Platform: tested on Ubuntu 20.04 (should be the same on all other version of Ubuntu and Debian)

Additional Context

This makes it impossible to workaround the issue, that Puppet enforces to specify a repos (components), even though they are optional in an apt source. see #1132

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions