Skip to content

Commit 6496f3c

Browse files
committed
go mod init
1 parent 230b1a2 commit 6496f3c

File tree

3 files changed

+846
-4
lines changed

3 files changed

+846
-4
lines changed

bootstrap/cr.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ import (
1616
"k8s.io/apimachinery/pkg/util/yaml"
1717
"k8s.io/client-go/dynamic"
1818
"k8s.io/klog/v2"
19+
"k8s.io/utils/pointer"
1920
"sigs.k8s.io/controller-runtime/pkg/client"
20-
21-
"github.com/authzed/spicedb-operator/pkg/metadata"
2221
)
2322

2423
type KubeResourceObject interface {
@@ -27,7 +26,7 @@ type KubeResourceObject interface {
2726
}
2827

2928
// ResourceFromFile bootstraps a CustomResource with the given config file
30-
func ResourceFromFile[O KubeResourceObject](ctx context.Context, gvr schema.GroupVersionResource, dclient dynamic.Interface, configPath string, lastHash uint64) (uint64, error) {
29+
func ResourceFromFile[O KubeResourceObject](ctx context.Context, fieldManager string, gvr schema.GroupVersionResource, dclient dynamic.Interface, configPath string, lastHash uint64) (uint64, error) {
3130
if len(configPath) <= 0 {
3231
klog.V(4).Info("bootstrap file path not specified")
3332
return 0, nil
@@ -74,7 +73,7 @@ func ResourceFromFile[O KubeResourceObject](ctx context.Context, gvr schema.Grou
7473
_, err = dclient.
7574
Resource(gvr).
7675
Namespace(objectDef.GetNamespace()).
77-
Patch(ctx, objectDef.GetName(), types.ApplyPatchType, data, metadata.PatchForceOwned)
76+
Patch(ctx, objectDef.GetName(), types.ApplyPatchType, data, metav1.PatchOptions{FieldManager: fieldManager, Force: pointer.Bool(true)})
7877
if err != nil {
7978
return hash, err
8079
}

go.mod

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
module github.com/authzed/controller-idioms
2+
3+
go 1.19
4+
5+
require (
6+
github.com/cespare/xxhash/v2 v2.1.2
7+
github.com/davecgh/go-spew v1.1.1
8+
github.com/fsnotify/fsnotify v1.5.4
9+
github.com/prometheus/client_golang v1.13.0
10+
github.com/stretchr/testify v1.8.0
11+
golang.org/x/exp v0.0.0-20220823124025-807a23277127
12+
golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde
13+
k8s.io/api v0.25.0
14+
k8s.io/apiextensions-apiserver v0.25.0
15+
k8s.io/apimachinery v0.25.0
16+
k8s.io/apiserver v0.25.0
17+
k8s.io/client-go v0.25.0
18+
k8s.io/component-base v0.25.0
19+
k8s.io/controller-manager v0.25.0
20+
k8s.io/klog/v2 v2.70.1
21+
k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73
22+
sigs.k8s.io/controller-runtime v0.12.3
23+
)
24+
25+
require (
26+
github.com/NYTimes/gziphandler v1.1.1 // indirect
27+
github.com/PuerkitoBio/purell v1.1.1 // indirect
28+
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
29+
github.com/beorn7/perks v1.0.1 // indirect
30+
github.com/blang/semver/v4 v4.0.0 // indirect
31+
github.com/coreos/go-semver v0.3.0 // indirect
32+
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
33+
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
34+
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
35+
github.com/felixge/httpsnoop v1.0.1 // indirect
36+
github.com/go-logr/logr v1.2.3 // indirect
37+
github.com/go-openapi/jsonpointer v0.19.5 // indirect
38+
github.com/go-openapi/jsonreference v0.19.5 // indirect
39+
github.com/go-openapi/swag v0.19.14 // indirect
40+
github.com/gogo/protobuf v1.3.2 // indirect
41+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
42+
github.com/golang/protobuf v1.5.2 // indirect
43+
github.com/google/gnostic v0.5.7-v3refs // indirect
44+
github.com/google/go-cmp v0.5.8 // indirect
45+
github.com/google/gofuzz v1.1.0 // indirect
46+
github.com/google/uuid v1.1.2 // indirect
47+
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
48+
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
49+
github.com/imdario/mergo v0.3.12 // indirect
50+
github.com/inconshreveable/mousetrap v1.0.0 // indirect
51+
github.com/josharian/intern v1.0.0 // indirect
52+
github.com/json-iterator/go v1.1.12 // indirect
53+
github.com/mailru/easyjson v0.7.6 // indirect
54+
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
55+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
56+
github.com/modern-go/reflect2 v1.0.2 // indirect
57+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
58+
github.com/pkg/errors v0.9.1 // indirect
59+
github.com/pmezard/go-difflib v1.0.0 // indirect
60+
github.com/prometheus/client_model v0.2.0 // indirect
61+
github.com/prometheus/common v0.37.0 // indirect
62+
github.com/prometheus/procfs v0.8.0 // indirect
63+
github.com/spf13/cobra v1.4.0 // indirect
64+
github.com/spf13/pflag v1.0.5 // indirect
65+
github.com/stretchr/objx v0.4.0 // indirect
66+
go.etcd.io/etcd/api/v3 v3.5.4 // indirect
67+
go.etcd.io/etcd/client/pkg/v3 v3.5.4 // indirect
68+
go.etcd.io/etcd/client/v3 v3.5.4 // indirect
69+
go.opentelemetry.io/contrib v0.20.0 // indirect
70+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0 // indirect
71+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0 // indirect
72+
go.opentelemetry.io/otel v0.20.0 // indirect
73+
go.opentelemetry.io/otel/exporters/otlp v0.20.0 // indirect
74+
go.opentelemetry.io/otel/metric v0.20.0 // indirect
75+
go.opentelemetry.io/otel/sdk v0.20.0 // indirect
76+
go.opentelemetry.io/otel/sdk/export/metric v0.20.0 // indirect
77+
go.opentelemetry.io/otel/sdk/metric v0.20.0 // indirect
78+
go.opentelemetry.io/otel/trace v0.20.0 // indirect
79+
go.opentelemetry.io/proto/otlp v0.7.0 // indirect
80+
go.uber.org/atomic v1.7.0 // indirect
81+
go.uber.org/multierr v1.6.0 // indirect
82+
go.uber.org/zap v1.19.1 // indirect
83+
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
84+
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
85+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
86+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
87+
golang.org/x/text v0.3.7 // indirect
88+
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
89+
google.golang.org/appengine v1.6.7 // indirect
90+
google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 // indirect
91+
google.golang.org/grpc v1.47.0 // indirect
92+
google.golang.org/protobuf v1.28.1 // indirect
93+
gopkg.in/inf.v0 v0.9.1 // indirect
94+
gopkg.in/yaml.v2 v2.4.0 // indirect
95+
gopkg.in/yaml.v3 v3.0.1 // indirect
96+
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
97+
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.32 // indirect
98+
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
99+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
100+
sigs.k8s.io/yaml v1.3.0 // indirect
101+
)

0 commit comments

Comments
 (0)