Skip to content

Commit b1fd2ae

Browse files
committed
convert pointer to ptr
Signed-off-by: Kevin <kpostlet@redhat.com>
1 parent 0822f54 commit b1fd2ae

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
IngressDomain: "",
122122
},
123123
}
@@ -132,15 +132,15 @@ func main() {
132132

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

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

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

0 commit comments

Comments
 (0)