Skip to content

Commit 0d68df2

Browse files
authored
🌱 Small clean up (added print statements) (#70)
Signed-off-by: Thomas Guettler <thomas.guettler@syself.com>
1 parent a0dc2f3 commit 0d68df2

File tree

5 files changed

+64
-2
lines changed

5 files changed

+64
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export GOBIN := $(abspath $(TOOLS_BIN_DIR))
4444
# Common #
4545
##########
4646
.PHONY: build
47-
build: # build the csmctl binary
47+
build: ## build the csmctl binary
4848
go build -o csmctl main.go
4949

5050
.PHONY: lint-golang

docs/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ If you need a plugin for your provider and your Cluster Stack that automates bui
1111
## Using csmctl
1212

1313
Do you have your Cluster Stack configured already? Is your plugin ready if you need it? Then check out [how to use](how_to_use_csmctl.md) the CLI tool!
14+
15+
## Developing and testing csmctl
16+
17+
You want to improve or test `csmctl`?
18+
19+
You can find the introduction in [developing and testing csmctl](./developing-and-testing-csmctl.md)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Developing and Testing csmctl
2+
3+
## Clone the Repo
4+
5+
Go to [csmctl at Github](https://github.com/SovereignCloudStack/csmctl/) and clone the repository to your local device:
6+
7+
```shell
8+
git clone git@github.com:SovereignCloudStack/csmctl.git
9+
```
10+
11+
```shell
12+
cd csmctl
13+
```
14+
15+
## Makefile
16+
17+
We use a `Makefile` to building the binary.
18+
19+
You can see the available build targets with `make help`.
20+
21+
## make build
22+
23+
With `make build` you create the executable.
24+
25+
## csmctl --help
26+
27+
With `./csmctl --help` you can see the available sub-commands.
28+
29+
BTW: Be sure to use `./`, so that you don't accidentally use a different `csmctl` from your `$PATH`.
30+
31+
Up to now only `create` is a feasible sub-command.
32+
33+
## go run main.go ...
34+
35+
If you modify the source of `csmctl`, you can skip the build step by using `go run`:
36+
37+
```shell
38+
go run main.go create --help
39+
```
40+
41+
## Create Docker Cluster Stack
42+
43+
In the `tests` directory is a cluster stack for the docker provider.
44+
45+
You can create the cluster stack like this:
46+
47+
```shell
48+
❯ go run main.go create tests/cluster-stacks/docker/ferrol -m hash
49+
Created releases/docker-ferrol-1-27-v0-sha-7ff9188
50+
```
51+

pkg/clusterstack/mode.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ func HandleStableMode(gitHubReleasePath string, currentReleaseHash, latestReleas
3737
}
3838
fmt.Printf("Bumped NodeImage Version: %s\n", metadata.Versions.Components.NodeImage)
3939
} else {
40-
fmt.Printf("NodeImage Version unchanged: %s\n", metadata.Versions.Components.NodeImage)
40+
if metadata.Versions.Components.NodeImage == "" {
41+
fmt.Println("No NodeImage Version.")
42+
} else {
43+
fmt.Printf("NodeImage Version unchanged: %s\n", metadata.Versions.Components.NodeImage)
44+
}
4145
}
4246

4347
return metadata, nil

pkg/cmd/create.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ func createAction(_ *cobra.Command, args []string) error {
153153
if err := createOpts.generateRelease(); err != nil {
154154
return fmt.Errorf("failed to generate release: %w", err)
155155
}
156+
fmt.Printf("Created %s\n", createOpts.ClusterStackReleaseDir)
156157

157158
return nil
158159
}

0 commit comments

Comments
 (0)