Skip to content

Conversation

@katushiik11
Copy link
Contributor

@katushiik11 katushiik11 commented Oct 13, 2025

This PR implements a fix, so that lastReportTime field of clusteroperator.insights should be updated accordingly.

Categories

  • Bugfix
  • Data Enhancement
  • Feature
  • Backporting
  • Others (CI, Infrastructure, Documentation)

Sample Archive

None

Documentation

None

Unit Tests

  • pkg/insights/insightsuploader/insightsuploader_test.go

Privacy

Yes. There are no sensitive data in the newly collected information.

Changelog

No

Breaking Changes

No

References

https://issues.redhat.com/browse/OCPBUGS-60043

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 13, 2025
@openshift-ci
Copy link

openshift-ci bot commented Oct 13, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Oct 13, 2025
@openshift-ci-robot
Copy link
Contributor

@katushiik11: This pull request references Jira Issue OCPBUGS-60043, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

This PR implements a fix, so that lastReportTime field of clusteroperator.insights should be updated accordingly.

Categories

  • Bugfix
  • Data Enhancement
  • Feature
  • Backporting
  • Others (CI, Infrastructure, Documentation)

Sample Archive

  • path/to/sample_data.json

Documentation

  • path/to/documentation.md

Unit Tests

  • path/to/file_test.go

Privacy

Yes. There are no sensitive data in the newly collected information.

Changelog

Breaking Changes

Yes/No

References

https://issues.redhat.com/browse/OCPBUGS-60043

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 13, 2025
@katushiik11
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Oct 13, 2025
@openshift-ci-robot
Copy link
Contributor

@katushiik11: This pull request references Jira Issue OCPBUGS-60043, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @BaiyangZhou

Details

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested a review from BaiyangZhou October 13, 2025 16:06
@opokornyy
Copy link
Contributor

/test all

Copy link
Contributor

@opokornyy opokornyy left a comment

Choose a reason for hiding this comment

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

Please also add the update of gather cluster role with required permissions to update the status field. Also please add some unit tests where possible.

Comment on lines 533 to 536
_, err = client.ClusterOperators().UpdateStatus(ctx, insightsCo, metav1.UpdateOptions{})

klog.Infof("successfully updated LastReportTime to %s", reported.LastReportTime)
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid logging success message when the update failed and we are returning an error

Suggested change
_, err = client.ClusterOperators().UpdateStatus(ctx, insightsCo, metav1.UpdateOptions{})
klog.Infof("successfully updated LastReportTime to %s", reported.LastReportTime)
return err
_, err = client.ClusterOperators().UpdateStatus(ctx, insightsCo, metav1.UpdateOptions{})
if err != nil {
klog.Errorf("failed updating the clusteroperator status: %v", err)
return err
}
klog.Infof("successfully updated LastReportTime to %s", reported.LastReportTime)
return nil

Comment on lines 281 to 283
if err := updateClusterOperatorLastReportTime(ctx, configClient.ConfigV1()); err != nil {
klog.Errorf("Failed to update ClusterOperator lastReportTime: %v", err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should move this closer to the actual upload of report. So imo we should do it in the pkg/insights/insightsuploader/insightsuploader.go Upload function.

if err != nil {
return fmt.Errorf("unable to marshal status extension: %v", err)
}
insightsCo.Status.Extension.Raw = data
Copy link
Contributor

Choose a reason for hiding this comment

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

This will override all data in Status.Extension. Please verify we're not writing anything else there besides LastReportTime

@openshift-ci-robot
Copy link
Contributor

@katushiik11: This pull request references Jira Issue OCPBUGS-60043, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @BaiyangZhou

Details

In response to this:

This PR implements a fix, so that lastReportTime field of clusteroperator.insights should be updated accordingly.

Categories

  • Bugfix
  • Data Enhancement
  • Feature
  • Backporting
  • Others (CI, Infrastructure, Documentation)

Sample Archive

None

Documentation

  • path/to/documentation.md

Unit Tests

  • path/to/file_test.go

Privacy

Yes. There are no sensitive data in the newly collected information.

Changelog

No

Breaking Changes

No

References

https://issues.redhat.com/browse/OCPBUGS-60043

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 openshift-eng/jira-lifecycle-plugin repository.

klog.Infof("Uploaded report successfully in %s", time.Since(start))

// Update LastReportTime after successful upload
updateClusterOperatorLastReportTime(ctx, configClient)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should keep the error handling as it was in the gather_commands.go and log the error returned from this function.

Comment on lines 275 to 279
_, err = client.ClusterOperators().UpdateStatus(ctx, insightsCo, metav1.UpdateOptions{})

if err != nil {
klog.Errorf("Failed to update LastReportTime: %v", err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

if _, err := client.ClusterOperators().UpdateStatus(ctx, insightsCo, metav1.UpdateOptions{}); err != nil {
	return err
}

@katushiik11 katushiik11 marked this pull request as ready for review October 23, 2025 10:29
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 23, 2025
@openshift-ci openshift-ci bot requested a review from ncaak October 23, 2025 10:29
@opokornyy
Copy link
Contributor

@BaiyangZhou do you want to add integration test for this functionality?

Copy link
Contributor

@ncaak ncaak 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 Oct 23, 2025
@openshift-ci
Copy link

openshift-ci bot commented Oct 23, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: katushiik11, ncaak

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@opokornyy
Copy link
Contributor

/retest

@openshift-ci
Copy link

openshift-ci bot commented Oct 24, 2025

@katushiik11: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-e2e-aws-ovn 90438d2 link false /test okd-scos-e2e-aws-ovn
ci/prow/insights-operator-e2e-tests 90438d2 link true /test insights-operator-e2e-tests

Full PR test history. Your PR dashboard.

Details

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.

@opokornyy
Copy link
Contributor

We will probably need to update our CRD API first in order to address this issue.

/hold

@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 Nov 4, 2025
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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. 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