-
Notifications
You must be signed in to change notification settings - Fork 46
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
remove ability to pass in custom mustgather images #135
remove ability to pass in custom mustgather images #135
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #135 +/- ##
==========================================
+ Coverage 8.36% 10.67% +2.31%
==========================================
Files 4 4
Lines 275 281 +6
==========================================
+ Hits 23 30 +7
Misses 248 248
+ Partials 4 3 -1
|
/hold I haven't been able to test this yet with the proxy outage for backplane access, but the code changes should still be reviewable at this time. |
99ab334
to
72ba0a3
Compare
/unhold |
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.
Looks good overall, added a comment for consideration, not sure if we need it
f01b6a4
to
9ce97b6
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.
Looks a lot better, thanks for getting the version of the image that is the same as the cluster's version.
- Two requests around how we are getting the clusterversion that I think are important to address.
- I could be convinced around removing the existing
backOffLimit
value and am just asking out of curiosity.
return "", goerror.New("unable to determine cluster version from status history") | ||
} | ||
|
||
version = version[:strings.LastIndex(version, ".")] |
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.
Can we unit test this function? Small edge case, but I think this doesn't work when the version is something like 4.14.0-rc.0
You can use https://github.com/openshift/managed-cluster-validating-webhooks/blob/f0862cb7bf1869b00e1ab857ee08fcf6fc7f156c/pkg/webhooks/podimagespec/podimagespec_test.go as an example if you haven't setup a fake kube client before.
func (r *MustGatherReconciler) getClusterVersionForJobTemplate(name string) (string, error) { | ||
clusterVersion := &configv1.ClusterVersion{} | ||
err := r.GetClient().Get(context.TODO(), types.NamespacedName{Name: name}, clusterVersion) | ||
if err != nil { | ||
return "", fmt.Errorf("unable to get clusterversion '%v': %w", name, err) | ||
} | ||
|
||
var version string | ||
for _, history := range clusterVersion.Status.History { | ||
if history.State == "Completed" { | ||
version = history.Version | ||
break | ||
} | ||
} | ||
if version == "" { | ||
return "", goerror.New("unable to determine cluster version from status history") | ||
} | ||
|
||
version = version[:strings.LastIndex(version, ".")] | ||
|
||
return version, nil | ||
} |
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.
Make sure to add RBAC so that the operator is able to get config.openshift.io/clusterversion
objects https://github.com/openshift/must-gather-operator/blob/master/deploy/02_must-gather-operator.ClusterRole.yaml
0251fbb
to
50a7bc4
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
254b7a6
to
b09d0ce
Compare
@AlexVulaj: all tests passed! Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
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: AlexVulaj, mjlshen 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 |
Follow up to OSD-21667 - we no longer need the ability to provide custom mustgather images.