Skip to content

Commit 26c11ff

Browse files
committed
chore(pkg): upgrade new require
1 parent f56f4c2 commit 26c11ff

8 files changed

Lines changed: 207 additions & 164 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# - Docker image name
44
# - Kubernetes service, rc, pod, secret, volume names
55
REPO_PATH := github.com/drycc/pkg
6-
DEV_ENV_IMAGE := drycc/go-dev
6+
DEV_ENV_IMAGE := ${DEV_REGISTRY}/drycc/go-dev
77
DEV_ENV_WORK_DIR := /opt/drycc/go/src/${REPO_PATH}
88

99
# Enable vendor/ directory support.
@@ -31,6 +31,6 @@ test: build test-style
3131
${DEV_ENV_CMD} go test -race -cover -coverprofile=coverage.txt -covermode=atomic ${PKG_DIRS}
3232

3333
test-style: bootstrap
34-
${DEV_ENV_CMD} lint --deadline
34+
${DEV_ENV_CMD} lint
3535

3636
.PHONY: all build test

aboutme/aboutme.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
//
33
// Typical usage is to let the Pod auto-detect information about itself:
44
//
5-
// my, err := aboutme.FromEnv()
6-
// if err != nil {
7-
// // Error connecting to tke k8s API server
8-
// }
5+
// my, err := aboutme.FromEnv()
6+
// if err != nil {
7+
// // Error connecting to tke k8s API server
8+
// }
99
//
10-
// fmt.Printf("My Pod Name is %s", my.Name)
10+
// fmt.Printf("My Pod Name is %s", my.Name)
1111
package aboutme
1212

1313
import (
@@ -102,7 +102,7 @@ func NameFromEnv() string {
102102
return n
103103
}
104104

105-
//NamespaceFromEnv attempts to get the namespace from the downward API.
105+
// NamespaceFromEnv attempts to get the namespace from the downward API.
106106
//
107107
// If EnvNamespace is not set, or if the name is not recovered from the
108108
// environment, then the DefaultNamespace is used.
@@ -119,9 +119,9 @@ func NamespaceFromEnv() string {
119119
// The properties of Me are placed into the environment according to the
120120
// following rules:
121121
//
122-
// - In general, all variables are prefaced with MY_ (MY_IP, MY_NAMESPACE)
123-
// - Labels become MY_LABEL_[NAME]=[value]
124-
// - Annotations become MY_ANNOTATION_[NAME] = [value]
122+
// - In general, all variables are prefaced with MY_ (MY_IP, MY_NAMESPACE)
123+
// - Labels become MY_LABEL_[NAME]=[value]
124+
// - Annotations become MY_ANNOTATION_[NAME] = [value]
125125
func (me *Me) ShuntEnv() {
126126
env := map[string]string{
127127
"MY_APISERVER": me.APIServer,
@@ -180,13 +180,13 @@ func (me *Me) loadPod() (*v1.Pod, string, error) {
180180
return p, ns, err
181181
}
182182

183-
// findPodInNamespaces searches relevant namespaces for this pod.
183+
// FindPodInNamespaces searches relevant namespaces for this pod.
184184
//
185185
// It returns a PodInterface for working with the pod, a namespace name as a
186186
// string, and an error if something goes wrong.
187187
//
188188
// The selector must be a label selector.
189-
func (me *Me) findPodInNamespaces(selector string) (*v1.Pod, string, error) {
189+
func (me *Me) FindPodInNamespaces(selector string) (*v1.Pod, string, error) {
190190
// Get the drycc namespace. If it does not exist, get the default namespce.
191191
s, err := labels.Parse(selector)
192192
if err == nil {

env/envvar.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
//
1313
// Parameters passed in are of the form varname => defaultValue.
1414
//
15-
// r.Route("foo", "example").Does(envvar.Get).Using("HOME").WithDefault(".")
15+
// r.Route("foo", "example").Does(envvar.Get).Using("HOME").WithDefault(".")
1616
//
1717
// As with all environment variables, the default value must be a string.
1818
//
@@ -52,10 +52,10 @@ func Get(c cookoo.Context, params *cookoo.Params) (interface{}, cookoo.Interrupt
5252
// Expand expands the environment variables in the given string and returns the result.
5353
//
5454
// Params:
55-
// - content (string): The given string to expand.
55+
// - content (string): The given string to expand.
5656
//
5757
// Returns:
58-
// - The expanded string. This expands against the os environment (os.ExpandEnv).
58+
// - The expanded string. This expands against the os environment (os.ExpandEnv).
5959
func Expand(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {
6060
s := p.Get("content", "").(string)
6161

@@ -77,10 +77,13 @@ func Expand(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
7777
// are retrieved from the underlying map.
7878
//
7979
// Params:
80-
// accessed as map[string]string
80+
//
81+
// accessed as map[string]string
82+
//
8183
// Returns:
82-
// nothing, but inserts all name/value pairs into the context and the
83-
// environment.
84+
//
85+
// nothing, but inserts all name/value pairs into the context and the
86+
// environment.
8487
func Set(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {
8588
for name, def := range p.AsMap() {
8689
// Assume Nil means unset the value.

go.mod

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,50 @@
11
module github.com/drycc/pkg
22

3-
go 1.18
3+
go 1.19
44

55
require (
66
github.com/Masterminds/cookoo v1.3.0
77
github.com/stretchr/testify v1.8.0
8-
k8s.io/api v0.22.0
9-
k8s.io/apimachinery v0.22.0
10-
k8s.io/client-go v0.22.0
8+
k8s.io/api v0.25.0
9+
k8s.io/apimachinery v0.25.0
10+
k8s.io/client-go v0.25.0
1111
)
1212

1313
require (
14+
github.com/PuerkitoBio/purell v1.1.1 // indirect
15+
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
1416
github.com/davecgh/go-spew v1.1.1 // indirect
15-
github.com/go-logr/logr v0.4.0 // indirect
17+
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
18+
github.com/go-logr/logr v1.2.3 // indirect
19+
github.com/go-openapi/jsonpointer v0.19.5 // indirect
20+
github.com/go-openapi/jsonreference v0.19.5 // indirect
21+
github.com/go-openapi/swag v0.19.14 // indirect
1622
github.com/gogo/protobuf v1.3.2 // indirect
1723
github.com/golang/protobuf v1.5.2 // indirect
18-
github.com/google/go-cmp v0.5.5 // indirect
24+
github.com/google/gnostic v0.5.7-v3refs // indirect
1925
github.com/google/gofuzz v1.1.0 // indirect
20-
github.com/googleapis/gnostic v0.5.5 // indirect
21-
github.com/json-iterator/go v1.1.11 // indirect
26+
github.com/josharian/intern v1.0.0 // indirect
27+
github.com/json-iterator/go v1.1.12 // indirect
28+
github.com/mailru/easyjson v0.7.6 // indirect
2229
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
23-
github.com/modern-go/reflect2 v1.0.1 // indirect
30+
github.com/modern-go/reflect2 v1.0.2 // indirect
31+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
2432
github.com/pmezard/go-difflib v1.0.0 // indirect
25-
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 // indirect
26-
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
27-
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect
28-
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
29-
golang.org/x/text v0.3.6 // indirect
30-
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
31-
google.golang.org/appengine v1.6.5 // indirect
32-
google.golang.org/protobuf v1.26.0 // indirect
33+
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
34+
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
35+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
36+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
37+
golang.org/x/text v0.3.7 // indirect
38+
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
39+
google.golang.org/appengine v1.6.7 // indirect
40+
google.golang.org/protobuf v1.28.0 // indirect
3341
gopkg.in/inf.v0 v0.9.1 // indirect
3442
gopkg.in/yaml.v2 v2.4.0 // indirect
3543
gopkg.in/yaml.v3 v3.0.1 // indirect
36-
k8s.io/klog/v2 v2.9.0 // indirect
37-
k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9 // indirect
38-
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
44+
k8s.io/klog/v2 v2.70.1 // indirect
45+
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
46+
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
47+
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
48+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
3949
sigs.k8s.io/yaml v1.2.0 // indirect
4050
)

0 commit comments

Comments
 (0)