mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 18:58:18 +00:00
optimize getPullSecretsForPod() and syncPod()
Since getPullSecretsForPod() will never return err,we do not need the second return value,and modify syncPod() function.
This commit is contained in:
@@ -672,7 +672,7 @@ func (kl *Kubelet) makePodDataDirs(pod *v1.Pod) error {
|
||||
|
||||
// getPullSecretsForPod inspects the Pod and retrieves the referenced pull
|
||||
// secrets.
|
||||
func (kl *Kubelet) getPullSecretsForPod(pod *v1.Pod) ([]v1.Secret, error) {
|
||||
func (kl *Kubelet) getPullSecretsForPod(pod *v1.Pod) []v1.Secret {
|
||||
pullSecrets := []v1.Secret{}
|
||||
|
||||
for _, secretRef := range pod.Spec.ImagePullSecrets {
|
||||
@@ -685,7 +685,7 @@ func (kl *Kubelet) getPullSecretsForPod(pod *v1.Pod) ([]v1.Secret, error) {
|
||||
pullSecrets = append(pullSecrets, *secret)
|
||||
}
|
||||
|
||||
return pullSecrets, nil
|
||||
return pullSecrets
|
||||
}
|
||||
|
||||
// Returns true if pod is in the terminated state ("Failed" or "Succeeded").
|
||||
|
||||
Reference in New Issue
Block a user