Skip to content

Commit be4256c

Browse files
sample install always true bug (#151)
* fixed bug removed deprecated lines added clarification to ingress host prompt string * bump version
1 parent 30d1c0a commit be4256c

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=v0.0.141
1+
VERSION=v0.0.142
22

33
OUT_DIR=dist
44
YEAR?=$(shell date +"%Y")

cmd/commands/common.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,27 +110,25 @@ func ensureRepo(cmd *cobra.Command, runtimeName string, cloneOpts *git.CloneOpti
110110
return fmt.Errorf("failed getting runtime repo information: %w", err)
111111
}
112112
if runtimeData.Repo != nil {
113-
cloneOpts.Repo = *runtimeData.Repo
114113
die(cmd.Flags().Set("repo", *runtimeData.Repo))
115114
return nil
116115
}
117116
}
118117
if !store.Get().Silent {
119-
return getRepoFromUserInput(cmd, cloneOpts)
118+
return getRepoFromUserInput(cmd)
120119
}
121120
}
122121
return nil
123122
}
124123

125-
func getRepoFromUserInput(cmd *cobra.Command, cloneOpts *git.CloneOptions) error {
124+
func getRepoFromUserInput(cmd *cobra.Command) error {
126125
repoPrompt := promptui.Prompt{
127126
Label: "Repository URL",
128127
}
129128
repoInput, err := repoPrompt.Run()
130129
if err != nil {
131130
return fmt.Errorf("Prompt error: %w", err)
132131
}
133-
cloneOpts.Repo = repoInput
134132
die(cmd.Flags().Set("repo", repoInput))
135133
return nil
136134
}
@@ -205,20 +203,19 @@ func getRuntimeNameFromUserSelect(ctx context.Context, runtimeName *string) erro
205203

206204
func ensureGitToken(cmd *cobra.Command, cloneOpts *git.CloneOptions) error {
207205
if cloneOpts.Auth.Password == "" && !store.Get().Silent {
208-
return getGitTokenFromUserInput(cmd, cloneOpts)
206+
return getGitTokenFromUserInput(cmd)
209207
}
210208
return nil
211209
}
212210

213-
func getGitTokenFromUserInput(cmd *cobra.Command, cloneOpts *git.CloneOptions) error {
211+
func getGitTokenFromUserInput(cmd *cobra.Command) error {
214212
gitTokenPrompt := promptui.Prompt{
215213
Label: "Git provider api token",
216214
}
217215
gitTokenInput, err := gitTokenPrompt.Run()
218216
if err != nil {
219217
return fmt.Errorf("Prompt error: %w", err)
220218
}
221-
cloneOpts.Auth.Password = gitTokenInput
222219
die(cmd.Flags().Set("git-token", gitTokenInput))
223220
return nil
224221
}
@@ -323,7 +320,7 @@ func getIngressHostFromUserInput(cmd *cobra.Command, ingressHost *string) error
323320
}
324321

325322
ingressHostPrompt := promptui.Prompt{
326-
Label: "Ingress host",
323+
Label: "Ingress host (leave blank to skip)",
327324
}
328325

329326
ingressHostInput, err := ingressHostPrompt.Run()

cmd/commands/runtime.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func NewRuntimeInstallCommand() *cobra.Command {
165165
log.G(ctx).Fatal("must enter a runtime name")
166166
}
167167

168-
err = runtimeInstallCommandPreRunHandler(cmd, installationOpts)
168+
err = runtimeInstallCommandPreRunHandler(cmd, &installationOpts)
169169
if err != nil {
170170
return fmt.Errorf("Pre installation error: %w", err)
171171
}
@@ -236,7 +236,7 @@ func NewRuntimeInstallCommand() *cobra.Command {
236236
return cmd
237237
}
238238

239-
func runtimeInstallCommandPreRunHandler(cmd *cobra.Command, installationOpts RuntimeInstallOptions) error {
239+
func runtimeInstallCommandPreRunHandler(cmd *cobra.Command, installationOpts *RuntimeInstallOptions) error {
240240
err := ensureRepo(cmd, installationOpts.RuntimeName, installationOpts.InsCloneOpts, false)
241241
if err != nil {
242242
return err

docs/releases/release_notes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ cf version
2020
### Linux
2121
```bash
2222
# download and extract the binary
23-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.141/cf-linux-amd64.tar.gz | tar zx
23+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.142/cf-linux-amd64.tar.gz | tar zx
2424

2525
# move the binary to your $PATH
2626
mv ./cf-linux-amd64 /usr/local/bin/cf
@@ -32,7 +32,7 @@ cf version
3232
### Mac
3333
```bash
3434
# download and extract the binary
35-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.141/cf-darwin-amd64.tar.gz | tar zx
35+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.142/cf-darwin-amd64.tar.gz | tar zx
3636

3737
# move the binary to your $PATH
3838
mv ./cf-darwin-amd64 /usr/local/bin/cf

manifests/runtime.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
namespace: "{{ namespace }}"
66
spec:
77
defVersion: 1.0.0
8-
version: 0.0.141
8+
version: 0.0.142
99
bootstrapSpecifier: github.com/codefresh-io/cli-v2/manifests/argo-cd
1010
components:
1111
- name: events

0 commit comments

Comments
 (0)