-
Notifications
You must be signed in to change notification settings - Fork 8
chore: implementing some unit tests #55
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
Conversation
847cb92 to
25707b4
Compare
danj-replicated
left a comment
There was a problem hiding this 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 👍
pkg/defaults/provider.go
Outdated
| // 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)) |
There was a problem hiding this comment.
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()
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ?
227103c to
07b6ee0
Compare
this commits covers defaults package with unit tests.
07b6ee0 to
9800962
Compare
* 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>
…-unmarshal just pass in the pointer
This is an ongoing effort. This PR implements unit tests for both
defaultsandsshpackages. As I move forward I will be opening new PRs for different packages.