Skip to content

Commit

Permalink
Merge pull request #20015 from mfojtik/dockercfg
Browse files Browse the repository at this point in the history
serviceaccounts: do not manage pull secrets created by third parties
  • Loading branch information
openshift-merge-robot committed Jun 15, 2018
2 parents 06d4b3a + 2678448 commit 411637b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/serviceaccounts/controllers/docker_registry_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,13 @@ func (e *DockerRegistryServiceController) syncRegistryLocationChange() error {
if t.Type != v1.SecretTypeDockercfg {
continue
}
if t.Annotations == nil {
continue
}
// Do not manage dockercfg secrets we haven't created (eg. secrets created by user for private repositories).
if _, hasTokenSecret := t.Annotations[ServiceAccountTokenSecretNameKey]; !hasTokenSecret {
continue
}
default:
utilruntime.HandleError(fmt.Errorf("object passed to %T that is not expected: %T", e, obj))
continue
Expand Down

0 comments on commit 411637b

Please sign in to comment.