-
Notifications
You must be signed in to change notification settings - Fork 66
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add lib to preflight #809
Add lib to preflight #809
Conversation
Hi @sebrandon1. Thanks for your PR. I'm waiting for a redhat-openshift-ecosystem member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
929fb63
to
fd8ff7f
Compare
1692109
to
c7b8663
Compare
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.
@sebrandon1 Thanks a ton for the work on pushing this forward! I've added a few review comments, but I'll definitely need to take another pass. Before I do - discussion points 猬囷笍
We briefly discussed this when we met, but I wanted to go ahead and capture it here publicly so that we can have folks comment/provide feedback.
I think what I'm looking to see here out of the gate is the ability to run CheckContainer(...)
and CheckOperator(...)
for starters.
The inputs are up for debate (my ideal would be just a context and maybe your image string), but the outputs here would be results, and somehow, log files where relevant (TBD, but I'm putting that aside for now).
The goal here would be to make sure that folks starting to consume preflight as a library don't have to go through the hurdles to set up the PreflightCheck configurations, etc.
To that end, I'm thinking (sorry @bcrochet) that we start by moving most of this lib work into a top-level internal
package, accessible by both cmd
and everything else, wire up CheckOperator
and CheckContainer
as callable functions/methods, and then if we need to pull more things out of this internal library, for your use case (and the use case of others), then we'd do that as well.
If we did that, though, we want to make sure that the exported functions are actually what you need to benefit from calling the Preflight library in your use cases. Does that sound like something that would work for you?
@sebrandon1 @acornett21 @bcrochet WDYT?
@komish Thanks for the review! Yes, actually what you propose makes a lot of sense by pushing some of that logic farther into the code and only getting two functions With my initial PoC approach I didn't want to change too much to get this working but this makes more sense for future-proofing the effort. Very exciting! |
@sebrandon1 for sure. I鈥檒l give some folks time to look and then we can chart the path to get this merged! |
@sebrandon1 I'll have you move |
@komish Sounds excellent! I'll do that right now. |
Okay in 7a84034 I moved the lib into a new "internal" folder in the top level and changed the references. |
The CI failure reports:
Given that's the only failure I see right at this moment, I think running this and committing the changes should fix the issue:
|
7a84034
to
50ea3fe
Compare
Okay fixed. I ran |
50ea3fe
to
8dd7fbc
Compare
8dd7fbc
to
5105ed2
Compare
Added on two commits to fix the coverage issues and fix a couple of case issues in comments for exported functions. Coverage issues were fixed by:
|
0d08e68 removes a duplicate bit of code and moves the test to the correct location. |
@sebrandon1 @bcrochet @acornett21 as I've made changes here, PTAL. |
@tkrishtop Just a heads up that it seems like this is a problem in the infrastructure's ability to RW files on the filesystem (permission denied) and doesn't seem related to the PR's changes at first glance. |
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've made changes so I'm removing my request for change and requesting reviews
@komish I think this addresses everything, the only thing we'd need is the commits squashed. |
0d08e68
to
f1a88e5
Compare
f1a88e5
to
1bc39fc
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: acornett21, bcrochet, sebrandon1 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Work in progress!
Related to:
This PR provides some changes needed to implement the
lib
. (Name is subject to change 馃槃)I want to go through some of the files to describe my notable changes:
certification/runtime/config.go
In this file, I added
NewManualContainerConfig
andNewManualOperatorConfig
for being able to create config objects geared towards their individual purposes.cmd/check_container.go and cmd/check_operator.go
These files have had their "NewOperator/Container" funcs moved to the lib.
fakes.go and types.go
Moved to the lib folder, because it contains funcs like
NewFakePyxisClientNoop
andNewNoopSubmitter
.The
NoopSubmitter
has had appropriate setters added.lib/check_container_test.go and cmd/check_container_test.go
I split these two files into files more geared towards their testing purposes. The
cmd
package one tests stuff that has to do with thecmd
package, for example.