Skip to content

Commit

Permalink
fix: rename pull secret parameter as per suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristof Havasi committed Aug 31, 2023
1 parent 1404f18 commit fd060f7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions assets/knative/service.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ metadata:
spec:
template:
spec:
{{ if ne .RegistrySecret "" }}
{{ if ne .ImagePullSecrets "" }}
imagePullSecrets:
- name: {{ .RegistrySecret }}
- name: {{ .ImagePullSecrets }}
{{ end }}
containers:
- image: {{ .RemoteTag }}
Expand Down
4 changes: 2 additions & 2 deletions src/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (c *icli) init(cCtx *cli.Context) error {
projectDirectory := cCtx.String(projectDirectoryFlag)
absProjectDirectory, err := filepath.Abs(cCtx.String(projectDirectoryFlag))
registry := cCtx.String(repoNameFlag)
registrySecret := cCtx.String(registrySecretFlag)
imagePullSecrets := cCtx.String(imagePullSecretsFlag)
dockerFileName := cCtx.String(dockerFileNameFlag)

if dockerFileName == "" {
Expand All @@ -84,7 +84,7 @@ func (c *icli) init(cCtx *cli.Context) error {
projectDirectory,
cCtx.String(runtimeVersionFlag),
version,
registrySecret,
imagePullSecrets,
c.Resources,
)

Expand Down
4 changes: 2 additions & 2 deletions src/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const (
dockerFileNameFlag string = "dockerfile-name"
configFileFlag string = "config-file"
namespaceFlag string = "namespace"
registrySecretFlag string = "registry-secret"
imagePullSecretsFlag string = "image-pull-secrets"
stopOnBuildFlag string = "stop-on-build"
stopOnPushFlag string = "stop-on-push"
)
Expand Down Expand Up @@ -102,7 +102,7 @@ func InitFlags() flags {
Category: "deploy",
},
&cli.StringFlag{
Name: registrySecretFlag,
Name: imagePullSecretsFlag,
EnvVars: []string{"INITIUM_REGISTRY_SECRET"},
Required: false,
Category: "deploy",
Expand Down
2 changes: 1 addition & 1 deletion src/services/k8s/knative.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func loadManifest(project *project.Project, dockerImage docker.DockerImage) (*se
templateParams := map[string]interface{}{
"Name": dockerImage.Name,
"RemoteTag": dockerImage.RemoteTag(),
"RegistrySecret": project.RegistrySecret,
"ImagePullSecrets": project.ImagePullSecrets,
}

output := &bytes.Buffer{}
Expand Down
16 changes: 8 additions & 8 deletions src/services/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type Project struct {
Directory string
RuntimeVersion string
DefaultRuntimeVersion string
RegistrySecret string
ImagePullSecrets string
Resources fs.FS
}

Expand All @@ -47,14 +47,14 @@ func GuessAppName() *string {
return &name
}

func New(name string, directory string, runtimeVersion string, version string, registrySecret string, resources fs.FS) Project {
func New(name string, directory string, runtimeVersion string, version string, imagePullSecrets string, resources fs.FS) Project {
return Project{
Name: name,
Directory: directory,
RuntimeVersion: runtimeVersion,
RegistrySecret: registrySecret,
Resources: resources,
Version: version,
Name: name,
Directory: directory,
RuntimeVersion: runtimeVersion,
ImagePullSecrets: imagePullSecrets,
Resources: resources,
Version: version,
}
}

Expand Down

0 comments on commit fd060f7

Please sign in to comment.