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

To add Informer for ServiceAccount #11330

Merged
merged 1 commit into from
Oct 20, 2016

Conversation

sdminonne
Copy link
Contributor

To fix #11159

@sdminonne
Copy link
Contributor Author

[test]

@mfojtik
Copy link
Contributor

mfojtik commented Oct 12, 2016

LGTM

@soltysh PTAL

@liggitt
Copy link
Contributor

liggitt commented Oct 12, 2016

should this go upstream in the SharedInformerFactory instead?

@deads2k
Copy link
Contributor

deads2k commented Oct 12, 2016

should this go upstream in the SharedInformerFactory instead?

Yes, but since we're running an entire release behind, I'd be ok having a very similar interface downstream until we get there.

@sdminonne
Copy link
Contributor Author

@liggitt @deads2k going to upstream a similar PR. Keeping this open. Thanks

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

Nits, mostly looks good.

return nil, err
}
if !exists {
return nil, kapierrors.NewNotFound(kapi.Resource("ServiceAccount"), name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Resource names are usually lowercased.

@@ -175,6 +176,10 @@ func (f *sharedInformerFactory) KubernetesInformers() informers.SharedInformerFa
return kubernetesSharedInformer{f}
}

func (f *sharedInformerFactory) ServiceAccounts() ServiceAccountInformer {
Copy link
Contributor

Choose a reason for hiding this comment

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

Add here todo, with a link to you upstream PR, so that we know we should use the upstream version upon next rebase (to 1.5).

// If the indexed list fails then we will fallback to listing from all namespaces and filter
// by the namespace we want.
func (s storeServiceAccountsNamespacer) List(selector labels.Selector) ([]*kapi.ServiceAccount, error) {
configs := []*kapi.ServiceAccount{}
Copy link
Contributor

Choose a reason for hiding this comment

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

s/configs/serviceAccounts/

},
informerObj,
s.defaultResync,
cache.Indexers{},
Copy link
Contributor

@0xmichalis 0xmichalis Oct 13, 2016

Choose a reason for hiding this comment

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

@liggitt should we use a namespace index?

Copy link
Contributor

Choose a reason for hiding this comment

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

@liggitt should we use a namespace index?

Yes, everywhere possible.

@sdminonne
Copy link
Contributor Author

Thanks, going to modify accordingly.

@sdminonne
Copy link
Contributor Author

PTAL

@0xmichalis
Copy link
Contributor

LGTM, squash and we can merge it

@sdminonne
Copy link
Contributor Author

@Kargakis sqashed

@sdminonne
Copy link
Contributor Author

[test]

@0xmichalis
Copy link
Contributor

Looking at #11159 it seems that you also need to plug the cache in the pspReview* rest

@sdminonne
Copy link
Contributor Author

@Kargakis sure. But I'd like to keep this PR as is and later on plug the cache where and if needed. I've already tested this PR plugging the code. If you prefer to put all together I can do anyway.
Let me know. Thanks

@0xmichalis
Copy link
Contributor

@sdminonne I am fine with merging this as is, but let's keep #11159 open until all the required work is done.

LGTM [merge]

@sdminonne
Copy link
Contributor Author

@Kargakis thanks

k8s-github-robot pushed a commit to kubernetes/kubernetes that referenced this pull request Oct 18, 2016
Automatic merge from submit-queue

To add service account informer

@deads2k  this PR adds ServiceAccount informer as discussed [here](openshift/origin#11330 (comment))
@sdminonne
Copy link
Contributor Author

@Kargakis what should I do for this? I tried to launch the same script and locally it's not failing (tested both golang 1.7 and 1.6).

@0xmichalis
Copy link
Contributor

continuous-integration/openshift-jenkins/merge Waiting: You are in the build queue at position: 12

@0xmichalis 0xmichalis closed this Oct 19, 2016
@0xmichalis 0xmichalis reopened this Oct 19, 2016
@0xmichalis
Copy link
Contributor

#11094 [test]

@0xmichalis
Copy link
Contributor

#11240 [test]

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to aa9efad

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/10246/) (Base Commit: ab7d5fe)

@soltysh
Copy link
Contributor

soltysh commented Oct 20, 2016

Flake #11240

[merge]

@soltysh
Copy link
Contributor

soltysh commented Oct 20, 2016

Flake #11004

[merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to aa9efad

@openshift-bot
Copy link
Contributor

openshift-bot commented Oct 20, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/10346/) (Base Commit: 1ec25ef) (Image: devenv-rhel7_5211)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ServiceAccounts should be cached in an informer
8 participants