Skip to content

Bug 1832232: Gather image registry config#100

Merged
openshift-merge-robot merged 2 commits intoopenshift:masterfrom
mfojtik:collect-image-registry
May 11, 2020
Merged

Bug 1832232: Gather image registry config#100
openshift-merge-robot merged 2 commits intoopenshift:masterfrom
mfojtik:collect-image-registry

Conversation

@mfojtik
Copy link
Copy Markdown
Contributor

@mfojtik mfojtik commented May 5, 2020

The config is valuable as we can drive deprecation of some fields inside it, but also valuable to get insights into how image registry is configured in clusters.

/cc @bparees @dmage

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 5, 2020
@bparees
Copy link
Copy Markdown

bparees commented May 5, 2020

images is more about the external registries they are using. we probably also want configs.imageregistry.operator.openshift.io which is the operator config resource for how the internal registry is configured (e.g. what storage it uses) if we're not already getting that somehow.

@mfojtik
Copy link
Copy Markdown
Contributor Author

mfojtik commented May 5, 2020

@bparees where is the client/api for that resource?

Comment thread pkg/gather/clusterconfig/clusterconfig.go
Comment thread pkg/gather/clusterconfig/clusterconfig.go
@bparees
Copy link
Copy Markdown

bparees commented May 5, 2020

@dmage
Copy link
Copy Markdown

dmage commented May 5, 2020

@mfojtik you have a typo in the commit message, you grab config.imageregistry.operator.openshift.io/cluster

@mfojtik mfojtik force-pushed the collect-image-registry branch from 6b761dd to 5e29518 Compare May 5, 2020 13:59
@mfojtik
Copy link
Copy Markdown
Contributor Author

mfojtik commented May 5, 2020

@dmage fixed

@dmage
Copy link
Copy Markdown

dmage commented May 5, 2020

/lgtm

@mfojtik
Copy link
Copy Markdown
Contributor Author

mfojtik commented May 5, 2020

/hold

for CCX team approval

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 5, 2020
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 5, 2020
@iNecas
Copy link
Copy Markdown
Contributor

iNecas commented May 5, 2020

Going to play a bad 👮‍♂️ here, but mind adding some tests to https://github.com/openshift/insights-operator/blob/master/pkg/gather/clusterconfig/clusterconfig_test.go, having some example input and anonymized output would make me sleep better at night :)

@martinkunc
Copy link
Copy Markdown
Contributor

@mfojtik Could you you please add a bugzilla case to know to which versions it would have to be backported ?


// Marshal implements serialization of Ingres.Spec.Domain with anonymization
func (a ImageRegistryAnonymizer) Marshal(_ context.Context) ([]byte, error) {
a.Spec.HTTPSecret = anonymizeString(a.Spec.HTTPSecret)
Copy link
Copy Markdown
Contributor

@martinkunc martinkunc May 6, 2020

Choose a reason for hiding this comment

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

What if we would just remove all Storage ? Can here be any other types, like pvc ?
And what about HttpSecret, is it something to remove as well ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If we remove Storage, we won't be able to know if someone uses a storage parameter.

@mfojtik mfojtik changed the title Gather image registry config Bug 1832232: Gather image registry config May 6, 2020
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels May 6, 2020
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@mfojtik: This pull request references Bugzilla bug 1832232, which is invalid:

  • expected the bug to target the "4.5.0" release, but it targets "---" instead

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

Details

In response to this:

Bug 1832232: Gather image registry config

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.

@mfojtik
Copy link
Copy Markdown
Contributor Author

mfojtik commented May 6, 2020

@martinkunc I expect this to be backported to 4.4 at least.

@mfojtik mfojtik force-pushed the collect-image-registry branch from 5e29518 to bb51e9d Compare May 6, 2020 11:57
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label May 6, 2020
@mfojtik
Copy link
Copy Markdown
Contributor Author

mfojtik commented May 6, 2020

@iNecas test pushed. PTAL.

@mfojtik
Copy link
Copy Markdown
Contributor Author

mfojtik commented May 6, 2020

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label May 6, 2020
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@mfojtik: This pull request references Bugzilla bug 1832232, 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.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)
Details

In response to this:

/bugzilla 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 kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot removed the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label May 6, 2020
},
},
evalOutput: func(t *testing.T, obj *imageregistryv1.Config) {
if obj.Spec.Storage.GCS.Bucket == "foo" {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/foo/bucket, or maybe just checking it contains noething but /x*/ would be better (and reusable for all keys to prevent this kind of copy/paste problems)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it does not matter :-) this just checks the Bucket value was modified by anonymyzer.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And if you read it carefully, you will find this test actually would catch even if the anonymizer was not there, becuase the strings are different (foo vs. bucket)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated

@mfojtik mfojtik force-pushed the collect-image-registry branch 2 times, most recently from ae8d271 to dc3dff6 Compare May 11, 2020 12:13
@mfojtik
Copy link
Copy Markdown
Contributor Author

mfojtik commented May 11, 2020

@iNecas @martinkunc all updated, are we fine here?

@iNecas
Copy link
Copy Markdown
Contributor

iNecas commented May 11, 2020

Letting @martinkunc to have the final word, but not other comments from me. Thanks

}
}

// GatherClusterImageRegistry fetches the cluster Image Registry configuration
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please also run make gen-doc ? That should update the doc/gathered-data.md with this new method.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@mfojtik mfojtik force-pushed the collect-image-registry branch from dc3dff6 to 79019f7 Compare May 11, 2020 12:55
)

func init() {
utilruntime.Must(registryv1.AddToScheme(registryScheme))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is is neccessary to register the registryv1 explicitly ? I would think it would be registered automatically by importing the package, like it is happening with openshift/kubernetes types. Or am I missing something ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it is always better to make your own local scheme than poisoning or depending on some "automatic" behavior...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is is neccessary to register the registryv1 explicitly ? I would think it would be registered automatically by importing the package, like it is happening with openshift/kubernetes types. Or am I missing something ?

Automatic registration is a bug, not a feature because it assumes a single unified scheme. As we evolved our API, we developed disjoint schemes focused on their individual purposes. This improves reliability because it avoids action at a distance. It is more appropriate to install the types you're using in a local scheme like this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok, nice, thanks for the explanation both !

@martinkunc
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 11, 2020
@martinkunc
Copy link
Copy Markdown
Contributor

/approve

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dmage, martinkunc, mfojtik

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

@mfojtik
Copy link
Copy Markdown
Contributor Author

mfojtik commented May 11, 2020

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 11, 2020
@openshift-merge-robot openshift-merge-robot merged commit 66179bb into openshift:master May 11, 2020
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@mfojtik: All pull requests linked via external trackers have merged: openshift/insights-operator#100. Bugzilla bug 1832232 has been moved to the MODIFIED state.

Details

In response to this:

Bug 1832232: Gather image registry config

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.

@mfojtik
Copy link
Copy Markdown
Contributor Author

mfojtik commented May 11, 2020

/cherrypick release-4.4

@openshift-cherrypick-robot
Copy link
Copy Markdown

@mfojtik: #100 failed to apply on top of branch "release-4.4":

error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
M	vendor/modules.txt
Falling back to patching base and 3-way merge...
Auto-merging vendor/modules.txt
CONFLICT (content): Merge conflict in vendor/modules.txt
Patch failed at 0001 bump(*): get openshift/client-go for image registry

Details

In response to this:

/cherrypick release-4.4

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.

9 participants