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

[canonical-livepatch-onprem] Add Canonical Livepatch on-prem server support #3418

Merged
merged 1 commit into from
Nov 19, 2023
Merged

Conversation

adam-vest
Copy link
Contributor

Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message split over multiple lines and hard-wrapped at 72 characters?
  • Is the subject and message clear and concise?
  • Does the subject start with [plugin_name] if submitting a plugin patch or a [section_name] if part of the core sosreport code?
  • Does the commit contain a Signed-off-by: First Lastname [email protected]?
  • Are any related Issues or existing PRs properly referenced via a Closes (Issue) or Resolved (PR) line?

Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/sosreport-sos-3418
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.


def setup(self):
self.add_copy_spec([
"/etc/livepatchd.yaml",
Copy link
Member

Choose a reason for hiding this comment

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

lgtm, just a question: is there an api token or a user/pass we should obfuscate in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are both, actually - user credentials and a token that authenticates against upstream livepatch.. User password is already encoded, but perhaps not a bad idea to obfuscate. Is that something we'd do in the plugin directly, or elsewhere in sos?

Copy link
Member

Choose a reason for hiding this comment

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

You can do it directly in the plugin itself. Here's an example of obfuscation in a yaml file:

https://github.com/sosreport/sos/blob/main/sos/report/plugins/juju.py#L65

Copy link
Contributor Author

@adam-vest adam-vest Nov 16, 2023

Choose a reason for hiding this comment

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

Awesome, thanks for the link! I have some obfuscation code in now that looks like it's having the intended effect 🙂 I'll push once I get the simplification that Arif mentioned sorted out.

@arif-ali
Copy link
Member

if you added services = ("livepatch-server") for the trigger at the top instead of files, then both the service status and the journal would be added by default, and then you will not need the 2 status checks and files

@adam-vest
Copy link
Contributor Author

if you added services = ("livepatch-server") for the trigger at the top instead of files, then both the service status and the journal would be added by default, and then you will not need the 2 status checks and files

Hey @arif-ali , I tried doing the following as (I think you) suggested:

    services = ("livepatch-server")

    def setup(self):
        self.add_copy_spec([
            "/etc/livepatchd.yaml",
        ])

...but I didn't see the journal or service status in the resultant sos report? Normally these were appearing in sos_commands/canonical_livepatch_server. Is this new as of 4.6.0? I'm just testing against the version in apt, which is 4.5.6.

@TurboTurtle
Copy link
Member

if you added services = ("livepatch-server") for the trigger at the top instead of files, then both the service status and the journal would be added by default, and then you will not need the 2 status checks and files

Hey @arif-ali , I tried doing the following as (I think you) suggested:

    services = ("livepatch-server")

    def setup(self):
        self.add_copy_spec([
            "/etc/livepatchd.yaml",
        ])

...but I didn't see the journal or service status in the resultant sos report? Normally these were appearing in sos_commands/canonical_livepatch_server. Is this new as of 4.6.0? I'm just testing against the version in apt, which is 4.5.6.

You're missing a comma in services to make it a tuple, rather than a string. services = ('livepatch-server',) The implicit collection for services was definitely in 4.5, but I forget exactly when we added it.

@adam-vest
Copy link
Contributor Author

if you added services = ("livepatch-server") for the trigger at the top instead of files, then both the service status and the journal would be added by default, and then you will not need the 2 status checks and files

Hey @arif-ali , I tried doing the following as (I think you) suggested:

    services = ("livepatch-server")

    def setup(self):
        self.add_copy_spec([
            "/etc/livepatchd.yaml",
        ])

...but I didn't see the journal or service status in the resultant sos report? Normally these were appearing in sos_commands/canonical_livepatch_server. Is this new as of 4.6.0? I'm just testing against the version in apt, which is 4.5.6.

You're missing a comma in services to make it a tuple, rather than a string. services = ('livepatch-server',) The implicit collection for services was definitely in 4.5, but I forget exactly when we added it.

Awesome, got it! Thanks for the feedback - pushed an update to implement these things. Looking forward to any more feedback!

Copy link
Member

@TurboTurtle TurboTurtle left a comment

Choose a reason for hiding this comment

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

LGTM

Livepatch on-prem server support

Resolves: SET-382

Signed-off-by: Adam Vest <[email protected]>
@TurboTurtle TurboTurtle merged commit 13c8c25 into sosreport:main Nov 19, 2023
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants