Skip to content

Commit d3864a5

Browse files
Merge pull request #116 from containerum/chkit-v3
Chkit v3
2 parents 52a177c + fa63c10 commit d3864a5

File tree

604 files changed

+6034
-84771
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

604 files changed

+6034
-84771
lines changed

Gopkg.lock

Lines changed: 43 additions & 239 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,7 @@
99

1010
[[constraint]]
1111
name = "github.com/containerum/kube-client"
12-
version = "~0.14.2"
13-
14-
[[constraint]]
15-
branch = "master"
16-
name = "github.com/containerum/solutions"
17-
18-
[[constraint]]
19-
branch = "master"
20-
name = "github.com/kardianos/osext"
12+
version = "~0.19.0"
2113

2214
[[constraint]]
2315
branch = "master"
@@ -54,3 +46,15 @@
5446
[[constraint]]
5547
name = "github.com/vbauerster/mpb"
5648
version = "3.2.0"
49+
50+
[[constraint]]
51+
name = "git.containerum.net/ch/api-gateway"
52+
branch = "develop"
53+
54+
[[constraint]]
55+
branch = "develop"
56+
name = "git.containerum.net/ch/auth"
57+
58+
[[constraint]]
59+
branch = "develop"
60+
name = "git.containerum.net/ch/resource-service"

Makefile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: genkey build test clean release single_release
1+
.PHONY: docker genkey build test clean install release single_release dev mock
22

33
CMD_DIR:=cmd/chkit
44
CLI_DIR:=pkg/cli
@@ -34,16 +34,17 @@ docker:
3434
docker build -t $(CONTAINER_NAME) . \
3535
--build-arg ALLOW_SELF_SIGNED_CERTS=$(ALLOW_SELF_SIGNED_CERTS)
3636

37-
38-
genkey:
37+
$(SIGNING_KEY_DIR)/$(PRIVATE_KEY_FILE):
3938
@echo "Generating private/public ECDSA keys to sign"
4039
@mkdir -p $(SIGNING_KEY_DIR)
4140
@openssl ecparam -genkey -name prime256v1 -out $(SIGNING_KEY_DIR)/$(PRIVATE_KEY_FILE)
4241
@openssl ec -in $(SIGNING_KEY_DIR)/$(PRIVATE_KEY_FILE) -pubout -out $(SIGNING_KEY_DIR)/$(PUBLIC_KEY_FILE)
4342
@echo "Keys stored in $(SIGNING_KEY_DIR)"
4443

44+
genkey: $(SIGNING_KEY_DIR)/$(PRIVATE_KEY_FILE)
45+
4546
# go has build artifacts caching so soruce tracking not needed
46-
build:
47+
build: $(SIGNING_KEY_DIR)/$(PRIVATE_KEY_FILE)
4748
@echo "Building chkit for current OS/architecture, without signing"
4849
go build -v -ldflags="$(RELEASE_LDFLAGS)" -o $(BUILDS_DIR)/$(EXECUTABLE) ./$(CMD_DIR)
4950

@@ -86,22 +87,20 @@ endif)
8687
@$(pack_cmd)
8788
endef
8889

89-
release:
90-
$(eval VERSION=$(LATEST_TAG:v%=%)+release)
90+
release: $(SIGNING_KEY_DIR)/$(PRIVATE_KEY_FILE)
9191
$(call build_release,linux,amd64)
9292
$(call build_release,linux,386)
9393
$(call build_release,linux,arm)
9494
$(call build_release,darwin,amd64)
9595
$(call build_release,windows,amd64)
9696
$(call build_release,windows,386)
9797

98-
single_release:
98+
single_release: $(SIGNING_KEY_DIR)/$(PRIVATE_KEY_FILE)
9999
$(call build_release,$(OS),$(ARCH))
100100

101101
dev:
102102
$(eval VERSION=$(LATEST_TAG:v%=%)+dev)
103103
@echo building $(VERSION)
104-
@echo $(PACKAGE)
105104
go build -v --tags="dev" --ldflags="$(DEV_LDFLAGS)" ./$(CMD_DIR)
106105

107106
mock:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ To use it sign up on [Containerum.com](https://containerum.com).
99

1010
Buid with env
1111
```fish
12-
set -x CONTAINERUM_API "https://api.containerum.io:8082"
12+
set -x CONTAINERUM_API "https://api.containerum.io"
1313
make release
1414
```

helpers/chkit.go

Lines changed: 0 additions & 30 deletions
This file was deleted.

helpers/solutions.go

Lines changed: 0 additions & 119 deletions
This file was deleted.

helpers/structs.go

Lines changed: 0 additions & 71 deletions
This file was deleted.

helpers/uuid.go

Lines changed: 0 additions & 20 deletions
This file was deleted.

pkg/cli/clisetup/defaultns.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55

66
"github.com/containerum/chkit/pkg/context"
7+
"github.com/containerum/chkit/pkg/model/namespace"
78
"github.com/containerum/chkit/pkg/util/activekit"
89
"github.com/sirupsen/logrus"
910
)
@@ -19,21 +20,19 @@ func GetDefaultNS(ctx *context.Context, force bool) error {
1920
if len(list) == 0 {
2021
fmt.Printf("You have no namespaces!\n")
2122
} else if force {
22-
ctx.Namespace = list[0].Label
23-
ctx.Changed = true
23+
ctx.SetNamespace(list[0])
2424
return nil
2525
} else {
2626
var menu []*activekit.MenuItem
2727
for _, ns := range list {
2828
menu = append(menu, &activekit.MenuItem{
29-
Label: ns.Label,
30-
Action: func(ns string) func() error {
29+
Label: ns.LabelAndID(),
30+
Action: func(ns namespace.Namespace) func() error {
3131
return func() error {
32-
ctx.Namespace = ns
33-
ctx.Changed = true
32+
ctx.SetNamespace(ns)
3433
return nil
3534
}
36-
}(ns.Label),
35+
}(ns),
3736
})
3837
}
3938
_, err := (&activekit.Menu{

pkg/cli/clisetup/namespace.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package clisetup

0 commit comments

Comments
 (0)