Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit 4775de1

Browse files
committed
standardize port and use in clusterctl
1 parent 62bb77e commit 4775de1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

cmd/clusterctl/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121

2222
"github.com/packethost/cluster-api-provider-packet/pkg/cloud/packet"
2323
"github.com/packethost/cluster-api-provider-packet/pkg/cloud/packet/deployer"
24+
"github.com/packethost/cluster-api-provider-packet/pkg/cloud/packet/util"
2425
"k8s.io/klog"
2526
"sigs.k8s.io/cluster-api/cmd/clusterctl/cmd"
2627
"sigs.k8s.io/cluster-api/pkg/apis/cluster/common"
@@ -39,6 +40,7 @@ func main() {
3940

4041
// get a deployer, which is needed at various stages
4142
deployer, err := deployer.New(deployer.Params{
43+
Port: util.ControlPort,
4244
Client: client,
4345
})
4446
if err != nil {

cmd/manager/main.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"github.com/packethost/cluster-api-provider-packet/pkg/cloud/packet/actuators/machine"
2727
"github.com/packethost/cluster-api-provider-packet/pkg/cloud/packet/actuators/machine/machineconfig"
2828
"github.com/packethost/cluster-api-provider-packet/pkg/cloud/packet/deployer"
29+
"github.com/packethost/cluster-api-provider-packet/pkg/cloud/packet/util"
2930
"k8s.io/klog"
3031
clusterapis "sigs.k8s.io/cluster-api/pkg/apis"
3132
"sigs.k8s.io/cluster-api/pkg/apis/cluster/common"
@@ -38,10 +39,6 @@ import (
3839
"sigs.k8s.io/controller-runtime/pkg/runtime/signals"
3940
)
4041

41-
const (
42-
controlPort = 6443
43-
)
44-
4542
func main() {
4643
klog.InitFlags(nil)
4744

@@ -79,7 +76,7 @@ func main() {
7976
// get a deployer, which is needed at various stages
8077
deployer, err := deployer.New(deployer.Params{
8178
Client: client,
82-
Port: controlPort,
79+
Port: util.ControlPort,
8380
})
8481
if err != nil {
8582
klog.Fatalf(err.Error())

pkg/cloud/packet/util/util.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const (
1515
clusterIDTag = "cluster-api-provider-packet:cluster-id"
1616
MasterTag = "kubernetes.io/role:master"
1717
WorkerTag = "kubernetes.io/role:node"
18+
ControlPort = 6443
1819
)
1920

2021
func MachineProviderFromProviderConfig(providerConfig clusterv1.ProviderSpec) (*packetconfigv1.PacketMachineProviderConfig, error) {

0 commit comments

Comments
 (0)