Skip to content

Commit

Permalink
fix(deps): update module sigs.k8s.io/controller-runtime to v0.16.2
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored and rhmdnd committed Sep 19, 2023
1 parent f6bfa3f commit c107377
Show file tree
Hide file tree
Showing 50 changed files with 1,421 additions and 846 deletions.
18 changes: 11 additions & 7 deletions cmd/manager/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/controller-runtime/pkg/manager"
metrics "sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/webhook"

"github.com/ComplianceAsCode/compliance-operator/pkg/apis"
compv1alpha1 "github.com/ComplianceAsCode/compliance-operator/pkg/apis/compliance/v1alpha1"
Expand Down Expand Up @@ -191,9 +193,10 @@ func RunOperator(cmd *cobra.Command, args []string) {

// Unused, but kept until we decide what to do with multi-namespace support. See the creation of `mgr` below for
// the actual operator options configuration.
c := cache.Options{DefaultNamespaces: map[string]cache.Config{namespace: {}}}
options := manager.Options{
Namespace: namespace,
MetricsBindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort),
Cache: c,
Metrics: metrics.Options{BindAddress: metricsHost},
}
var namespaceList []string

Expand All @@ -205,8 +208,9 @@ func RunOperator(cmd *cobra.Command, args []string) {
// More Info: https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/cache#MultiNamespacedCacheBuilder
if strings.Contains(namespace, ",") {
// These are not applied because of the non-use of the `options` variable, so multi-namespace is probably non-functional.
options.Namespace = ""
options.NewCache = cache.MultiNamespacedCacheBuilder(namespaceList)
for _, ns := range namespaceList {
options.Cache.DefaultNamespaces[ns] = cache.Config{}
}
}
} else {
// NOTE(jaosorior): This will be used to set up the needed defaults
Expand All @@ -225,10 +229,10 @@ func RunOperator(cmd *cobra.Command, args []string) {
monitoringClient := monclientv1.NewForConfigOrDie(cfg)

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Namespace: namespace,
Cache: c,
Scheme: operatorScheme,
MetricsBindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort),
Port: 9443,
Metrics: metrics.Options{BindAddress: metricsHost},
WebhookServer: webhook.NewServer(webhook.Options{Port: 9443}),
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "81473831.openshift.io", // operator-sdk generated this for us
Expand Down
4 changes: 2 additions & 2 deletions cmd/manager/scap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ var _ = Describe("Testing fetching", func() {
scheme := scheme.Scheme
scheme.AddKnownTypes(mcfgv1.SchemeGroupVersion, &mcList, &mcList.Items[0])

client := fake.NewFakeClientWithScheme(scheme, &mcList)
client := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(&mcList).Build()
fakeClients = resourceFetcherClients{client: client}

fetchMcResources := []utils.ResourcePath{
Expand Down Expand Up @@ -690,7 +690,7 @@ var _ = Describe("Testing fetching", func() {
scheme := scheme.Scheme
scheme.AddKnownTypes(corev1.SchemeGroupVersion, &fakeNodeList, &fakeNodeList.Items[0])

client := fake.NewFakeClientWithScheme(scheme, &fakeNodeList)
client := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(&fakeNodeList).Build()
fakeClients = resourceFetcherClients{client: client}

expectedFiguredResources = []utils.ResourcePath{
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/wI2L/jsondiff v0.4.0
k8s.io/apimachinery v0.28.2
k8s.io/client-go v0.28.2
sigs.k8s.io/controller-runtime v0.15.0
sigs.k8s.io/controller-runtime v0.16.2
)

require (
Expand Down Expand Up @@ -70,7 +70,7 @@ require (
golang.org/x/term v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,8 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
gomodules.xyz/jsonpatch/v2 v2.3.0 h1:8NFhfS6gzxNqjLIYnZxg319wZ5Qjnx4m/CcX+Klzazc=
gomodules.xyz/jsonpatch/v2 v2.3.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
Expand Down Expand Up @@ -1564,6 +1566,8 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/controller-runtime v0.15.0 h1:ML+5Adt3qZnMSYxZ7gAverBLNPSMQEibtzAgp0UPojU=
sigs.k8s.io/controller-runtime v0.15.0/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk=
sigs.k8s.io/controller-runtime v0.16.2 h1:mwXAVuEk3EQf478PQwQ48zGOXvW27UJc8NHktQVuIPU=
sigs.k8s.io/controller-runtime v0.16.2/go.mod h1:vpMu3LpI5sYWtujJOa2uPK61nB5rbwlN7BAB8aSLvGU=
sigs.k8s.io/controller-tools v0.12.1 h1:GyQqxzH5wksa4n3YDIJdJJOopztR5VDM+7qsyg5yE4U=
sigs.k8s.io/controller-tools v0.12.1/go.mod h1:rXlpTfFHZMpZA8aGq9ejArgZiieHd+fkk/fTatY8A2M=
sigs.k8s.io/controller-tools v0.13.0 h1:NfrvuZ4bxyolhDBt/rCZhDnx3M2hzlhgo5n3Iv2RykI=
Expand Down
5 changes: 3 additions & 2 deletions pkg/profileparser/profileparser_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ var _ = BeforeSuite(func() {
objs = append(objs, &cmpv1alpha1.ProfileBundle{}, &cmpv1alpha1.Profile{}, &cmpv1alpha1.ProfileList{})

cmpScheme := k8sruntime.NewScheme()
_ = compapis.AddToScheme(cmpScheme)
client = fake.NewFakeClientWithScheme(cmpScheme)
err := compapis.AddToScheme(cmpScheme)
Expect(err).To(BeNil())
client = fake.NewClientBuilder().WithScheme(cmpScheme).Build()

brokenContentImagePath = os.Getenv("BROKEN_CONTENT_IMAGE")

Expand Down
27 changes: 27 additions & 0 deletions vendor/golang.org/x/exp/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions vendor/golang.org/x/exp/PATENTS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

94 changes: 94 additions & 0 deletions vendor/golang.org/x/exp/maps/maps.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions vendor/gomodules.xyz/jsonpatch/v2/jsonpatch.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package jsonpatch

import (
"bytes"
"encoding/json"
"fmt"
"reflect"
Expand Down Expand Up @@ -64,6 +65,9 @@ func NewOperation(op, path string, value interface{}) Operation {
//
// An error will be returned if any of the two documents are invalid.
func CreatePatch(a, b []byte) ([]Operation, error) {
if bytes.Equal(a, b) {
return []Operation{}, nil
}
var aI interface{}
var bI interface{}
err := json.Unmarshal(a, &aI)
Expand Down
6 changes: 4 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@ go.uber.org/zap/zapcore
go4.org/errorutil
# golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea
## explicit; go 1.20
golang.org/x/exp/maps
# golang.org/x/exp/typeparams v0.0.0-20230224173230-c95f2b4c22f2
## explicit; go 1.18
# golang.org/x/mod v0.12.0
Expand Down Expand Up @@ -914,7 +915,7 @@ golang.org/x/tools/internal/pkgbits
golang.org/x/tools/internal/tokeninternal
golang.org/x/tools/internal/typeparams
golang.org/x/tools/internal/typesinternal
# gomodules.xyz/jsonpatch/v2 v2.3.0
# gomodules.xyz/jsonpatch/v2 v2.4.0
## explicit; go 1.20
gomodules.xyz/jsonpatch/v2
# google.golang.org/appengine v1.6.7
Expand Down Expand Up @@ -1430,7 +1431,7 @@ k8s.io/utils/trace
## explicit
# mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d
## explicit; go 1.18
# sigs.k8s.io/controller-runtime v0.15.0
# sigs.k8s.io/controller-runtime v0.16.2
## explicit; go 1.20
sigs.k8s.io/controller-runtime
sigs.k8s.io/controller-runtime/pkg/builder
Expand Down Expand Up @@ -1466,6 +1467,7 @@ sigs.k8s.io/controller-runtime/pkg/log/zap
sigs.k8s.io/controller-runtime/pkg/manager
sigs.k8s.io/controller-runtime/pkg/manager/signals
sigs.k8s.io/controller-runtime/pkg/metrics
sigs.k8s.io/controller-runtime/pkg/metrics/server
sigs.k8s.io/controller-runtime/pkg/predicate
sigs.k8s.io/controller-runtime/pkg/ratelimiter
sigs.k8s.io/controller-runtime/pkg/reconcile
Expand Down
6 changes: 1 addition & 5 deletions vendor/sigs.k8s.io/controller-runtime/.golangci.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion vendor/sigs.k8s.io/controller-runtime/Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions vendor/sigs.k8s.io/controller-runtime/VERSIONING.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c107377

Please sign in to comment.