Skip to content

Commit

Permalink
fix functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
okozachenko1203 committed Mar 28, 2024
1 parent 9c44dd1 commit c969665
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ clean:
vendir:
curl -Lo vendir https://github.com/carvel-dev/vendir/releases/download/v0.40.0/vendir-linux-amd64
chmod +x vendir && ./vendir version
mv vendir /usr/local/bin/vendir
sudo mv vendir /usr/local/bin/vendir

vendor: clean vendir
vendir sync
Expand Down
14 changes: 10 additions & 4 deletions magnum_cluster_api/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
AUTOSCALE_ANNOTATION_MIN = "cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size"
AUTOSCALE_ANNOTATION_MAX = "cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size"

DEFAULT_POD_CIDR = "10.100.0.0/16"


class ClusterAutoscalerHelmRelease:
def __init__(self, api, cluster) -> None:
Expand Down Expand Up @@ -215,7 +217,7 @@ def get_object(self) -> pykube.ConfigMap:
utils.get_cluster_label(
self.cluster,
"cilium_ipv4pool",
"10.100.0.0/16",
DEFAULT_POD_CIDR,
),
],
},
Expand Down Expand Up @@ -2346,14 +2348,18 @@ def get_or_none(self) -> objects.Cluster:
def get_object(self) -> objects.Cluster:
osc = clients.get_openstack_api(self.context)
default_volume_type = osc.cinder().volume_types.default()

pod_cidr = DEFAULT_POD_CIDR
if self.cluster.cluster_template.network_driver == "calico":
pod_cidr = utils.get_cluster_label(
self.cluster, "calico_ipv4pool", "10.100.0.0/16"
self.cluster,
"calico_ipv4pool",
DEFAULT_POD_CIDR,
)
if self.cluster.cluster_template.network_driver == "cilium":
pod_cidr = utils.get_cluster_label(
self.cluster, "cilium_ipv4pool", "10.100.0.0/16"
self.cluster,
"cilium_ipv4pool",
DEFAULT_POD_CIDR,
)

return objects.Cluster(
Expand Down

0 comments on commit c969665

Please sign in to comment.