-
Notifications
You must be signed in to change notification settings - Fork 544
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
Add CatalogSource Namespace to Subscription Objects #380
Conversation
// Operator represents a Kubernetes operator that executes InstallPlans by | ||
// resolving dependencies in a catalog. | ||
type Operator struct { | ||
*queueinformer.Operator | ||
client versioned.Interface | ||
namespace string | ||
sources map[string]registry.Source | ||
sources map[sourceKey]registry.Source |
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.
Use complex struct
which contains both name and namespace as map key (see https://play.golang.org/p/ngwKvwPggu5).
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.
👍 for compound keys
Why don't we make this backwards compatible by saying |
@ecordell That doesn't help the UI (or non-admin users) find the |
becf985
to
5a1140a
Compare
@ecordell Tests are passing, made it backwards compatible. |
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.
looks good! couple of small nitpicks
@@ -270,14 +275,14 @@ func (o *Operator) ResolvePlan(plan *v1alpha1.InstallPlan) error { | |||
var notFoundErr error | |||
for sourceName, source := range o.sources { |
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.
nit: for key, source
if notFoundErr != nil { | ||
continue | ||
} | ||
|
||
// Look up the CatalogSource. | ||
catsrc, err := o.client.CatalogsourceV1alpha1().CatalogSources(o.namespace).Get(sourceName, metav1.GetOptions{}) | ||
catsrc, err := o.client.CatalogsourceV1alpha1().CatalogSources(o.namespace).Get(sourceName.name, metav1.GetOptions{}) |
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.
should be CatalogSources(sourceName.namespace)
just in case?
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.
LGTM
Add CatalogSource Namespace to Subscription Objects
Add CatalogSource Namespace to Subscription Objects
Description
Makes it possible to find the contents of a
CatalogSource-v1
without needing permission to fetch in all namespaces.Fixes https://jira.coreos.com/browse/ALM-639