Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
Signed-off-by: Kfir Toledo <[email protected]>
  • Loading branch information
kfirtoledo committed Mar 11, 2024
1 parent 849ff5a commit 2f1846b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions cmd/cl-adm/cmd/deploy/deploy_peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ func (o *PeerOptions) AddFlags(fs *pflag.FlagSet) {
"If true, it will also deploy the ClusterLink instance CRD, which will create the ClusterLink components.")
fs.StringVar(&o.Ingress, "ingress", string(apis.IngressTypeLoadBalancer), "Represents the type of service used"+
"to expose the ClusterLink deployment (LoadBalancer/NodePort/none). This option is only valid if --autostart is set.")
fs.Uint16Var(&o.IngressPort, "ingress-port", apis.ExternalDefaultPort,
fs.Uint16Var(&o.IngressPort, "ingress-port", apis.DefaultExternalPort,
"Represents the ingress port. By default it is set to 443 for LoadBalancer"+
" and a random port in range (3000 to 32767) for NodePort. This option is only valid if --autostart is set.")
" and a random port in range (30000 to 32767) for NodePort. This option is only valid if --autostart is set.")
}

// RequiredFlags are the names of flags that must be explicitly specified.
Expand Down Expand Up @@ -168,7 +168,7 @@ func (o *PeerOptions) Run() error {
Namespace: o.Namespace,
IngressType: o.Ingress,
}
if o.IngressPort != apis.ExternalDefaultPort {
if o.IngressPort != apis.DefaultExternalPort {
cfg.IngressPort = o.IngressPort
}
instance, err := platform.K8SClusterLinkInstanceConfig(cfg, "cl-instance")
Expand All @@ -184,10 +184,10 @@ func (o *PeerOptions) Run() error {
}
} else {
if o.Ingress != string(apis.IngressTypeLoadBalancer) {
fmt.Println("flag --autostart is not set, ignore --ingres flag")
fmt.Println("flag --autostart is not set, ignoring --ingres flag")
}
if o.IngressPort != apis.ExternalDefaultPort {
fmt.Println("flag --autostart is not set, ignore --ingres-port flag")
if o.IngressPort != apis.DefaultExternalPort {
fmt.Println("flag --autostart is not set, ignoring --ingres-port flag")
}
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/clusterlink.net/v1alpha1/instance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ const (
)

const (
// ExternalDefaultPort represents the default value for the external ingress service of the LoadBalancer type.
ExternalDefaultPort = 443
// DefaultExternalPort represents the default value for the external ingress service.
DefaultExternalPort = 443
)

// ComponentStatus defines the status of component in ClusterLink.
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/controller/instance_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ func (r *InstanceReconciler) createExternalService(ctx context.Context, instance
},
Ports: []corev1.ServicePort{
{
Port: clusterlink.ExternalDefaultPort,
Port: clusterlink.DefaultExternalPort,
TargetPort: intstr.FromInt(dpapi.ListenPort),
Name: "https",
},
Expand Down

0 comments on commit 2f1846b

Please sign in to comment.