Skip to content

Commit cf0b3f6

Browse files
committed
Change names
1 parent 73fca07 commit cf0b3f6

File tree

8 files changed

+31
-29
lines changed

8 files changed

+31
-29
lines changed

cloud/linode/cloud.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ var Options struct {
3939
EnableRouteController bool
4040
EnableTokenHealthChecker bool
4141
// Deprecated: use VPCNames instead
42-
VPCName string
43-
VPCNames string
44-
SubnetNames string
45-
LoadBalancerType string
46-
BGPNodeSelector string
47-
IpHolderSuffix string
48-
LinodeExternalNetwork *net.IPNet
49-
NodeBalancerTags []string
50-
DefaultNBType string
51-
GlobalStopChannel chan<- struct{}
52-
UseIPv6ForLoadBalancers bool
42+
VPCName string
43+
VPCNames string
44+
SubnetNames string
45+
LoadBalancerType string
46+
BGPNodeSelector string
47+
IpHolderSuffix string
48+
LinodeExternalNetwork *net.IPNet
49+
NodeBalancerTags []string
50+
DefaultNBType string
51+
GlobalStopChannel chan<- struct{}
52+
EnableIPv6ForLoadBalancers bool
5353
}
5454

5555
type linodeCloud struct {

cloud/linode/loadbalancers.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ func makeLoadBalancerStatus(service *v1.Service, nb *linodego.NodeBalancer) *v1.
10041004
}
10051005

10061006
// Check for per-service IPv6 annotation first, then fall back to global setting
1007-
useIPv6 := getServiceBoolAnnotation(service, annotations.AnnLinodeEnableIPv6Ingress) || Options.UseIPv6ForLoadBalancers
1007+
useIPv6 := getServiceBoolAnnotation(service, annotations.AnnLinodeEnableIPv6Ingress) || Options.EnableIPv6ForLoadBalancers
10081008

10091009
// When IPv6 is enabled (either per-service or globally), include both IPv4 and IPv6
10101010
if useIPv6 && nb.IPv6 != nil && *nb.IPv6 != "" {

cloud/linode/loadbalancers_test.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -3100,8 +3100,8 @@ func testMakeLoadBalancerStatusWithIPv6(t *testing.T, client *linodego.Client, _
31003100
},
31013101
}
31023102

3103-
// Test with UseIPv6ForLoadBalancers = false (default)
3104-
Options.UseIPv6ForLoadBalancers = false
3103+
// Test with EnableIPv6ForLoadBalancers = false (default)
3104+
Options.EnableIPv6ForLoadBalancers = false
31053105
expectedStatus := &v1.LoadBalancerStatus{
31063106
Ingress: []v1.LoadBalancerIngress{{
31073107
Hostname: hostname,
@@ -3110,11 +3110,11 @@ func testMakeLoadBalancerStatusWithIPv6(t *testing.T, client *linodego.Client, _
31103110
}
31113111
status := makeLoadBalancerStatus(svc, nb)
31123112
if !reflect.DeepEqual(status, expectedStatus) {
3113-
t.Errorf("expected status with UseIPv6ForLoadBalancers=false to be %#v; got %#v", expectedStatus, status)
3113+
t.Errorf("expected status with EnableIPv6ForLoadBalancers=false to be %#v; got %#v", expectedStatus, status)
31143114
}
31153115

3116-
// Test with UseIPv6ForLoadBalancers = true
3117-
Options.UseIPv6ForLoadBalancers = true
3116+
// Test with EnableIPv6ForLoadBalancers = true
3117+
Options.EnableIPv6ForLoadBalancers = true
31183118
expectedStatus = &v1.LoadBalancerStatus{
31193119
Ingress: []v1.LoadBalancerIngress{
31203120
{
@@ -3129,12 +3129,12 @@ func testMakeLoadBalancerStatusWithIPv6(t *testing.T, client *linodego.Client, _
31293129
}
31303130
status = makeLoadBalancerStatus(svc, nb)
31313131
if !reflect.DeepEqual(status, expectedStatus) {
3132-
t.Errorf("expected status with UseIPv6ForLoadBalancers=true to be %#v; got %#v", expectedStatus, status)
3132+
t.Errorf("expected status with EnableIPv6ForLoadBalancers=true to be %#v; got %#v", expectedStatus, status)
31333133
}
31343134

31353135
// Test with per-service annotation
31363136
// Reset the global flag to false and set the annotation
3137-
Options.UseIPv6ForLoadBalancers = false
3137+
Options.EnableIPv6ForLoadBalancers = false
31383138
svc.Annotations[annotations.AnnLinodeEnableIPv6Ingress] = "true"
31393139

31403140
// Expect the same result as when the global flag is enabled
@@ -3145,7 +3145,7 @@ func testMakeLoadBalancerStatusWithIPv6(t *testing.T, client *linodego.Client, _
31453145
}
31463146

31473147
// Reset the flag to its default value
3148-
Options.UseIPv6ForLoadBalancers = false
3148+
Options.EnableIPv6ForLoadBalancers = false
31493149
}
31503150

31513151
func testMakeLoadBalancerStatusEnvVar(t *testing.T, client *linodego.Client, _ *fakeAPI) {

deploy/chart/templates/daemonset.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ spec:
100100
{{- if .Values.defaultNBType }}
101101
- --default-nodebalancer-type={{ .Values.defaultNBType }}
102102
{{- end }}
103-
{{- if .Values.useIPv6ForLoadBalancers }}
104-
- --use-ipv6-for-loadbalancers=true
103+
{{- if .Values.enableIPv6ForLoadBalancers }}
104+
- --enable-ipv6-for-loadbalancers=true
105105
{{- end }}
106106
{{- with .Values.containerSecurityContext }}
107107
securityContext:

deploy/chart/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ tolerations:
8989
# Enable IPv6 ingress addresses for LoadBalancer services
9090
# When enabled, both IPv4 and IPv6 addresses will be included in the LoadBalancer status for all services
9191
# This can also be controlled per-service using the "service.beta.kubernetes.io/linode-loadbalancer-enable-ipv6-ingress" annotation
92-
# useIPv6ForLoadBalancers: true
92+
# enableIPv6ForLoadBalancers: true
9393

9494
# This section adds the ability to pass environment variables to adjust CCM defaults
9595
# https://github.com/linode/linode-cloud-controller-manager/blob/master/cloud/linode/loadbalancers.go

docs/configuration/environment.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The CCM supports the following flags:
4444
| `--ip-holder-suffix` | `""` | Suffix to append to the IP holder name when using shared IP fail-over with BGP |
4545
| `--default-nodebalancer-type` | `common` | Default type of NodeBalancer to create (options: common, premium) |
4646
| `--nodebalancer-tags` | `[]` | Linode tags to apply to all NodeBalancers |
47-
| `--use-ipv6-for-loadbalancers` | `false` | Set both IPv4 and IPv6 addresses for all LoadBalancer services (when disabled, only IPv4 is used) |
47+
| `--enable-ipv6-for-loadbalancers` | `false` | Set both IPv4 and IPv6 addresses for all LoadBalancer services (when disabled, only IPv4 is used). This can also be configured per-service using the `service.beta.kubernetes.io/linode-loadbalancer-enable-ipv6-ingress` annotation. |
4848

4949
## Configuration Methods
5050

@@ -55,7 +55,7 @@ env:
5555
- name: LINODE_INSTANCE_CACHE_TTL
5656
value: "30"
5757
args:
58-
- --use-ipv6-for-loadbalancers
58+
- --enable-ipv6-for-loadbalancers
5959
- --enable-route-controller
6060
```
6161
@@ -71,7 +71,7 @@ spec:
7171
- name: LINODE_INSTANCE_CACHE_TTL
7272
value: "30"
7373
args:
74-
- --use-ipv6-for-loadbalancers
74+
- --enable-ipv6-for-loadbalancers
7575
- --enable-route-controller
7676
```
7777

docs/configuration/loadbalancer.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ For more details, see [Linode NodeBalancer Documentation](https://www.linode.com
2020

2121
### IPv6 Support
2222

23-
NodeBalancers support both IPv4 and IPv6 ingress addresses. By default, the CCM uses sets IPv4 address for LoadBalancer services. You can configure the CCM to set both IPv4 and IPv6 addresses by setting the `use-ipv6-for-loadbalancers` flag:
23+
NodeBalancers support both IPv4 and IPv6 ingress addresses. By default, the CCM uses only IPv4 address for LoadBalancer services.
24+
25+
You can enable IPv6 addresses globally for all services by setting the `enable-ipv6-for-loadbalancers` flag:
2426

2527
```yaml
2628
spec:
@@ -29,7 +31,7 @@ spec:
2931
containers:
3032
- name: ccm-linode
3133
args:
32-
- --use-ipv6-for-loadbalancers
34+
- --enable-ipv6-for-loadbalancers=true
3335
```
3436
3537
Alternatively, you can enable IPv6 addresses for individual services using the annotation:

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func main() {
9191
command.Flags().StringVar(&linode.Options.IpHolderSuffix, "ip-holder-suffix", "", "suffix to append to the ip holder name when using shared IP fail-over with BGP (e.g. ip-holder-suffix=my-cluster-name")
9292
command.Flags().StringVar(&linode.Options.DefaultNBType, "default-nodebalancer-type", string(linodego.NBTypeCommon), "default type of NodeBalancer to create (options: common, premium)")
9393
command.Flags().StringSliceVar(&linode.Options.NodeBalancerTags, "nodebalancer-tags", []string{}, "Linode tags to apply to all NodeBalancers")
94-
command.Flags().BoolVar(&linode.Options.UseIPv6ForLoadBalancers, "use-ipv6-for-loadbalancers", false, "set both IPv4 and IPv6 addresses for all LoadBalancer services (when disabled, only IPv4 is used)")
94+
command.Flags().BoolVar(&linode.Options.EnableIPv6ForLoadBalancers, "enable-ipv6-for-loadbalancers", false, "set both IPv4 and IPv6 addresses for all LoadBalancer services (when disabled, only IPv4 is used)")
9595

9696
// Set static flags
9797
command.Flags().VisitAll(func(fl *pflag.Flag) {

0 commit comments

Comments
 (0)