mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
Image pull secret fix
This commit is contained in:
parent
6be53536d3
commit
4c05623a3c
@ -39,7 +39,10 @@ func newService(s *runtime.Service, c runtime.CreateOptions) *service {
|
||||
}
|
||||
|
||||
// set the image pull secrets
|
||||
kdeploy.Spec.Template.PodSpec.ImagePullSecrets = c.ImagePullSecrets
|
||||
kdeploy.Spec.Template.PodSpec.ImagePullSecrets = make([]client.ImagePullSecret, len(c.ImagePullSecrets))
|
||||
for i, s := range c.ImagePullSecrets {
|
||||
kdeploy.Spec.Template.PodSpec.ImagePullSecrets[i] = client.ImagePullSecret{Name: s}
|
||||
}
|
||||
|
||||
// create if non existent
|
||||
if s.Metadata == nil {
|
||||
|
@ -53,7 +53,7 @@ spec:
|
||||
imagePullSecrets:
|
||||
{{- with .Spec.Template.PodSpec.ImagePullSecrets }}
|
||||
{{- range . }}
|
||||
- name: "{{.}}"
|
||||
- name: "{{ .Name }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
|
@ -94,7 +94,7 @@ type Metadata struct {
|
||||
// PodSpec is a pod
|
||||
type PodSpec struct {
|
||||
Containers []Container `json:"containers"`
|
||||
ImagePullSecrets []string `json:"imagePullSecrets"`
|
||||
ImagePullSecrets []ImagePullSecret `json:"imagePullSecrets"`
|
||||
}
|
||||
|
||||
// PodList
|
||||
@ -189,3 +189,8 @@ type Namespace struct {
|
||||
type NamespaceList struct {
|
||||
Items []Namespace `json:"items"`
|
||||
}
|
||||
|
||||
// ImagePullSecret
|
||||
type ImagePullSecret struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user