Bug 1832232: Gather image registry config#100
Bug 1832232: Gather image registry config#100openshift-merge-robot merged 2 commits intoopenshift:masterfrom
Conversation
|
images is more about the external registries they are using. we probably also want |
|
@bparees where is the client/api for that resource? |
https://github.com/openshift/api/blob/master/imageregistry/v1/types.go |
|
@mfojtik you have a typo in the commit message, you grab config.imageregistry.operator.openshift.io/cluster |
6b761dd to
5e29518
Compare
|
@dmage fixed |
|
/lgtm |
|
/hold for CCX team approval |
|
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 :) |
|
@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) |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
If we remove Storage, we won't be able to know if someone uses a storage parameter.
|
@mfojtik: This pull request references Bugzilla bug 1832232, which is invalid:
Comment DetailsIn response to this:
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. |
|
@martinkunc I expect this to be backported to 4.4 at least. |
5e29518 to
bb51e9d
Compare
|
@iNecas test pushed. PTAL. |
|
/bugzilla refresh |
|
@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
DetailsIn response to this:
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. |
| }, | ||
| }, | ||
| evalOutput: func(t *testing.T, obj *imageregistryv1.Config) { | ||
| if obj.Spec.Storage.GCS.Bucket == "foo" { |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
it does not matter :-) this just checks the Bucket value was modified by anonymyzer.
There was a problem hiding this comment.
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)
ae8d271 to
dc3dff6
Compare
|
@iNecas @martinkunc all updated, are we fine here? |
|
Letting @martinkunc to have the final word, but not other comments from me. Thanks |
| } | ||
| } | ||
|
|
||
| // GatherClusterImageRegistry fetches the cluster Image Registry configuration |
There was a problem hiding this comment.
Could you please also run make gen-doc ? That should update the doc/gathered-data.md with this new method.
dc3dff6 to
79019f7
Compare
| ) | ||
|
|
||
| func init() { | ||
| utilruntime.Must(registryv1.AddToScheme(registryScheme)) |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
it is always better to make your own local scheme than poisoning or depending on some "automatic" behavior...
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Ok, nice, thanks for the explanation both !
|
/lgtm |
|
/approve |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/hold cancel |
|
@mfojtik: All pull requests linked via external trackers have merged: openshift/insights-operator#100. Bugzilla bug 1832232 has been moved to the MODIFIED state. DetailsIn response to this:
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. |
|
/cherrypick release-4.4 |
|
@mfojtik: #100 failed to apply on top of branch "release-4.4": DetailsIn response to this:
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. |
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