Skip to content

Commit 8c60b32

Browse files
authored
Merge pull request #8 from msherif1234/update-dependencies
Update dependencies
2 parents c91edf5 + 7f71813 commit 8c60b32

File tree

1,650 files changed

+118388
-66664
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,650 files changed

+118388
-66664
lines changed

cmd/bpfman-agent/main.go

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,30 @@ package main
1818

1919
import (
2020
"context"
21+
"crypto/tls"
2122
"flag"
2223
"fmt"
2324
"os"
2425

25-
"go.uber.org/zap/zapcore"
26-
_ "k8s.io/client-go/plugin/pkg/client/auth"
26+
bpfmaniov1alpha1 "github.com/bpfman/bpfman-operator/apis/v1alpha1"
27+
bpfmanagent "github.com/bpfman/bpfman-operator/controllers/bpfman-agent"
2728

29+
"github.com/bpfman/bpfman-operator/internal/conn"
30+
gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1"
31+
32+
"go.uber.org/zap/zapcore"
2833
"google.golang.org/grpc/credentials/insecure"
34+
v1 "k8s.io/api/core/v1"
2935
"k8s.io/apimachinery/pkg/runtime"
3036
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
3137
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
38+
_ "k8s.io/client-go/plugin/pkg/client/auth"
3239
ctrl "sigs.k8s.io/controller-runtime"
3340
"sigs.k8s.io/controller-runtime/pkg/client"
3441
"sigs.k8s.io/controller-runtime/pkg/healthz"
3542
"sigs.k8s.io/controller-runtime/pkg/log/zap"
36-
37-
bpfmaniov1alpha1 "github.com/bpfman/bpfman-operator/apis/v1alpha1"
38-
bpfmanagent "github.com/bpfman/bpfman-operator/controllers/bpfman-agent"
39-
40-
"github.com/bpfman/bpfman-operator/internal/conn"
41-
gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1"
42-
v1 "k8s.io/api/core/v1"
43+
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
44+
"sigs.k8s.io/controller-runtime/pkg/webhook"
4345
//+kubebuilder:scaffold:imports
4446
)
4547

@@ -59,8 +61,11 @@ func main() {
5961
var metricsAddr string
6062
var probeAddr string
6163
var opts zap.Options
64+
var enableHTTP2 bool
65+
6266
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8174", "The address the metric endpoint binds to.")
6367
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8175", "The address the probe endpoint binds to.")
68+
flag.BoolVar(&enableHTTP2, "enable-http2", enableHTTP2, "If HTTP/2 should be enabled for the metrics and webhook servers.")
6469
flag.Parse()
6570

6671
// Get the Log level for bpfman deployment where this pod is running
@@ -85,16 +90,32 @@ func main() {
8590
}
8691
}
8792

93+
disableHTTP2 := func(c *tls.Config) {
94+
if enableHTTP2 {
95+
return
96+
}
97+
c.NextProtos = []string{"http/1.1"}
98+
}
99+
88100
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
89101

90102
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
91-
Scheme: scheme,
92-
MetricsBindAddress: metricsAddr,
93-
Port: 9443,
103+
Scheme: scheme,
104+
Metrics: server.Options{
105+
BindAddress: metricsAddr,
106+
TLSOpts: []func(*tls.Config){disableHTTP2},
107+
},
108+
WebhookServer: webhook.NewServer(webhook.Options{
109+
Port: 9443,
110+
TLSOpts: []func(*tls.Config){disableHTTP2},
111+
}),
94112
HealthProbeBindAddress: probeAddr,
95113
LeaderElection: false,
96114
// Specify that Secrets's should not be cached.
97-
ClientDisableCacheFor: []client.Object{&v1.Secret{}},
115+
Client: client.Options{Cache: &client.CacheOptions{
116+
DisableFor: []client.Object{&v1.Secret{}},
117+
},
118+
},
98119
})
99120
if err != nil {
100121
setupLog.Error(err, "unable to start manager")

cmd/bpfman-operator/main.go

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,24 @@ limitations under the License.
1717
package main
1818

1919
import (
20+
"crypto/tls"
2021
"flag"
2122
"os"
2223

23-
"go.uber.org/zap/zapcore"
24-
_ "k8s.io/client-go/plugin/pkg/client/auth"
24+
bpfmaniov1alpha1 "github.com/bpfman/bpfman-operator/apis/v1alpha1"
25+
bpfmanoperator "github.com/bpfman/bpfman-operator/controllers/bpfman-operator"
26+
"github.com/bpfman/bpfman-operator/internal"
2527

28+
"go.uber.org/zap/zapcore"
2629
"k8s.io/apimachinery/pkg/runtime"
2730
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
2831
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
32+
_ "k8s.io/client-go/plugin/pkg/client/auth"
2933
ctrl "sigs.k8s.io/controller-runtime"
3034
"sigs.k8s.io/controller-runtime/pkg/healthz"
3135
"sigs.k8s.io/controller-runtime/pkg/log/zap"
32-
33-
bpfmaniov1alpha1 "github.com/bpfman/bpfman-operator/apis/v1alpha1"
34-
bpfmanoperator "github.com/bpfman/bpfman-operator/controllers/bpfman-operator"
35-
"github.com/bpfman/bpfman-operator/internal"
36+
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
37+
"sigs.k8s.io/controller-runtime/pkg/webhook"
3638
//+kubebuilder:scaffold:imports
3739
)
3840

@@ -52,11 +54,13 @@ func main() {
5254
var enableLeaderElection bool
5355
var probeAddr string
5456
var opts zap.Options
57+
var enableHTTP2 bool
5558
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8174", "The address the metric endpoint binds to.")
5659
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8175", "The address the probe endpoint binds to.")
5760
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
5861
"Enable leader election for controller manager. "+
5962
"Enabling this will ensure there is only one active controller manager.")
63+
flag.BoolVar(&enableHTTP2, "enable-http2", enableHTTP2, "If HTTP/2 should be enabled for the metrics and webhook servers.")
6064
flag.Parse()
6165

6266
// Get the Log level for bpfman deployment where this pod is running
@@ -81,12 +85,25 @@ func main() {
8185
}
8286
}
8387

88+
disableHTTP2 := func(c *tls.Config) {
89+
if enableHTTP2 {
90+
return
91+
}
92+
c.NextProtos = []string{"http/1.1"}
93+
}
94+
8495
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
8596

8697
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
87-
Scheme: scheme,
88-
MetricsBindAddress: metricsAddr,
89-
Port: 9443,
98+
Scheme: scheme,
99+
Metrics: server.Options{
100+
BindAddress: metricsAddr,
101+
TLSOpts: []func(*tls.Config){disableHTTP2},
102+
},
103+
WebhookServer: webhook.NewServer(webhook.Options{
104+
Port: 9443,
105+
TLSOpts: []func(*tls.Config){disableHTTP2},
106+
}),
90107
HealthProbeBindAddress: probeAddr,
91108
LeaderElection: enableLeaderElection,
92109
LeaderElectionID: "8730d955.bpfman.io",

controllers/bpfman-agent/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ func (r *ReconcilerCommon) updateStatus(ctx context.Context, bpfProgram *bpfmani
478478
meta.SetStatusCondition(&bpfProgram.Status.Conditions, cond.Condition())
479479

480480
r.Logger.V(1).Info("Updating bpfProgram condition", "bpfProgram", bpfProgram.Name, "condition", cond.Condition().Type)
481-
if err := r.Status().Update(ctx, bpfProgram); err != nil {
481+
if err := r.Update(ctx, bpfProgram); err != nil {
482482
r.Logger.Error(err, "failed to set bpfProgram object status")
483483
}
484484

controllers/bpfman-agent/fentry-program.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import (
3434
"sigs.k8s.io/controller-runtime/pkg/handler"
3535
"sigs.k8s.io/controller-runtime/pkg/log"
3636
"sigs.k8s.io/controller-runtime/pkg/predicate"
37-
"sigs.k8s.io/controller-runtime/pkg/source"
3837
)
3938

4039
//+kubebuilder:rbac:groups=bpfman.io,resources=fentryprograms,verbs=get;list;watch
@@ -98,7 +97,7 @@ func (r *FentryProgramReconciler) SetupWithManager(mgr ctrl.Manager) error {
9897
// make the FentryProgram no longer select the Node. Additionally only
9998
// care about node events specific to our node
10099
Watches(
101-
&source.Kind{Type: &v1.Node{}},
100+
&v1.Node{},
102101
&handler.EnqueueRequestForObject{},
103102
builder.WithPredicates(predicate.And(predicate.LabelChangedPredicate{}, nodePredicate(r.NodeName))),
104103
).

controllers/bpfman-agent/fexit-program.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import (
3434
"sigs.k8s.io/controller-runtime/pkg/handler"
3535
"sigs.k8s.io/controller-runtime/pkg/log"
3636
"sigs.k8s.io/controller-runtime/pkg/predicate"
37-
"sigs.k8s.io/controller-runtime/pkg/source"
3837
)
3938

4039
//+kubebuilder:rbac:groups=bpfman.io,resources=fexitprograms,verbs=get;list;watch
@@ -98,7 +97,7 @@ func (r *FexitProgramReconciler) SetupWithManager(mgr ctrl.Manager) error {
9897
// make the FexitProgram no longer select the Node. Additionally only
9998
// care about node events specific to our node
10099
Watches(
101-
&source.Kind{Type: &v1.Node{}},
100+
&v1.Node{},
102101
&handler.EnqueueRequestForObject{},
103102
builder.WithPredicates(predicate.And(predicate.LabelChangedPredicate{}, nodePredicate(r.NodeName))),
104103
).

controllers/bpfman-agent/kprobe-program.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import (
3434
"sigs.k8s.io/controller-runtime/pkg/handler"
3535
"sigs.k8s.io/controller-runtime/pkg/log"
3636
"sigs.k8s.io/controller-runtime/pkg/predicate"
37-
"sigs.k8s.io/controller-runtime/pkg/source"
3837
)
3938

4039
//+kubebuilder:rbac:groups=bpfman.io,resources=kprobeprograms,verbs=get;list;watch
@@ -98,7 +97,7 @@ func (r *KprobeProgramReconciler) SetupWithManager(mgr ctrl.Manager) error {
9897
// make the KprobeProgram no longer select the Node. Additionally only
9998
// care about node events specific to our node
10099
Watches(
101-
&source.Kind{Type: &v1.Node{}},
100+
&v1.Node{},
102101
&handler.EnqueueRequestForObject{},
103102
builder.WithPredicates(predicate.And(predicate.LabelChangedPredicate{}, nodePredicate(r.NodeName))),
104103
).

controllers/bpfman-agent/tc-program.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,15 @@ import (
2222

2323
"k8s.io/apimachinery/pkg/types"
2424

25+
bpfmaniov1alpha1 "github.com/bpfman/bpfman-operator/apis/v1alpha1"
26+
bpfmanagentinternal "github.com/bpfman/bpfman-operator/controllers/bpfman-agent/internal"
27+
"github.com/bpfman/bpfman-operator/internal"
2528
ctrl "sigs.k8s.io/controller-runtime"
2629
"sigs.k8s.io/controller-runtime/pkg/builder"
2730
"sigs.k8s.io/controller-runtime/pkg/client"
2831
"sigs.k8s.io/controller-runtime/pkg/handler"
2932
"sigs.k8s.io/controller-runtime/pkg/log"
3033
"sigs.k8s.io/controller-runtime/pkg/predicate"
31-
"sigs.k8s.io/controller-runtime/pkg/source"
32-
33-
bpfmaniov1alpha1 "github.com/bpfman/bpfman-operator/apis/v1alpha1"
34-
bpfmanagentinternal "github.com/bpfman/bpfman-operator/controllers/bpfman-agent/internal"
35-
"github.com/bpfman/bpfman-operator/internal"
3634

3735
gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1"
3836
v1 "k8s.io/api/core/v1"
@@ -145,7 +143,7 @@ func (r *TcProgramReconciler) SetupWithManager(mgr ctrl.Manager) error {
145143
// make the TcProgram no longer select the Node. Additionally only
146144
// care about events specific to our node
147145
Watches(
148-
&source.Kind{Type: &v1.Node{}},
146+
&v1.Node{},
149147
&handler.EnqueueRequestForObject{},
150148
builder.WithPredicates(predicate.And(predicate.LabelChangedPredicate{}, nodePredicate(r.NodeName))),
151149
).

controllers/bpfman-agent/tracepoint-program.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,14 @@ import (
2323

2424
"k8s.io/apimachinery/pkg/types"
2525

26+
bpfmaniov1alpha1 "github.com/bpfman/bpfman-operator/apis/v1alpha1"
27+
bpfmanagentinternal "github.com/bpfman/bpfman-operator/controllers/bpfman-agent/internal"
2628
ctrl "sigs.k8s.io/controller-runtime"
2729
"sigs.k8s.io/controller-runtime/pkg/builder"
2830
"sigs.k8s.io/controller-runtime/pkg/client"
2931
"sigs.k8s.io/controller-runtime/pkg/handler"
3032
"sigs.k8s.io/controller-runtime/pkg/log"
3133
"sigs.k8s.io/controller-runtime/pkg/predicate"
32-
"sigs.k8s.io/controller-runtime/pkg/source"
33-
34-
bpfmaniov1alpha1 "github.com/bpfman/bpfman-operator/apis/v1alpha1"
35-
bpfmanagentinternal "github.com/bpfman/bpfman-operator/controllers/bpfman-agent/internal"
3634

3735
internal "github.com/bpfman/bpfman-operator/internal"
3836
gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1"
@@ -100,7 +98,7 @@ func (r *TracepointProgramReconciler) SetupWithManager(mgr ctrl.Manager) error {
10098
// make the TracepointProgram no longer select the Node. Additionally only
10199
// care about node events specific to our node
102100
Watches(
103-
&source.Kind{Type: &v1.Node{}},
101+
&v1.Node{},
104102
&handler.EnqueueRequestForObject{},
105103
builder.WithPredicates(predicate.And(predicate.LabelChangedPredicate{}, nodePredicate(r.NodeName))),
106104
).

controllers/bpfman-agent/uprobe-program.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,14 @@ import (
2424

2525
"k8s.io/apimachinery/pkg/types"
2626

27+
bpfmaniov1alpha1 "github.com/bpfman/bpfman-operator/apis/v1alpha1"
28+
bpfmanagentinternal "github.com/bpfman/bpfman-operator/controllers/bpfman-agent/internal"
2729
ctrl "sigs.k8s.io/controller-runtime"
2830
"sigs.k8s.io/controller-runtime/pkg/builder"
2931
"sigs.k8s.io/controller-runtime/pkg/client"
3032
"sigs.k8s.io/controller-runtime/pkg/handler"
3133
"sigs.k8s.io/controller-runtime/pkg/log"
3234
"sigs.k8s.io/controller-runtime/pkg/predicate"
33-
"sigs.k8s.io/controller-runtime/pkg/source"
34-
35-
bpfmaniov1alpha1 "github.com/bpfman/bpfman-operator/apis/v1alpha1"
36-
bpfmanagentinternal "github.com/bpfman/bpfman-operator/controllers/bpfman-agent/internal"
3735

3836
internal "github.com/bpfman/bpfman-operator/internal"
3937
gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1"
@@ -102,13 +100,13 @@ func (r *UprobeProgramReconciler) SetupWithManager(mgr ctrl.Manager) error {
102100
// for when uprobes are attached inside containers. In both cases, only
103101
// care about events specific to our node
104102
Watches(
105-
&source.Kind{Type: &v1.Node{}},
103+
&v1.Node{},
106104
&handler.EnqueueRequestForObject{},
107105
builder.WithPredicates(predicate.And(predicate.LabelChangedPredicate{}, nodePredicate(r.NodeName))),
108106
).
109107
// Watch for changes in Pod resources in case we are using a container selector.
110108
Watches(
111-
&source.Kind{Type: &v1.Pod{}},
109+
&v1.Pod{},
112110
&handler.EnqueueRequestForObject{},
113111
builder.WithPredicates(podOnNodePredicate(r.NodeName)),
114112
).

controllers/bpfman-agent/xdp-program.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@ import (
2020
"context"
2121
"fmt"
2222

23+
bpfmaniov1alpha1 "github.com/bpfman/bpfman-operator/apis/v1alpha1"
24+
bpfmanagentinternal "github.com/bpfman/bpfman-operator/controllers/bpfman-agent/internal"
25+
internal "github.com/bpfman/bpfman-operator/internal"
2326
ctrl "sigs.k8s.io/controller-runtime"
2427
"sigs.k8s.io/controller-runtime/pkg/builder"
2528
"sigs.k8s.io/controller-runtime/pkg/client"
2629
"sigs.k8s.io/controller-runtime/pkg/handler"
2730
"sigs.k8s.io/controller-runtime/pkg/log"
2831
"sigs.k8s.io/controller-runtime/pkg/predicate"
29-
"sigs.k8s.io/controller-runtime/pkg/source"
30-
31-
bpfmaniov1alpha1 "github.com/bpfman/bpfman-operator/apis/v1alpha1"
32-
bpfmanagentinternal "github.com/bpfman/bpfman-operator/controllers/bpfman-agent/internal"
33-
internal "github.com/bpfman/bpfman-operator/internal"
3432

3533
gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1"
3634
v1 "k8s.io/api/core/v1"
@@ -129,7 +127,7 @@ func (r *XdpProgramReconciler) SetupWithManager(mgr ctrl.Manager) error {
129127
// make the XdpProgram no longer select the Node. Additionally only
130128
// care about node events specific to our node
131129
Watches(
132-
&source.Kind{Type: &v1.Node{}},
130+
&v1.Node{},
133131
&handler.EnqueueRequestForObject{},
134132
builder.WithPredicates(predicate.And(predicate.LabelChangedPredicate{}, nodePredicate(r.NodeName))),
135133
).

controllers/bpfman-operator/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func (r *ReconcilerCommon) updateCondition(ctx context.Context, obj client.Objec
220220

221221
meta.SetStatusCondition(conditions, cond.Condition(message))
222222

223-
if err := r.Status().Update(ctx, obj); err != nil {
223+
if err := r.Update(ctx, obj); err != nil {
224224
r.Logger.V(1).Info("failed to set *Program object status...requeuing")
225225
return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil
226226
}

controllers/bpfman-operator/fentry-program.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,11 @@ import (
2424
ctrl "sigs.k8s.io/controller-runtime"
2525
"sigs.k8s.io/controller-runtime/pkg/builder"
2626

27+
bpfmaniov1alpha1 "github.com/bpfman/bpfman-operator/apis/v1alpha1"
28+
"github.com/bpfman/bpfman-operator/internal"
2729
"sigs.k8s.io/controller-runtime/pkg/handler"
2830
"sigs.k8s.io/controller-runtime/pkg/log"
2931
"sigs.k8s.io/controller-runtime/pkg/predicate"
30-
"sigs.k8s.io/controller-runtime/pkg/source"
31-
32-
bpfmaniov1alpha1 "github.com/bpfman/bpfman-operator/apis/v1alpha1"
33-
"github.com/bpfman/bpfman-operator/internal"
3432
)
3533

3634
//+kubebuilder:rbac:groups=bpfman.io,resources=fentryprograms,verbs=get;list;watch;create;update;patch;delete
@@ -55,7 +53,7 @@ func (r *FentryProgramReconciler) SetupWithManager(mgr ctrl.Manager) error {
5553
For(&bpfmaniov1alpha1.FentryProgram{}).
5654
// Watch bpfPrograms which are owned by FentryPrograms
5755
Watches(
58-
&source.Kind{Type: &bpfmaniov1alpha1.BpfProgram{}},
56+
&bpfmaniov1alpha1.BpfProgram{},
5957
&handler.EnqueueRequestForObject{},
6058
builder.WithPredicates(predicate.And(statusChangedPredicate(), internal.BpfProgramTypePredicate(internal.FentryString))),
6159
).

0 commit comments

Comments
 (0)