-
Notifications
You must be signed in to change notification settings - Fork 546
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
Rewrite Namespace when Fetching Global PackageManifests #513
Rewrite Namespace when Fetching Global PackageManifests #513
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good.
/approve
/lgtm
@@ -248,6 +248,7 @@ func (m *InMemoryProvider) Get(namespace, name string) (*packagev1alpha1.Package | |||
|
|||
for key, pm := range m.manifests { | |||
if key.packageName == name && (key.catalogSourceNamespace == namespace || key.catalogSourceNamespace == m.globalNamespace) { | |||
pm.SetNamespace(namespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The one thing that I think could become a problem in the future is when we have multiple packages of the same name in both the "global" and request namespace. In that situation you would have a 50% chance of getting the "global" package instead of the one you actually requested. Maybe for a get of an individual resource, you should only get the "global" package if no package of the same name exists in the requested namespace.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: njhale 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 |
Rewrite Namespace when Fetching Global PackageManifests
Description
Ensures that all the the
PackageManifests
returned have the samemetadata.namespace
value.Fixes https://jira.coreos.com/browse/ALM-752