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

WIP Subscription CatalogSource Status #818

Closed
wants to merge 3 commits into from

Conversation

njhale
Copy link
Member

@njhale njhale commented Apr 17, 2019

Part 1 of 2 in a pair of PRs aimed at surfacing better Subscription status.

@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 Apr 17, 2019
@openshift-ci-robot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 17, 2019
var _ references.ObjectReferencerFunc = ObjectReferenceFor

// ObjectReferenceFor generates an ObjectReference for the given resource if it's provided by the operators.coreos.com API group.
func ObjectReferenceFor(obj interface{}) (*corev1.ObjectReference, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

I had assumed a util like this existed, but my searching over kubernetes/kubernetes didn't pick it up. Is there a canonical reference for useful kube utils that I'm missing???

}

// Zero-out so started will be GC'd since this goroutine will live for a while
started = nil
Copy link
Member

Choose a reason for hiding this comment

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

alternative would be to put this in a scoped block, e.g:

o.Log.Info("starting informers...")
{
  started := make(map[cache.SharedIndexInformer]struct{})

  // start informers
}
o.Log.Info()

nbd though

// or the status has changed and returns true if the status was set; false otherwise.
func (status *SubscriptionStatus) SetSubscriptionCatalogStatus(catalogStatus SubscriptionCatalogStatus) bool {
target := catalogStatus.CatalogSourceRef
if target == nil && target.APIVersion == SchemeGroupVersion.String() && target.Kind == SubscriptionKind {
Copy link
Member

Choose a reason for hiding this comment

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

why are we checking the kind of the catalogsourceref? shouldn't it always be catalogsource?

or rather, shouldn't this check for kind != CatalogSourceKind?

op.subQueue = subscriptionQueue
for _, informer := range subscriptionQueueInformers {

// Register the QueueInformer for SubscriptionStatus.CatalogStatus
Copy link
Member

Choose a reason for hiding this comment

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

nit - this comment doesn't seem right

// NewFakeOperator creates a new operator using fake clients
func NewFakeOperator(clientObjs []runtime.Object, k8sObjs []runtime.Object, extObjs []runtime.Object, regObjs []runtime.Object, namespace string, stopCh <-chan struct{}) (*Operator, []cache.InformerSynced, error) {
// NewFakeOperator creates a new operator using fake clients.
func NewFakeOperator(clientObjs []runtime.Object, k8sObjs []runtime.Object, extObjs []runtime.Object, regObjs []runtime.Object, operatorNamespace string, namespaces []string, stopCh <-chan struct{}) (*Operator, error) {
Copy link
Member

Choose a reason for hiding this comment

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

the namespace to operatorNamespace change is confusing - in other parts of the tests we use namespace to refer to the namespace that OLM is running in and operatorNamespace to refer to the namespace that OLM is watching.

i.e. if we change it here we should change it everywhere to be consistent

njhale added 2 commits April 17, 2019 18:45
- Add ObjectReferencer interface
- Add ObjectReferencer for OLM types
- Remove cyclic dependencies between OLM type packages
@njhale njhale force-pushed the sub-catsrc-status branch from 8f1a146 to 5afe09b Compare April 17, 2019 23:00
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 17, 2019
@njhale njhale force-pushed the sub-catsrc-status branch from 5afe09b to 70cc503 Compare April 18, 2019 01:11
@openshift-ci-robot
Copy link
Collaborator

@njhale: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-aws-olm 70cc503 link /test e2e-aws-olm
ci/prow/e2e-aws 70cc503 link /test e2e-aws

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@njhale
Copy link
Member Author

njhale commented Apr 19, 2019

Closing out in favor of starting with #820

@njhale njhale closed this Apr 19, 2019
@njhale njhale deleted the sub-catsrc-status branch September 30, 2019 21:36
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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants