Skip to content

Commit c2267df

Browse files
committed
fix(operator): Make default registry REST to IPv4 and dualStack opt-in
Make unset or false dualStack render an explicit 0.0.0.0 host flag. Only dualStack=true selects the bare IPv6 wildcard, aligning registry REST defaults with other host-flag servers. Signed-off-by: dbbvitor <[email protected]>
1 parent 21b9c8b commit c2267df

4 files changed

Lines changed: 15 additions & 20 deletions

File tree

‎infra/feast-operator/api/v1/featurestore_types.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ type ServerConfigs struct {
899899
Metrics *bool `json:"metrics,omitempty"`
900900
// DualStack binds the server to the IPv6 wildcard address instead of 0.0.0.0,
901901
// which serves both IPv6 and IPv4 clients on Linux. Enable it on IPv6-only or dual-stack clusters.
902-
// The registry's REST server binds dual-stack by default; set this to false to opt out to 0.0.0.0-only.
902+
// Unset or false binds 0.0.0.0 (IPv4 only) for every server that takes a host flag, including the registry's REST server.
903903
// +optional
904904
DualStack *bool `json:"dualStack,omitempty"`
905905
// VolumeMounts defines the list of volumes that should be mounted into the feast container.

‎infra/feast-operator/docs/api/markdown/ref.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ Allowed values: "debug", "info", "warning", "error", "critical". |
10251025
| `metrics` _boolean_ | Metrics exposes Prometheus-compatible metrics for the Feast server when enabled. |
10261026
| `dualStack` _boolean_ | DualStack binds the server to the IPv6 wildcard address instead of 0.0.0.0,
10271027
which serves both IPv6 and IPv4 clients on Linux. Enable it on IPv6-only or dual-stack clusters.
1028-
The registry's REST server binds dual-stack by default; set this to false to opt out to 0.0.0.0-only. |
1028+
Unset or false binds 0.0.0.0 (IPv4 only) for every server that takes a host flag, including the registry's REST server. |
10291029
| `volumeMounts` _[VolumeMount](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#volumemount-v1-core) array_ | VolumeMounts defines the list of volumes that should be mounted into the feast container.
10301030
This allows attaching persistent storage, config files, secrets, or other resources
10311031
required by the Feast components. Ensure that each volume mount has a corresponding
@@ -1127,7 +1127,7 @@ Allowed values: "debug", "info", "warning", "error", "critical". |
11271127
| `metrics` _boolean_ | Metrics exposes Prometheus-compatible metrics for the Feast server when enabled. |
11281128
| `dualStack` _boolean_ | DualStack binds the server to the IPv6 wildcard address instead of 0.0.0.0,
11291129
which serves both IPv6 and IPv4 clients on Linux. Enable it on IPv6-only or dual-stack clusters.
1130-
The registry's REST server binds dual-stack by default; set this to false to opt out to 0.0.0.0-only. |
1130+
Unset or false binds 0.0.0.0 (IPv4 only) for every server that takes a host flag, including the registry's REST server. |
11311131
| `volumeMounts` _[VolumeMount](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#volumemount-v1-core) array_ | VolumeMounts defines the list of volumes that should be mounted into the feast container.
11321132
This allows attaching persistent storage, config files, secrets, or other resources
11331133
required by the Feast components. Ensure that each volume mount has a corresponding

‎infra/feast-operator/internal/controller/services/registry_bind_host_test.go‎

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,26 @@ func TestRegistryContainerCommandHostFlag(t *testing.T) {
4545
name string
4646
restEnabled bool
4747
dualStack *bool
48-
wantHostArg bool
48+
wantHost string // empty: no -h expected
4949
}{
50-
{"unset defaults to dual-stack, no -h", true, nil, false},
51-
{"explicit true stays dual-stack, no -h", true, ptr.To(true), false},
52-
{"explicit false opts out to 0.0.0.0", true, ptr.To(false), true},
53-
{"rest disabled never renders -h", false, ptr.To(false), false},
50+
{"unset keeps ipv4", true, nil, hostAllIPv4},
51+
{"explicit false keeps ipv4", true, ptr.To(false), hostAllIPv4},
52+
{"explicit true binds bare ipv6 wildcard", true, ptr.To(true), hostAllIPv6},
53+
{"rest disabled never renders -h", false, ptr.To(true), ""},
5454
}
5555
for _, tc := range cases {
5656
t.Run(tc.name, func(t *testing.T) {
5757
feast := registryFeastServices(tc.restEnabled, tc.dualStack)
5858
args := feast.getContainerCommand(RegistryFeastType)
5959

60-
gotHostArg := false
60+
gotHost := ""
6161
for i, a := range args {
6262
if a == "-h" && i+1 < len(args) {
63-
gotHostArg = true
64-
if args[i+1] != hostAllIPv4 {
65-
t.Fatalf("got -h %s, want %s", args[i+1], hostAllIPv4)
66-
}
63+
gotHost = args[i+1]
6764
}
6865
}
69-
if gotHostArg != tc.wantHostArg {
70-
t.Fatalf("got args %v, want -h present=%v", args, tc.wantHostArg)
66+
if gotHost != tc.wantHost {
67+
t.Fatalf("got args %v, want -h %q", args, tc.wantHost)
7168
}
7269
})
7370
}

‎infra/feast-operator/internal/controller/services/services.go‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ func (feast *FeastServices) getContainerCommand(feastType FeastServiceType) []st
731731
}
732732

733733
deploySettings := FeastServiceConstants[feastType]
734-
deploySettings.Args = withBindHost(feastType, deploySettings.Args, feast.getServerConfigs(feastType))
734+
deploySettings.Args = append([]string{}, deploySettings.Args...)
735735
// Only inject --metrics CLI flag for the server.metrics bool path.
736736
// When serving.metrics.enabled is used, Python reads it from feature_store.yaml
737737
// and starts the metrics server itself — no CLI flag needed.
@@ -750,12 +750,10 @@ func (feast *FeastServices) getContainerCommand(feastType FeastServiceType) []st
750750
if feast.isRegistryRestEnabled() {
751751
deploySettings.Args = append(deploySettings.Args, "--rest-api")
752752
deploySettings.Args = append(deploySettings.Args, "--rest-port", strconv.Itoa(int(getTargetRestPort(feastType, tls))))
753-
// Registry REST defaults to dual-stack; only render -h to opt out.
754-
if ds := feast.getServerConfigs(feastType).DualStack; ds != nil && !*ds {
755-
deploySettings.Args = append(deploySettings.Args, "-h", hostAllIPv4)
756-
}
753+
deploySettings.Args = append(deploySettings.Args, "-h", hostAllIPv4)
757754
}
758755
}
756+
deploySettings.Args = withBindHost(feastType, deploySettings.Args, feast.getServerConfigs(feastType))
759757

760758
// Add worker configuration options for online store (feast serve)
761759
if feastType == OnlineFeastType {

0 commit comments

Comments
 (0)