Add imagePullSecrets to PodSpec
This commit is contained in:
@@ -38,6 +38,9 @@ func newService(s *runtime.Service, c runtime.CreateOptions) *service {
|
||||
kdeploy.Spec.Template.Metadata.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
// set the image pull secrets
|
||||
kdeploy.Spec.Template.PodSpec.ImagePullSecrets = c.ImagePullSecrets
|
||||
|
||||
// create if non existent
|
||||
if s.Metadata == nil {
|
||||
s.Metadata = make(map[string]string)
|
||||
|
@@ -66,6 +66,8 @@ type CreateOptions struct {
|
||||
Retries int
|
||||
// Specify the image to use
|
||||
Image string
|
||||
// Specify secrets to use when pulling the image
|
||||
ImagePullSecrets []string
|
||||
}
|
||||
|
||||
// ReadOptions queries runtime services
|
||||
@@ -92,6 +94,13 @@ func CreateImage(img string) CreateOption {
|
||||
}
|
||||
}
|
||||
|
||||
// CreateImagePullSecret sets a secret to use
|
||||
func CreateImagePullSecret(secret string) CreateOption {
|
||||
return func(o *CreateOptions) {
|
||||
o.ImagePullSecrets = append(o.ImagePullSecrets, secret)
|
||||
}
|
||||
}
|
||||
|
||||
// WithCommand specifies the command to execute
|
||||
func WithCommand(cmd ...string) CreateOption {
|
||||
return func(o *CreateOptions) {
|
||||
|
Reference in New Issue
Block a user