Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
Pin Calico manifest at 1.7 (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
mboersma authored Apr 5, 2023
1 parent 0521877 commit 1fadfe5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 6 additions & 0 deletions src/capi/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
Release History
===============

0.1.4
+++++

* Pin calico manifests at CAPZ release-1.7
* Store AKS infra rg and vnet as environment variables

0.1.3
+++++

Expand Down
11 changes: 6 additions & 5 deletions src/capi/azext_capi/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ def install_cni(cmd, cluster_name, workload_cfg, windows, args):
pass # This is a best-effort configuration, so don't fail if we can't find the CIDR.

# Install Calico CNI using the official Helm chart.
file_base = "https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/main"
file_base = "https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/release-1.7"
values_file = f"{file_base}/templates/addons/calico/values.yaml"
if cidr0 and not cidr1:
interface0 = ipaddress.ip_interface(cidr0)
Expand All @@ -614,7 +614,7 @@ def install_cni(cmd, cluster_name, workload_cfg, windows, args):
values_file = f"{file_base}/templates/addons/calico-dual-stack/values.yaml"
helminfo = HelmInfo(
repo_name="projectcalico",
repo_url="https://projectcalico.docs.tigera.io/charts",
repo_url="https://docs.tigera.io/calico/charts",
chart_name="calico",
chart="projectcalico/tigera-operator",
values_file=values_file,
Expand All @@ -639,12 +639,12 @@ def install_cni_windows(cmd, workload_cfg, msg):
configmap = get_configmap(workload_cfg, "kubeadm-config", "kube-system")
configmap = configmap.replace("namespace: kube-system", "namespace: calico-system")
create_configmap(workload_cfg, configmap)
calico_manifest = "https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/main/templates/addons/windows/calico/calico.yaml" # pylint: disable=line-too-long
calico_manifest = "https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/release-1.7/templates/addons/windows/calico/calico.yaml" # pylint: disable=line-too-long
apply_kubernetes_manifest(cmd, calico_manifest, workload_cfg, msg)


def install_windows_kubeproxy(cmd, args, workload_cfg, msg):
kubeproxy_manifest_url = "https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/main/templates/addons/windows/calico/kube-proxy-windows.yaml" # pylint: disable=line-too-long
kubeproxy_manifest_url = "https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/release-1.7/templates/addons/windows/calico/kube-proxy-windows.yaml" # pylint: disable=line-too-long
kubeproxy_manifest_file = "kube-proxy-windows.yaml"
manifest = render_custom_cluster_template(kubeproxy_manifest_url, kubeproxy_manifest_file, args)
write_to_file(kubeproxy_manifest_file, manifest)
Expand Down Expand Up @@ -728,7 +728,8 @@ def install_helm_chart(cmd, helminfo, workload_cfg, msg):
begin_msg, end_msg, err_msg = message_variants(msg)
attempts, delay = 100, 3
with Spinner(cmd, begin_msg, end_msg):
command = ["helm", "repo", "add", helminfo.repo_name, helminfo.repo_url, "--kubeconfig", workload_cfg]
command = ["helm", "repo", "add", helminfo.repo_name, helminfo.repo_url,
"--kubeconfig", workload_cfg, "--force-update"]
try:
retry_shell_command(command, attempts, delay)
except subprocess.CalledProcessError as err:
Expand Down
2 changes: 1 addition & 1 deletion src/capi/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# Confirm this is the right version number you want and it matches your
# HISTORY.rst entry.
VERSION = '0.1.3'
VERSION = '0.1.4'

# The full list of classifiers is available at
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down

0 comments on commit 1fadfe5

Please sign in to comment.