mirror of https://github.com/k3s-io/k3s
Propage secret volumes in secret manager
parent
bf7138652f
commit
e0784f2e00
|
@ -212,8 +212,6 @@ func (c *cachingSecretManager) GetSecret(namespace, name string) (*v1.Secret, er
|
||||||
return c.secretStore.Get(namespace, name)
|
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 {
|
func getSecretNames(pod *v1.Pod) sets.String {
|
||||||
result := sets.NewString()
|
result := sets.NewString()
|
||||||
for _, reference := range pod.Spec.ImagePullSecrets {
|
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
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue