Skip to content

PRODENG-2480 Launchpad reset now cleans the lingering MCR files#404

Merged
dimitarbytes merged 1 commit into
Mirantis:masterfrom
dimitarbytes:2480-launchpad-reset
Feb 5, 2024
Merged

PRODENG-2480 Launchpad reset now cleans the lingering MCR files#404
dimitarbytes merged 1 commit into
Mirantis:masterfrom
dimitarbytes:2480-launchpad-reset

Conversation

@dimitarbytes
Copy link
Copy Markdown
Contributor

@dimitarbytes dimitarbytes commented Jan 22, 2024

  • Created CleanupLingerMCR files function for both Linux and Windows Configurer
  • We can do launchpad reset even when docker is malformed or not correctly installed
  • Created a common.go file which contains Common Configurer logic

https://mirantis.jira.com/browse/PRODENG-2480

@dimitarbytes
Copy link
Copy Markdown
Contributor Author

Tested on both Ubuntu20 and rhel9.3 alongside Windows2019.
Uploading Screenshot 2024-01-25 at 3.04.55 PM.png…

Comment thread pkg/configurer/common.go Outdated
"github.com/k0sproject/rig/os"
)

type CommonConfigurer struct{}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please rename this to DockerConfigurer (and change file name as well.) When using Composition, you should target your implementations when possible, instead of letting them grow large. The risk for large Composition bases is unneeded complexity, while the strength is atomicity and isolation.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You could also consider importing the new configurer directly into the LinuxConfigurator parent, but I think it is not necessarily a good idea.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is imported directly into both LinuxConfigurator and WindowsConfigurator

var err error
info, getDockerError := c.GetDockerInfo(h, c.Kind())
if getDockerError == nil {
if err = h.Exec("sudo docker system prune -f"); err != nil {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should we put this into engineConfig.Prune control? Not required for this change, but it might be easy.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's a good point. I don't think we need to include it in this PR, but we might want to have a separate PR.

Comment thread pkg/configurer/sles/sles.go
Comment thread pkg/configurer/sles/sles.go
@james-nesbitt
Copy link
Copy Markdown
Collaborator

@cranzy can you confirm what you tested? the image doesn't work. Did you test positive and negative prune flags?

@dimitarbytes
Copy link
Copy Markdown
Contributor Author

@cranzy can you confirm what you tested? the image doesn't work. Did you test positive and negative prune flags?

I do confirm the image worked when I tested it both with launchpad apply and launchpad reset

Signed-off-by: Dimitar Dimitrov <ddimitrov@mirantis.com>
@dimitarbytes dimitarbytes merged commit e8ca605 into Mirantis:master Feb 5, 2024
@dimitarbytes dimitarbytes deleted the 2480-launchpad-reset branch February 5, 2024 17:14
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.

2 participants