Skip to content
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

Merged

Conversation

AlexVulaj
Copy link
Contributor

Follow up to OSD-21667 - we no longer need the ability to provide custom mustgather images.

@openshift-ci openshift-ci bot requested review from bng0y and dustman9000 May 21, 2024 20:41
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 21, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 21, 2024

Codecov Report

Attention: Patch coverage is 63.63636% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 10.67%. Comparing base (2dab348) to head (b09d0ce).

Additional details and impacted files

Impacted file tree graph

@@            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     
Files Coverage Δ
api/v1alpha1/mustgather_types.go 33.33% <ø> (ø)
controllers/mustgather/mustgather_controller.go 12.66% <63.63%> (+2.90%) ⬆️

@AlexVulaj
Copy link
Contributor Author

/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.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 21, 2024
@AlexVulaj AlexVulaj force-pushed the remove-mustgather-images branch 2 times, most recently from 99ab334 to 72ba0a3 Compare May 21, 2024 21:01
@AlexVulaj
Copy link
Contributor Author

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 22, 2024
Copy link
Contributor

@mjlshen mjlshen left a 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

build/templates/job.template.yaml Outdated Show resolved Hide resolved
@AlexVulaj AlexVulaj force-pushed the remove-mustgather-images branch 2 times, most recently from f01b6a4 to 9ce97b6 Compare May 28, 2024 21:01
Copy link
Contributor

@mjlshen mjlshen left a 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, ".")]
Copy link
Contributor

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.

Comment on lines 388 to 409
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
}
Copy link
Contributor

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

build/templates/job.template.yaml Show resolved Hide resolved
@AlexVulaj AlexVulaj force-pushed the remove-mustgather-images branch 2 times, most recently from 0251fbb to 50a7bc4 Compare May 31, 2024 19:45
Copy link
Contributor

@mjlshen mjlshen left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 31, 2024
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 2dab348 and 2 for PR HEAD 50a7bc4 in total

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 3, 2024
@AlexVulaj AlexVulaj force-pushed the remove-mustgather-images branch from 254b7a6 to b09d0ce Compare June 3, 2024 13:25
Copy link
Contributor

openshift-ci bot commented Jun 3, 2024

@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.

Copy link
Contributor

@mjlshen mjlshen left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 3, 2024
Copy link
Contributor

openshift-ci bot commented Jun 3, 2024

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit b7816d7 into openshift:master Jun 3, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants