-
Notifications
You must be signed in to change notification settings - Fork 18
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
Installationoutputs custom resource #246
Installationoutputs custom resource #246
Conversation
787fe4f
to
ea66afe
Compare
Codecov Report
@@ Coverage Diff @@
## main #246 +/- ##
==========================================
+ Coverage 71.75% 71.78% +0.02%
==========================================
Files 13 14 +1
Lines 2160 2162 +2
==========================================
+ Hits 1550 1552 +2
Misses 477 477
Partials 133 133
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
837e765
to
2619064
Compare
2619064
to
4723947
Compare
Signed-off-by: Troy Connor <[email protected]>
Signed-off-by: Troy Connor <[email protected]>
Signed-off-by: Troy Connor <[email protected]>
4723947
to
2d24d8f
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.
I had one suggestion, but otherwise lgtm!
|
||
// +kubebuilder:printcolumn:name="Porter Name",type="string",JSONPath=".spec.name" | ||
// +kubebuilder:printcolumn:name="Porter Namespace",type="string",JSONPath=".spec.namespace" | ||
// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" |
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.
Would you want to show the outputs with -o wide
? Might be nice to add the outputs field with a priority=1
.
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.
That's a good idea. I can update this and resolve when it's pushed.
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 don't believe that I can do this being that the column that would display the outputs would need to be able to handle the "array/slice" of "output". Currently the only supported fields are
integer – non-floating-point numbers
number – floating point numbers
string – strings
boolean – true or false
date – rendered differentially as time since this timestamp
I was thinking a list of strings comma separated would do but wouldn't be able to be surfaced from the kubebuilder directive.
Would the first output be sufficient?
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, I think you'd have to define another field where you format the string you'd want from the outputs, reconcile it each time, and have the print column reference the new field.
I don't think this should hold up this PR. I was just thinking about how it would feel using kubectl.
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.
If it's worth having for the user experience, the handling of that could be valuable for the user. That would be great to add in the WIP PR. I'm willing to add it there if it makes sense.
type InstallationOutputStatus struct {
Phase AgentPhase `json:"phase,omitempty"`
Conditions []metav1.Condition `json:"conditions,omitempty"`
Outputs []Output `json:"outputs,omitempty"`
OutputNames string `json:"outputNames, omitempty"` // <-- new field with priority=1 for wide output.
}
}
//logic in reconciler
//Something like this
names := []string{}
for _, name := range inst.Status.Outputs {
names = append(names, name.Name)
}
outputNames := strings.Join(names, ",")
// Add to install.Status, etc
```
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.
Added
- outputNames as a new field,
- scaffold CRD
- added the printercolumn to be priority 1.
kubectl get installationoutput -A
NAMESPACE NAME PORTER NAME PORTER NAMESPACE PHASE
default installationoutput-sample
kubectl get installationoutput -A -o wide
NAMESPACE NAME PORTER NAME PORTER NAMESPACE PHASE OUTPUT NAMES
default installationoutput-sample
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.
More realistic version of what is to be expected:
kubectl get installationoutput -A -o wide
NAMESPACE NAME PORTER NAME PORTER NAMESPACE PHASE OUTPUT NAMES
demo test-install-1691504789 test-install-1691504789 demo Succeeded outAction,outDelay,outExitStatus,outInsecureValue
Signed-off-by: Troy Connor <[email protected]>
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!
What does this change
Sets up work to be accomplished in #245 which will fully resolve #63.
This sets up the crd and the rbac associated with the new custom resource
installation outputs
What issue does it fix
Partially Closes #63
Notes for the reviewer
NOTE: Most of the work is being done in the draft PR from above. The PR was getting to big and decided to break it up.
Checklist