Merge pull request #1565 from micro/image-pull-secret-fix
Runtime: Fix ImagePullSecret
This commit is contained in:
		| @@ -38,6 +38,8 @@ func (k *kubernetes) namespaceExists(name string) (bool, error) { | |||||||
| 			return false, err | 			return false, err | ||||||
| 		} | 		} | ||||||
| 		k.namespaces = namespaceList.Items | 		k.namespaces = namespaceList.Items | ||||||
|  | 		fmt.Println("HERE") | ||||||
|  | 		fmt.Println(k.namespaces) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	// check if the namespace exists in the cache | 	// check if the namespace exists in the cache | ||||||
|   | |||||||
| @@ -39,7 +39,10 @@ func newService(s *runtime.Service, c runtime.CreateOptions) *service { | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	// set the image pull secrets | 	// 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 | 	// create if non existent | ||||||
| 	if s.Metadata == nil { | 	if s.Metadata == nil { | ||||||
|   | |||||||
| @@ -53,7 +53,7 @@ spec: | |||||||
|       imagePullSecrets: |       imagePullSecrets: | ||||||
|       {{- with .Spec.Template.PodSpec.ImagePullSecrets }} |       {{- with .Spec.Template.PodSpec.ImagePullSecrets }} | ||||||
|       {{- range . }} |       {{- range . }} | ||||||
|       - name: "{{.}}" |       - name: "{{ .Name }}" | ||||||
|       {{- end }} |       {{- end }} | ||||||
|       {{- end }} |       {{- end }} | ||||||
|       containers: |       containers: | ||||||
|   | |||||||
| @@ -93,8 +93,8 @@ type Metadata struct { | |||||||
|  |  | ||||||
| // PodSpec is a pod | // PodSpec is a pod | ||||||
| type PodSpec struct { | type PodSpec struct { | ||||||
| 	Containers       []Container `json:"containers"` | 	Containers       []Container       `json:"containers"` | ||||||
| 	ImagePullSecrets []string    `json:"imagePullSecrets"` | 	ImagePullSecrets []ImagePullSecret `json:"imagePullSecrets"` | ||||||
| } | } | ||||||
|  |  | ||||||
| // PodList | // PodList | ||||||
| @@ -189,3 +189,8 @@ type Namespace struct { | |||||||
| type NamespaceList struct { | type NamespaceList struct { | ||||||
| 	Items []Namespace `json:"items"` | 	Items []Namespace `json:"items"` | ||||||
| } | } | ||||||
|  |  | ||||||
|  | // ImagePullSecret | ||||||
|  | type ImagePullSecret struct { | ||||||
|  | 	Name string `json:"name"` | ||||||
|  | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user