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

recreate generated service cert secret when deleted #12853

Merged
merged 1 commit into from
Feb 8, 2017

Conversation

mfojtik
Copy link
Contributor

@mfojtik mfojtik commented Feb 7, 2017

Fixes: #12834

@mfojtik
Copy link
Contributor Author

mfojtik commented Feb 7, 2017

@deads2k PTAL

@mfojtik
Copy link
Contributor Author

mfojtik commented Feb 7, 2017

[test]

@@ -116,6 +139,11 @@ func NewServiceServingCertController(serviceClient kcoreclient.ServicesGetter, s
func (sc *ServiceServingCertController) Run(workers int, stopCh <-chan struct{}) {
defer utilruntime.HandleCrash()
go sc.serviceController.Run(stopCh)
go sc.secretController.Run(stopCh)
if !waitForCacheSync(stopCh, sc.serviceHasSynced, sc.secretHasSynced) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deads2k any reason you did not waited for the caches to sync before?

Copy link
Contributor

Choose a reason for hiding this comment

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

@deads2k any reason you did not waited for the caches to sync before?

Things would self-settle since the first mutation would fail until the cache updated and the services aren't self referential.

return false
}
if getNumFailures(service) >= sc.maxRetries {
return false
}
if _, exists, _ := sc.secretCache.GetByKey(service.Namespace + "/" + secretName); !exists {
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a TODO to use a lister

@@ -125,6 +153,27 @@ func (sc *ServiceServingCertController) Run(workers int, stopCh <-chan struct{})
sc.queue.ShutDown()
}

func (sc *ServiceServingCertController) recreateServiceSecret(obj interface{}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer deleteSecret with a comment explaining what its checking.

@deads2k
Copy link
Contributor

deads2k commented Feb 7, 2017

nits and it needs a test. lgtm otherwise.

@mfojtik
Copy link
Contributor Author

mfojtik commented Feb 7, 2017

@deads2k all fixed, thanks :-)

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 5358689

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/13682/) (Base Commit: bcddac6)

@mfojtik
Copy link
Contributor Author

mfojtik commented Feb 8, 2017

[merge]

@openshift-bot
Copy link
Contributor

openshift-bot commented Feb 8, 2017

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/13682/) (Image: devenv-rhel7_5877)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 5358689

@openshift-bot openshift-bot merged commit 44c5172 into openshift:master Feb 8, 2017
@mfojtik mfojtik deleted the fix-secret-regen branch September 5, 2018 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants