Skip to content

Commit eedf960

Browse files
feat: add octavia_provider config option with amphora deprecation warning (#834)
* feat: add octavia_provider config option with amphora deprecation warning Add [driver] octavia_provider configuration option (default: amphora) and log warning when legacy amphora provider is detected to encourage migration to amphorav2. Signed-off-by: okozachenko <[email protected]> * fix lint Signed-off-by: okozachenko <[email protected]> * set default as amphorav2 Signed-off-by: okozachenko <[email protected]> * remove configuration option for octavia provider Signed-off-by: okozachenko <[email protected]> * fix doc Signed-off-by: okozachenko <[email protected]> * update test Signed-off-by: okozachenko <[email protected]> * fix lint error Signed-off-by: okozachenko <[email protected]> * fix typo Signed-off-by: okozachenko <[email protected]> * fix lint error Signed-off-by: okozachenko <[email protected]> --------- Signed-off-by: okozachenko <[email protected]>
1 parent de303c4 commit eedf960

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

Cargo.lock

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

docs/user/labels.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ is often accomplished by deploying a driver on each node.
115115

116116
The Octavia provider to configure for the load balancers created by the cluster.
117117

118-
Default value: `amphora`
118+
Default value: Octavia default
119119

120120
* `octavia_lb_algorithm`
121121

magnum_cluster_api/resources.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -994,10 +994,13 @@ def get_object(self) -> dict:
994994

995995
api_server_load_balancer = {
996996
"enabled": self.cluster.master_lb_enabled,
997-
"provider": self.cluster.labels.get("octavia_provider", "amphora"),
998997
}
999998

1000-
# Only add optional fields if they are not None
999+
# Only add optional fields if they are set
1000+
octavia_provider = self.cluster.labels.get("octavia_provider")
1001+
if octavia_provider is not None:
1002+
api_server_load_balancer["provider"] = octavia_provider
1003+
10011004
availability_zone = self.cluster.labels.get("api_server_lb_availability_zone")
10021005
if availability_zone is not None:
10031006
api_server_load_balancer["availabilityZone"] = availability_zone

magnum_cluster_api/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ def generate_cloud_controller_manager_config(
120120
clouds_yaml = base64.decode_as_text(data.obj["data"]["clouds.yaml"])
121121
cloud_config = yaml.safe_load(clouds_yaml)
122122

123-
octavia_provider = cluster.labels.get("octavia_provider", "amphora")
123+
octavia_provider = cluster.labels.get("octavia_provider", "amphorav2")
124124
octavia_lb_algorithm = cluster.labels.get("octavia_lb_algorithm")
125125
octavia_lb_healthcheck = cluster.labels.get("octavia_lb_healthcheck", True)
126126

127-
if octavia_provider == "amphora" and octavia_lb_algorithm is None:
127+
if octavia_provider in ("amphora", "amphorav2") and octavia_lb_algorithm is None:
128128
octavia_lb_algorithm = "ROUND_ROBIN"
129129
elif octavia_provider == "ovn" and octavia_lb_algorithm is None:
130130
octavia_lb_algorithm = "SOURCE_IP_PORT"

0 commit comments

Comments
 (0)