Skip to content

Commit

Permalink
chore(deps): update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
terinjokes committed Dec 23, 2023
1 parent 0abfaa8 commit 31d5825
Show file tree
Hide file tree
Showing 21 changed files with 342 additions and 1,079 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,11 @@ endif
.PHONY: lint
lint:
staticcheck -tags suite ./...

.PHONY: controller-gen
controller-gen:
go install sigs.k8s.io/controller-tools/cmd/controller-gen

.PHONY: go-generate
go-generate: controller-gen
go generate -v ./...
3 changes: 1 addition & 2 deletions cmd/lockbox-controller/keypair.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"fmt"
"io"
"io/ioutil"

"github.com/kevinburke/nacl"
"sigs.k8s.io/yaml"
Expand All @@ -16,7 +15,7 @@ type kp struct {

// KeyPairFromYAMLOrJSON loads a public/private NaCL keypair from a YAML or JSON file.
func KeyPairFromYAMLOrJSON(r io.Reader) (pub, pri nacl.Key, err error) {
data, err := ioutil.ReadAll(r)
data, err := io.ReadAll(r)
if err != nil {
return
}
Expand Down
21 changes: 12 additions & 9 deletions cmd/lockbox-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ import (
"github.com/rs/zerolog"
corev1 "k8s.io/api/core/v1"
"k8s.io/client-go/kubernetes/scheme"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/handler"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
"sigs.k8s.io/controller-runtime/pkg/metrics"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/source"
)

Expand Down Expand Up @@ -67,7 +69,7 @@ func main() {
}
keypair.Close()

err = lockboxv1.Install(scheme.Scheme)
err = lockboxv1.AddToScheme(scheme.Scheme)
if err != nil {
logger.Fatal().Err(err).Msg("unable to add lockbox schemes")
os.Exit(1)
Expand All @@ -82,9 +84,13 @@ func main() {
}

mgr, err := manager.New(cfg, manager.Options{
MetricsBindAddress: metricsAddr.Text,
SyncPeriod: &syncPeriod,
Scheme: scheme.Scheme,
Metrics: metricsserver.Options{
BindAddress: metricsAddr.Text,
},
Cache: cache.Options{
SyncPeriod: &syncPeriod,
},
Scheme: scheme.Scheme,
})
if err != nil {
logger.Fatal().Err(err).Msg("unable to create controller manager")
Expand Down Expand Up @@ -137,15 +143,12 @@ func main() {
os.Exit(1)
}

if err := c.Watch(&source.Kind{Type: &lockboxv1.Lockbox{}}, mh); err != nil {
if err := c.Watch(source.Kind(mgr.GetCache(), &lockboxv1.Lockbox{}), mh); err != nil {
logger.Fatal().Err(err).Msg("unable to watch Lockbox resources")
os.Exit(1)
}

if err := c.Watch(&source.Kind{Type: &corev1.Secret{}}, &handler.EnqueueRequestForOwner{
OwnerType: &lockboxv1.Lockbox{},
IsController: true,
}); err != nil {
if err := c.Watch(source.Kind(mgr.GetCache(), &corev1.Secret{}), handler.EnqueueRequestForOwner(scheme.Scheme, mgr.GetRESTMapper(), &lockboxv1.Lockbox{}, handler.OnlyControllerOwner())); err != nil {
logger.Fatal().Err(err).Msg("unable to watch Secret resources")
os.Exit(1)
}
Expand Down
7 changes: 3 additions & 4 deletions cmd/locket/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
"os"
gruntime "runtime"
"time"
Expand Down Expand Up @@ -66,7 +65,7 @@ func main() {
logf.SetLogger(zerologr.New(&zl))
logger := zl.With().Str("name", "main").Logger()

err := lockboxv1.Install(scheme.Scheme)
err := lockboxv1.AddToScheme(scheme.Scheme)
if err != nil {
logger.Fatal().Err(err).Msg("unable to add lockbox schemes")
os.Exit(1)
Expand All @@ -89,7 +88,7 @@ func main() {

cf := runtimeserializer.NewCodecFactory(scheme.Scheme)

ib, err := ioutil.ReadAll(r)
ib, err := io.ReadAll(r)
if err != nil {
logger.Fatal().Err(err).Msg("unable to read secret file")
os.Exit(1)
Expand Down Expand Up @@ -171,7 +170,7 @@ func main() {
if info.PrettySerializer != nil {
serial = info.PrettySerializer
}
enc := cf.EncoderForVersion(serial, lockboxv1.SchemeGroupVersion)
enc := cf.EncoderForVersion(serial, lockboxv1.GroupVersion)

ob, err := runtime.Encode(enc, b)
if err != nil {
Expand Down
26 changes: 10 additions & 16 deletions deployment/crds/lockbox.k8s.cloudflare.com_lockboxes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: (devel)
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.13.0
name: lockboxes.lockbox.k8s.cloudflare.com
spec:
group: lockbox.k8s.cloudflare.com
Expand Down Expand Up @@ -74,19 +73,20 @@ spec:
annotations:
additionalProperties:
type: string
description: 'Annotations is an unstructured key value map
stored with a resource that may be set by external tools
to store and retrieve arbitrary metadata. They are not queryable
and should be preserved when modifying objects. More info:
http://kubernetes.io/docs/user-guide/annotations'
type: object
finalizers:
items:
type: string
type: array
labels:
additionalProperties:
type: string
description: 'Map of string keys and values that can be used
to organize and categorize (scope and select) objects. May
match selectors of replication controllers and services.
More info: http://kubernetes.io/docs/user-guide/labels'
type: object
name:
type: string
namespace:
type: string
type: object
type:
description: Type is used to facilitate programmatic handling
Expand Down Expand Up @@ -154,9 +154,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
2 changes: 0 additions & 2 deletions deployment/rbac/role.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: lockbox-controller
rules:
- apiGroups:
Expand Down
102 changes: 55 additions & 47 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,72 +1,80 @@
module github.com/cloudflare/lockbox

go 1.17
go 1.20

require (
github.com/go-logr/zerologr v1.2.1
github.com/google/go-cmp v0.5.5
github.com/go-logr/zerologr v1.2.3
github.com/google/go-cmp v0.5.9
github.com/kevinburke/nacl v0.0.0-20210405173606-cd9060f5f776
github.com/prometheus/client_golang v1.12.1
github.com/prometheus/common v0.32.1
github.com/rs/zerolog v1.25.0
gotest.tools/v3 v3.1.0
k8s.io/api v0.24.0
k8s.io/apimachinery v0.24.0
k8s.io/client-go v0.24.0
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
sigs.k8s.io/controller-runtime v0.12.1
github.com/prometheus/client_golang v1.16.0
github.com/prometheus/common v0.44.0
github.com/rs/zerolog v1.29.1
gotest.tools/v3 v3.4.0
k8s.io/api v0.28.3
k8s.io/apimachinery v0.28.3
k8s.io/client-go v0.28.3
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2
sigs.k8s.io/controller-runtime v0.16.3
sigs.k8s.io/controller-tools v0.13.0
sigs.k8s.io/yaml v1.3.0
)

require (
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gobuffalo/flect v1.0.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.12.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/apiextensions-apiserver v0.24.0 // indirect
k8s.io/component-base v0.24.0 // indirect
k8s.io/klog/v2 v2.60.1 // indirect
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.28.3 // indirect
k8s.io/component-base v0.28.3 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
)
Loading

0 comments on commit 31d5825

Please sign in to comment.