Skip to content

Commit

Permalink
[ATMOSPHERE-514] fix ovn for backward compatibility (#2042)
Browse files Browse the repository at this point in the history
we used to keep type: hv|gw labels in ovn-controller and ovn-controller-gw daemonsents to distinguish them.
in the PR #2023, we removed ovn-controller-gw daemonset and keep only one DS to sync with upstream as much as possible. so type: xx label is unnecessary. But we cannot remove it for running clouds because spec.selector field is immutable.
this pr reverts that label for backward compatibility.

Reviewed-by: Mohammed Naser <[email protected]>
  • Loading branch information
okozachenko1203 authored Oct 29, 2024
1 parent f521227 commit 527cc93
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions roles/ovn/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,32 @@
# License for the specific language governing permissions and limitations
# under the License.

- name: Replace unnecessary label in ovn-controller daemonset
run_once: true
when: atmosphere_network_backend == 'ovn'
block:
- name: Check if ovn_controller DaemonSet exists
kubernetes.core.k8s_info:
api_version: apps/v1
kind: DaemonSet
namespace: "{{ ovn_helm_release_namespace }}"
name: ovn-controller
kubeconfig: "{{ ovn_helm_kubeconfig }}"
register: _ovn_controller_ds_info
failed_when: false

- name: Delete existing ovn controller DaemonSet if type label is found
kubernetes.core.k8s:
api_version: apps/v1
kind: DaemonSet
name: ovn-controller
namespace: "{{ ovn_helm_release_namespace }}"
state: absent
kubeconfig: "{{ ovn_helm_kubeconfig }}"
when:
- _ovn_controller_ds_info.resources | length > 0
- "'type' in _ovn_controller_ds_info.resources[0].spec.selector.matchLabels"

- name: Deploy Helm chart
run_once: true
when: atmosphere_network_backend == 'ovn'
Expand Down

0 comments on commit 527cc93

Please sign in to comment.