Skip to content

Conversation

@ricardomaraschini
Copy link
Contributor

This is an ongoing effort. This PR implements unit tests for both defaults and ssh packages. As I move forward I will be opening new PRs for different packages.

Copy link
Contributor

@danj-replicated danj-replicated left a comment

Choose a reason for hiding this comment

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

aside from a few issues with the UX of using panic for fatal errors, looks good 👍

// Init makes sure all the necessary directory exists on the system.
func (d *DefaultsProvider) Init() {
if err := os.MkdirAll(d.K0sctlBinsSubDir(), 0755); err != nil {
panic(fmt.Errorf("unable to create basedir: %w", err))
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a massive fan of using panic() like this when an end user is going to be seeing the messages. it's nicer to use something like logrus.Fatalf()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that makes sense. Let me refactor that to replace the calls by logrus.Fatalf.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@danj-replicated solved, can you please take a look ?

@ricardomaraschini ricardomaraschini merged commit 36e9d72 into main Sep 6, 2023
@ricardomaraschini ricardomaraschini deleted the unit-tests branch September 6, 2023 08:38
emosbaugh pushed a commit that referenced this pull request Aug 26, 2024
* merge addon configs from release metadata into clusterconfig

* use real github url for release metadata

* use real version from metadata

* mod tidy

* trailing newline

* move k0s scheme to init

* don't error if there's no release config

* refactor chart merging

* refactor chart merging

* remove pointless yaml module and add test for MergeValues

* remove TODO

* write basic addon state to installer status

* handle no config in installation object

* manifests

* wait for nodes to be ready

* format

* actually wait for nodes

* no

* update installation status

* actually work

* remove todo

* use bool not int

* remove unused function

* tidy whitespace

* Update controllers/installation_controller_test.go

Co-authored-by: Andrew Lavery <laverya@umich.edu>

* fmt

---------

Co-authored-by: Andrew Lavery <laverya@umich.edu>
emosbaugh pushed a commit that referenced this pull request Aug 30, 2024
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