Propage secret volumes in secret manager

pull/6/head
Wojciech Tyczynski 2017-01-20 11:31:29 +01:00
parent bf7138652f
commit e0784f2e00
1 changed files with 5 additions and 2 deletions

View File

@ -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 {
@ -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
}