Skip to content

Commit a6ff2ca

Browse files
committed
convert pointer to ptr
Signed-off-by: Kevin <[email protected]>
1 parent c1db7db commit a6ff2ca

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

main.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import (
4141
"k8s.io/client-go/rest"
4242
configv1alpha1 "k8s.io/component-base/config/v1alpha1"
4343
"k8s.io/klog/v2"
44-
"k8s.io/utils/pointer"
44+
"k8s.io/utils/ptr"
4545
ctrl "sigs.k8s.io/controller-runtime"
4646
"sigs.k8s.io/controller-runtime/pkg/healthz"
4747
"sigs.k8s.io/controller-runtime/pkg/log/zap"
@@ -102,8 +102,8 @@ func main() {
102102

103103
cfg := &config.CodeFlareOperatorConfiguration{
104104
ClientConnection: &config.ClientConnection{
105-
QPS: pointer.Float32(50),
106-
Burst: pointer.Int32(100),
105+
QPS: ptr.To(float32(50)),
106+
Burst: ptr.To(int32(100)),
107107
},
108108
ControllerManager: config.ControllerManager{
109109
Metrics: config.MetricsConfiguration{
@@ -117,7 +117,7 @@ func main() {
117117
LeaderElection: &configv1alpha1.LeaderElectionConfiguration{},
118118
},
119119
KubeRay: &config.KubeRayConfiguration{
120-
RayDashboardOAuthEnabled: pointer.Bool(true),
120+
RayDashboardOAuthEnabled: ptr.To(true),
121121
},
122122
}
123123

@@ -131,15 +131,15 @@ func main() {
131131

132132
exitOnError(loadIntoOrCreate(ctx, kubeClient, namespaceOrDie(), configMapName, cfg), "unable to initialise configuration")
133133

134-
kubeConfig.Burst = int(pointer.Int32Deref(cfg.ClientConnection.Burst, int32(rest.DefaultBurst)))
135-
kubeConfig.QPS = pointer.Float32Deref(cfg.ClientConnection.QPS, rest.DefaultQPS)
134+
kubeConfig.Burst = int(ptr.Deref(cfg.ClientConnection.Burst, int32(rest.DefaultBurst)))
135+
kubeConfig.QPS = ptr.Deref(cfg.ClientConnection.QPS, rest.DefaultQPS)
136136
setupLog.V(2).Info("REST client", "qps", kubeConfig.QPS, "burst", kubeConfig.Burst)
137137

138138
mgr, err := ctrl.NewManager(kubeConfig, ctrl.Options{
139139
Scheme: scheme,
140140
MetricsBindAddress: cfg.Metrics.BindAddress,
141141
HealthProbeBindAddress: cfg.Health.BindAddress,
142-
LeaderElection: pointer.BoolDeref(cfg.LeaderElection.LeaderElect, false),
142+
LeaderElection: ptr.Deref(cfg.LeaderElection.LeaderElect, false),
143143
LeaderElectionID: cfg.LeaderElection.ResourceName,
144144
LeaderElectionNamespace: cfg.LeaderElection.ResourceNamespace,
145145
LeaderElectionResourceLock: cfg.LeaderElection.ResourceLock,

0 commit comments

Comments
 (0)