Skip to content

Commit 0817f17

Browse files
authored
simplify flags (#28)
* removed "install-" flag prefixes * added install/uninstall info messages
1 parent 46a7c5d commit 0817f17

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
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.33
1+
VERSION=v0.0.34
22
OUT_DIR=dist
33
YEAR?=$(shell date +"%Y")
44

cmd/commands/runtime.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ func NewRuntimeInstallCommand() *cobra.Command {
157157

158158
cmd.Flags().StringVar(&versionStr, "version", "", "The runtime version to install, defaults to latest")
159159
insCloneOpts = git.AddFlags(cmd, &git.AddFlagsOptions{
160-
Prefix: "install",
161160
CreateIfNotExist: true,
162161
FS: memfs.New(),
163162
})
@@ -178,6 +177,7 @@ func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
178177
return fmt.Errorf("failed to download runtime definition: %w", err)
179178
}
180179

180+
log.G(ctx).WithField("version", rt.Spec.Version).Infof("installing runtime '%s'", opts.RuntimeName)
181181
err = apcmd.RunRepoBootstrap(ctx, &apcmd.RepoBootstrapOptions{
182182
AppSpecifier: rt.Spec.FullSpecifier(),
183183
Namespace: opts.RuntimeName,
@@ -219,6 +219,7 @@ func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
219219
return fmt.Errorf("failed to create `%s`: %w", store.Get().GitSourceName, err)
220220
}
221221

222+
log.G(ctx).Infof("done installing runtime '%s'", opts.RuntimeName)
222223
return nil
223224
}
224225

@@ -332,12 +333,19 @@ func NewRuntimeUninsatllCommand() *cobra.Command {
332333
}
333334

334335
func RunRuntimeUninstall(ctx context.Context, opts *RuntimeUninstallOptions) error {
335-
return apcmd.RunRepoUninstall(ctx, &apcmd.RepoUninstallOptions{
336+
log.G(ctx).Infof("uninstalling runtime '%s'", opts.RuntimeName)
337+
err := apcmd.RunRepoUninstall(ctx, &apcmd.RepoUninstallOptions{
336338
Namespace: opts.RuntimeName,
337339
Timeout: opts.Timeout,
338340
CloneOptions: opts.CloneOpts,
339341
KubeFactory: opts.KubeFactory,
340342
})
343+
if err != nil {
344+
return fmt.Errorf("failed uninstalling runtime: %w", err)
345+
}
346+
347+
log.G(ctx).Infof("done uninstalling runtime '%s'", opts.RuntimeName)
348+
return nil
341349
}
342350

343351
func NewRuntimeUpgradeCommand() *cobra.Command {

docs/commands/cli-v2_runtime_install.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ cli-v2 runtime install [runtime_name] [flags]
3131
--git-src-git-token string Your git provider api token [GIT_SRC_GIT_TOKEN]
3232
--git-src-provider string The git provider, one of: gitea|github
3333
--git-src-repo string Repository URL [GIT_SRC_GIT_REPO]
34+
-t, --git-token string Your git provider api token [GIT_TOKEN]
3435
-h, --help help for install
35-
--install-git-token string Your git provider api token [INSTALL_GIT_TOKEN]
36-
--install-provider string The git provider, one of: gitea|github
37-
--install-repo string Repository URL [INSTALL_GIT_REPO]
3836
--kubeconfig string Path to the kubeconfig file to use for CLI requests.
3937
-n, --namespace string If present, the namespace scope for this CLI request
38+
--provider string The git provider, one of: gitea|github
39+
--repo string Repository URL [GIT_REPO]
4040
--version string The runtime version to install, defaults to latest
4141
```
4242

docs/releases/release_notes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
### Linux
99
```bash
1010
# download and extract the binary
11-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.32/cf-linux-amd64.tar.gz | tar zx
11+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.34/cf-linux-amd64.tar.gz | tar zx
1212

1313
# move the binary to your $PATH
1414
mv ./cf-linux-amd64 /usr/local/bin/cf
@@ -20,7 +20,7 @@ cf version
2020
### Mac
2121
```bash
2222
# download and extract the binary
23-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.32/cf-darwin-amd64.tar.gz | tar zx
23+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.34/cf-darwin-amd64.tar.gz | tar zx
2424

2525
# move the binary to your $PATH
2626
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.32
8+
version: 0.0.34
99
bootstrapSpecifier: github.com/codefresh-io/cli-v2/manifests/argo-cd
1010
components:
1111
- name: events

0 commit comments

Comments
 (0)