Skip to content

Commit

Permalink
Propage secret volumes in secret manager
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtek-t committed Jan 23, 2017
1 parent bf71386 commit e0784f2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/kubelet/secret/secret_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,6 @@ func (c *cachingSecretManager) GetSecret(namespace, name string) (*v1.Secret, er
return c.secretStore.Get(namespace, name)
}

// TODO: Before we will use secretManager in other places (e.g. for secret volumes)
// we should update this function to also get secrets from those places.
func getSecretNames(pod *v1.Pod) sets.String {
result := sets.NewString()
for _, reference := range pod.Spec.ImagePullSecrets {
Expand All @@ -226,6 +224,11 @@ func getSecretNames(pod *v1.Pod) sets.String {
}
}
}
for i := range pod.Spec.Volumes {
if source := pod.Spec.Volumes[i].Secret; source != nil {
result.Insert(source.SecretName)
}
}
return result
}

Expand Down

0 comments on commit e0784f2

Please sign in to comment.