Skip to content

Commit 5726325

Browse files
🌱 Deprecate IP Family builtin variable (kubernetes-sigs#10554)
* Deprecate IP Family * Address comments
1 parent 233ee68 commit 5726325

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-9
lines changed

api/v1beta1/cluster_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,9 @@ func (c *Cluster) SetConditions(conditions Conditions) {
509509
}
510510

511511
// GetIPFamily returns a ClusterIPFamily from the configuration provided.
512-
// Note: IPFamily is not a concept in Kubernetes. It was originally introduced in CAPI for CAPD.
513-
// IPFamily may be dropped in a future release. More details at https://github.com/kubernetes-sigs/cluster-api/issues/7521
512+
//
513+
// Deprecated: IPFamily is not a concept in Kubernetes. It was originally introduced in CAPI for CAPD.
514+
// IPFamily will be dropped in a future release. More details at https://github.com/kubernetes-sigs/cluster-api/issues/7521
514515
func (c *Cluster) GetIPFamily() (ClusterIPFamily, error) {
515516
var podCIDRs, serviceCIDRs []string
516517
if c.Spec.ClusterNetwork != nil {

docs/book/src/tasks/experimental-features/cluster-class/write-clusterclass.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ referenced in patches:
535535
- `builtin.cluster.{name,namespace}`
536536
- `builtin.cluster.topology.{version,class}`
537537
- `builtin.cluster.network.{serviceDomain,services,pods,ipFamily}`
538+
- Note: ipFamily is deprecated and will be removed in a future release. see https://github.com/kubernetes-sigs/cluster-api/issues/7521.
538539
- `builtin.controlPlane.{replicas,version,name}`
539540
- Please note, these variables are only available when patching control plane or control plane
540541
machine templates.

exp/runtime/hooks/api/v1alpha1/topologymutation_variable_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ type ClusterNetworkBuiltins struct {
6262
// Pods is the network ranges from which Pod networks are allocated.
6363
Pods []string `json:"pods,omitempty"`
6464
// IPFamily is the IPFamily the Cluster is operating in. One of Invalid, IPv4, IPv6, DualStack.
65-
// Note: IPFamily is not a concept in Kubernetes. It was originally introduced in CAPI for CAPD.
66-
// IPFamily may be dropped in a future release. More details at https://github.com/kubernetes-sigs/cluster-api/issues/7521
65+
//
66+
// Deprecated: IPFamily is not a concept in Kubernetes. It was originally introduced in CAPI for CAPD.
67+
// IPFamily will be dropped in a future release. More details at https://github.com/kubernetes-sigs/cluster-api/issues/7521
6768
IPFamily string `json:"ipFamily,omitempty"`
6869
}
6970

exp/runtime/hooks/api/v1alpha1/zz_generated.openapi.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/controllers/topology/cluster/patches/variables/variables.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func Global(clusterTopology *clusterv1.Topology, cluster *clusterv1.Cluster, def
6868
},
6969
}
7070
if cluster.Spec.ClusterNetwork != nil {
71-
clusterNetworkIPFamily, _ := cluster.GetIPFamily()
71+
clusterNetworkIPFamily, _ := cluster.GetIPFamily() //nolint:staticcheck // We tolerate this until removal. See https://github.com/kubernetes-sigs/cluster-api/issues/7521.
7272
builtin.Cluster.Network = &runtimehooksv1.ClusterNetworkBuiltins{
7373
IPFamily: ipFamilyToString(clusterNetworkIPFamily),
7474
}

test/infrastructure/docker/internal/docker/loadbalancer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func NewLoadBalancer(ctx context.Context, cluster *clusterv1.Cluster, dockerClus
6565
return nil, err
6666
}
6767

68-
ipFamily, err := cluster.GetIPFamily()
68+
ipFamily, err := cluster.GetIPFamily() //nolint:staticcheck // We tolerate this until removal; after removal IPFamily will become an internal CAPD concept. See https://github.com/kubernetes-sigs/cluster-api/issues/7521.
6969
if err != nil {
7070
return nil, fmt.Errorf("create load balancer: %s", err)
7171
}

test/infrastructure/docker/internal/docker/machine.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func NewMachine(ctx context.Context, cluster *clusterv1.Cluster, machine string,
9292
return nil, err
9393
}
9494

95-
ipFamily, err := cluster.GetIPFamily()
95+
ipFamily, err := cluster.GetIPFamily() //nolint:staticcheck // We tolerate this until removal; after removal IPFamily will become an internal CAPD concept. See https://github.com/kubernetes-sigs/cluster-api/issues/7521.
9696
if err != nil {
9797
return nil, fmt.Errorf("create docker machine: %s", err)
9898
}
@@ -126,7 +126,7 @@ func ListMachinesByCluster(ctx context.Context, cluster *clusterv1.Cluster, labe
126126
return nil, err
127127
}
128128

129-
ipFamily, err := cluster.GetIPFamily()
129+
ipFamily, err := cluster.GetIPFamily() //nolint:staticcheck // We tolerate this until removal; after removal IPFamily will become an internal CAPD concept. See https://github.com/kubernetes-sigs/cluster-api/issues/7521.
130130
if err != nil {
131131
return nil, fmt.Errorf("list docker machines by cluster: %s", err)
132132
}

0 commit comments

Comments
 (0)