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

Bug 1988351: OCM controller - periodically pull the data and update corresponding #375

Merged
merged 9 commits into from
Aug 2, 2021

Conversation

tremes
Copy link
Contributor

@tremes tremes commented Mar 16, 2021

secret

This adds a new OCM controller which periodically (each 8 hours) tries to pull the SCA (Simple content access) data from the OCM API. The SCA data (basically a x509 certificate) is exposed in the etc-pki-entitlement secret in the openshift-config-managed namespace.

Categories

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

Sample archive

No new data

Documentation

No update here

Unit Tests

Basic test covered in pkg/ocm/ocm_test.go

Privacy

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

Changelog

References

https://issues.redhat.com/browse/CCXDEV-4211

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 16, 2021
@openshift-ci-robot
Copy link
Contributor

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
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tremes

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-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 16, 2021
@tremes
Copy link
Contributor Author

tremes commented Apr 8, 2021

/test insights-operator-e2e-tests

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 11, 2021
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 12, 2021
@tremes
Copy link
Contributor Author

tremes commented Jun 25, 2021

/test insights-operator-e2e-tests

Copy link
Contributor

@natiiix natiiix left a comment

Choose a reason for hiding this comment

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

I don't see any serious issue here, so if this is the behaviour we want, then I think it's alright.

@tremes tremes changed the title WIP OCM controller - periodically pull the data and update corresponding OCM controller - periodically pull the data and update corresponding Jul 22, 2021
@tremes tremes marked this pull request as ready for review July 22, 2021 07:50
@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 Jul 22, 2021
@tremes
Copy link
Contributor Author

tremes commented Jul 22, 2021

Ohh I need to fix permissions for the secret in the openshift-config-managed namespace. Done

@@ -24,6 +24,11 @@ type Serialized struct {
Impersonate string `json:"impersonate"`
Gather []string `json:"gather"`
EnableGlobalObfuscation bool `json:"enableGlobalObfuscation"`
Ocm struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this defined as inline struct if you have this as full script on line 75? :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ohh good catch! Thank you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well hmmm...this is slightly different type than the OCMConfig (which is embedded in Controller type). I can delete the OCMConfig type and define the attributes directly in the Controller type....I guess I don't have any better idea right now.


const (
targetNamespaceName = "openshift-config-managed"
secretName = "etc-pki-entitlement" //nolint: gosec
Copy link
Contributor

Choose a reason for hiding this comment

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

is this operator owning this secret? what operator manage this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes ...I am not sure how the "ownership" is defined, but this secret is created/updated by the Insights Operator.

Copy link
Contributor

@natiiix natiiix left a comment

Choose a reason for hiding this comment

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

Obligatory "I have not tested it locally", but I see nothing objectively wrong with the code and the tests look good to me. I mostly looked at the changes since my last review and it all makes sense to me, as far as I'm aware of the relevant task.

@tremes tremes changed the title OCM controller - periodically pull the data and update corresponding Bug 1988351: OCM controller - periodically pull the data and update corresponding Jul 30, 2021
@openshift-ci
Copy link

openshift-ci bot commented Jul 30, 2021

@tremes: This pull request references Bugzilla bug 1988351, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

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

No GitHub users were found matching the public email listed for the QA contact in Bugzilla (dmisharo@redhat.com), skipping review request.

In response to this:

Bug 1988351: OCM controller - periodically pull the data and update corresponding

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.

@openshift-ci openshift-ci bot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Jul 30, 2021
Copy link
Contributor

@Serhii1011010 Serhii1011010 left a comment

Choose a reason for hiding this comment

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

looks great to me

Copy link
Contributor

@natiiix natiiix left a comment

Choose a reason for hiding this comment

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

I have reviewed this before and it should now be ready to be merged, so I'm giving it the real approval now. I have not tested this locally, or at least not recently, but I have checked the code again today and I see nothing worth arguing about.
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 2, 2021
@openshift-ci
Copy link

openshift-ci bot commented Aug 2, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: natiiix, Sergey1011010, tremes

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:
  • OWNERS [Sergey1011010,natiiix,tremes]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci openshift-ci bot merged commit 54354a4 into openshift:master Aug 2, 2021
@openshift-ci
Copy link

openshift-ci bot commented Aug 2, 2021

@tremes: All pull requests linked via external trackers have merged:

Bugzilla bug 1988351 has been moved to the MODIFIED state.

In response to this:

Bug 1988351: OCM controller - periodically pull the data and update corresponding

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.

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. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants