Skip to content

Commit 8528389

Browse files
committed
chore(builder): bump go.mod
1 parent 44b6314 commit 8528389

11 files changed

Lines changed: 795 additions & 111 deletions

File tree

boot.go

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"fmt"
45
"log"
56
"os"
67
"runtime"
@@ -18,7 +19,7 @@ import (
1819
"github.com/drycc/builder/pkg/sys"
1920
pkglog "github.com/drycc/pkg/log"
2021
"github.com/kelseyhightower/envconfig"
21-
"github.com/urfave/cli"
22+
"github.com/urfave/cli/v2"
2223
)
2324

2425
const (
@@ -39,16 +40,15 @@ func main() {
3940

4041
app := cli.NewApp()
4142

42-
app.Commands = []cli.Command{
43+
app.Commands = []*cli.Command{
4344
{
4445
Name: "server",
4546
Aliases: []string{"srv"},
4647
Usage: "Run the git server",
47-
Action: func(c *cli.Context) {
48+
Action: func(c *cli.Context) error {
4849
cnf := new(sshd.Config)
4950
if err := envconfig.Process(serverConfAppName, cnf); err != nil {
50-
pkglog.Err("getting config for %s [%s]", serverConfAppName, err)
51-
os.Exit(1)
51+
return fmt.Errorf("getting config for %s [%s]", serverConfAppName, err)
5252
}
5353
fs := sys.RealFS()
5454
env := sys.RealEnv()
@@ -57,21 +57,18 @@ func main() {
5757

5858
storageParams, err := conf.GetStorageParams(env)
5959
if err != nil {
60-
log.Printf("Error getting storage parameters (%s)", err)
61-
os.Exit(1)
60+
return fmt.Errorf("error getting storage parameters (%s)", err)
6261
}
6362
var storageDriver storagedriver.StorageDriver
6463
storageDriver, err = factory.Create("s3", storageParams)
6564

6665
if err != nil {
67-
log.Printf("Error creating storage driver (%s)", err)
68-
os.Exit(1)
66+
return fmt.Errorf("error creating storage driver (%s)", err)
6967
}
7068

7169
kubeClient, err := k8s.NewInCluster()
7270
if err != nil {
73-
log.Printf("Error getting kubernetes client [%s]", err)
74-
os.Exit(1)
71+
return fmt.Errorf("error getting kubernetes client [%s]", err)
7572
}
7673
log.Printf("Starting health check server on port %d", cnf.HealthSrvPort)
7774
healthSrvCh := make(chan error)
@@ -96,47 +93,41 @@ func main() {
9693

9794
select {
9895
case err := <-healthSrvCh:
99-
log.Printf("Error running health server (%s)", err)
100-
os.Exit(1)
96+
return fmt.Errorf("error running health server (%s)", err)
10197
case i := <-sshCh:
102-
log.Printf("Unexpected SSH server stop with code %d", i)
103-
os.Exit(i)
98+
return fmt.Errorf("unexpected SSH server stop with code %d", i)
10499
case err := <-cleanerErrCh:
105-
log.Printf("Error running the deleted app cleaner (%s)", err)
106-
os.Exit(1)
100+
return fmt.Errorf("error running the deleted app cleaner (%s)", err)
107101
}
108102
},
109103
},
110104
{
111105
Name: "git-receive",
112106
Aliases: []string{"gr"},
113107
Usage: "Run the git-receive hook",
114-
Action: func(c *cli.Context) {
108+
Action: func(c *cli.Context) error {
115109
cnf := new(gitreceive.Config)
116110
if err := envconfig.Process(gitReceiveConfAppName, cnf); err != nil {
117-
log.Printf("Error getting config for %s [%s]", gitReceiveConfAppName, err)
118-
os.Exit(1)
111+
return fmt.Errorf("error getting config for %s [%s]", gitReceiveConfAppName, err)
119112
}
120113
cnf.CheckDurations()
121114
fs := sys.RealFS()
122115
env := sys.RealEnv()
123116
storageParams, err := conf.GetStorageParams(env)
124117
if err != nil {
125-
log.Printf("Error getting storage parameters (%s)", err)
126-
os.Exit(1)
118+
return fmt.Errorf("error getting storage parameters (%s)", err)
127119
}
128120
var storageDriver storagedriver.StorageDriver
129121
storageDriver, err = factory.Create("s3", storageParams)
130122

131123
if err != nil {
132-
log.Printf("Error creating storage driver (%s)", err)
133-
os.Exit(1)
124+
return fmt.Errorf("error creating storage driver (%s)", err)
134125
}
135126

136127
if err := gitreceive.Run(cnf, fs, env, storageDriver); err != nil {
137-
log.Printf("Error running git receive hook [%s]", err)
138-
os.Exit(1)
128+
return fmt.Errorf("error running git receive hook [%s]", err)
139129
}
130+
return nil
140131
},
141132
},
142133
}

charts/builder/templates/_helpers.tpl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
{{- define "builder.envs" -}}
1+
{{- define "builder.envs" }}
22
env:
33
- name: "HEALTH_SERVER_PORT"
44
value: "8092"
55
- name: "EXTERNAL_PORT"
66
value: "2223"
7-
- name: BUILDER_STORAGE
8-
value: "{{ .Values.global.storage }}"
97
- name: "TTL_SECONDS_AFTER_FINISHED"
108
value: "{{ .Values.global.ttlSecondsAfterFinished }}"
119
# Set GIT_LOCK_TIMEOUT to number of minutes you want to wait to git push again to the same repository
@@ -21,7 +19,7 @@ env:
2119
- name: "POD_NAMESPACE"
2220
valueFrom:
2321
fieldRef:
24-
fieldPath: metadata.namespace
22+
fieldPath: metadata.namespace
2523
- name: DRYCC_BUILDER_KEY
2624
valueFrom:
2725
secretKeyRef:
@@ -59,7 +57,7 @@ env:
5957
secretKeyRef:
6058
name: registry-secret
6159
key: host
62-
{{- if ne .Values.global.registryLocation "on-cluster" }}
60+
{{- if eq .Values.global.registryLocation "on-cluster" }}
6361
# NOTE(bacongobbler): use drycc/registry_proxy to work around Docker --insecure-registry requirements
6462
- name: "DRYCC_REGISTRY_PROXY_HOST"
6563
value: {{ print "127.0.0.1" ":" .Values.global.registryProxyPort }}

charts/builder/templates/builder-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ spec:
4242
name: ssh
4343
- containerPort: 8092
4444
name: healthsrv
45-
{{- include "builder.limits" . | indent 8 }}
4645
{{- include "builder.envs" . | indent 8 }}
46+
{{- include "builder.limits" . | indent 8 }}
4747
livenessProbe:
4848
httpGet:
4949
path: /healthz

go.mod

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@ go 1.17
44

55
require (
66
github.com/arschles/assert v1.0.1-0.20191213221312-71f210f9375a
7-
github.com/aws/aws-sdk-go v1.40.15
8-
github.com/distribution/distribution/v3 v3.0.0-20210921140121-a60a3f69eb54
9-
github.com/drycc/controller-sdk-go v0.0.0-20211213072304-8a9f2f28d524
10-
github.com/drycc/pkg v0.0.0-20210826011456-c60b87108840
7+
github.com/aws/aws-sdk-go v1.43.44
8+
github.com/distribution/distribution/v3 v3.0.0-20220422123413-27b556324553
9+
github.com/drycc/controller-sdk-go v0.0.0-20220414163543-b9fc87956088
10+
github.com/drycc/pkg v0.0.0-20220414163413-88896c2e0ef0
1111
github.com/kelseyhightower/envconfig v1.4.0
1212
github.com/pborman/uuid v1.2.1
13-
github.com/urfave/cli v1.22.5
14-
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
15-
gopkg.in/yaml.v2 v2.4.0
16-
k8s.io/api v0.22.0
17-
k8s.io/apimachinery v0.22.0
18-
k8s.io/client-go v0.22.0
13+
github.com/urfave/cli/v2 v2.4.4
14+
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
15+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
16+
k8s.io/api v0.23.6
17+
k8s.io/apimachinery v0.23.6
18+
k8s.io/client-go v0.23.6
1919
)
2020

2121
require (
2222
github.com/PuerkitoBio/purell v1.1.1 // indirect
2323
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
2424
github.com/beorn7/perks v1.0.1 // indirect
25-
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect
25+
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
2626
github.com/davecgh/go-spew v1.1.1 // indirect
2727
github.com/docker/go-metrics v0.0.1 // indirect
28-
github.com/go-logr/logr v0.4.0 // indirect
28+
github.com/go-logr/logr v1.2.0 // indirect
2929
github.com/gogo/protobuf v1.3.2 // indirect
3030
github.com/golang/protobuf v1.5.2 // indirect
3131
github.com/google/go-cmp v0.5.5 // indirect
@@ -35,30 +35,31 @@ require (
3535
github.com/gorilla/mux v1.8.0 // indirect
3636
github.com/goware/urlx v0.3.1 // indirect
3737
github.com/jmespath/go-jmespath v0.4.0 // indirect
38-
github.com/json-iterator/go v1.1.11 // indirect
38+
github.com/json-iterator/go v1.1.12 // indirect
3939
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
4040
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
41-
github.com/modern-go/reflect2 v1.0.1 // indirect
41+
github.com/modern-go/reflect2 v1.0.2 // indirect
4242
github.com/prometheus/client_golang v1.1.0 // indirect
4343
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 // indirect
4444
github.com/prometheus/common v0.6.0 // indirect
4545
github.com/prometheus/procfs v0.0.3 // indirect
46-
github.com/russross/blackfriday/v2 v2.0.1 // indirect
47-
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
46+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
4847
github.com/sirupsen/logrus v1.8.1 // indirect
49-
golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
50-
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
51-
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect
52-
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
53-
golang.org/x/text v0.3.6 // indirect
48+
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
49+
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
50+
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
51+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
52+
golang.org/x/text v0.3.7 // indirect
5453
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
55-
google.golang.org/appengine v1.6.5 // indirect
56-
google.golang.org/protobuf v1.26.0 // indirect
54+
google.golang.org/appengine v1.6.7 // indirect
55+
google.golang.org/protobuf v1.27.1 // indirect
5756
gopkg.in/inf.v0 v0.9.1 // indirect
58-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
59-
k8s.io/klog/v2 v2.9.0 // indirect
60-
k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9 // indirect
61-
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
57+
gopkg.in/yaml.v2 v2.4.0 // indirect
58+
k8s.io/klog/v2 v2.30.0 // indirect
59+
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
60+
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
61+
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
62+
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
6263
sigs.k8s.io/yaml v1.2.0 // indirect
6364
)
6465

0 commit comments

Comments
 (0)