-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added #2976 * Fixed #2992 * Fixed #2876 * Fixed #3004 * Fix #2934 * Added #1076 * Removed un-used certificate stuff * Properly fixed #2876 * Add EOF EL * Update CHANGELOG-1.0.md Co-authored-by: Rafal Zeidler <[email protected]> * azure: fix for #3065 * comment more entries for #2934 * Escalate permissions for ip command (#2952) * Add documentation for custom terraform scripts * Remove one more duplicate entry in image-registry defaults Co-authored-by: Rafal Zeidler <[email protected]> Co-authored-by: cicharka <[email protected]> Co-authored-by: Irek Głownia <[email protected]> Co-authored-by: przemyslavic <>
- Loading branch information
1 parent
ed5a1a5
commit 80c2763
Showing
33 changed files
with
448 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,20 @@ | ||
class AnsibleHostModel: | ||
def __init__(self, name, ip): | ||
self.name = name | ||
self.ip = ip | ||
def __init__(self, name: str, ip: str): | ||
self.name: str = name | ||
self.ip: str = ip | ||
|
||
def __eq__(self, other) -> bool: | ||
return (self.name == other.name and | ||
self.ip == other.ip) | ||
|
||
def __lt__(self, other) -> bool: | ||
pass | ||
|
||
|
||
class AnsibleOrderedHostModel(AnsibleHostModel): | ||
""" | ||
Sortable variant of AnsibleHostModel | ||
""" | ||
|
||
def __lt__(self, other) -> bool: | ||
return self.name < other.name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
core/src/epicli/data/common/ansible/playbooks/roles/preflight/tasks/check-routing.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
- name: Check routing configuration | ||
become: true | ||
command: ip route show default 0.0.0.0/0 | ||
register: ip_route_show_default | ||
|
||
- name: Assert default route exists | ||
assert: | ||
that: ip_route_show_default.stdout_lines | length > 0 | ||
fail_msg: >- | ||
No default route configured. At least one is required, read more in troubleshooting document. | ||
quiet: true | ||
|
||
- name: Validate metric values if multiple default routes exist | ||
when: ip_route_show_default.stdout_lines | length > 1 | ||
block: | ||
- name: Get metric values | ||
become: true | ||
shell: |- | ||
set -o pipefail && \ | ||
ip route show default 0.0.0.0/0 | awk '{if (! /metric/) print 0; else for (x=1;x<NF;x++) if ($x == "metric") print $(x+1) }' | ||
register: default_routing_configuration_metric_values | ||
args: | ||
executable: /bin/bash | ||
|
||
- name: Assert two most prioritized default routes have unique metric | ||
assert: | ||
that: "default_routing_configuration_metric_values.stdout_lines[0] != default_routing_configuration_metric_values.stdout_lines[1]" | ||
fail_msg: >- | ||
At least two default routes have the same metric value. | ||
Check routing configuration, read more in troubleshooting document. | ||
- include_vars: | ||
file: roles/common/vars/main.yml | ||
name: common_vars | ||
|
||
- name: Validate if ansible_default_ipv4.address matches address from inventory | ||
when: | ||
- common_vars.provider == "any" | ||
- common_vars.specification.cloud is undefined | ||
assert: | ||
that: ansible_default_ipv4.address == ansible_host | ||
fail_msg: >- | ||
ansible_default_ipv4.address is {{ ansible_default_ipv4.address }} but inventory uses ip: {{ ansible_host }}. | ||
Check default routing configuration, read more in troubleshooting document. | ||
quiet: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
26 changes: 26 additions & 0 deletions
26
core/src/epicli/tests/engine/providers/any/test_APIProxy.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from pytest_mock import MockerFixture | ||
|
||
from cli.engine.providers.any.APIProxy import APIProxy | ||
from cli.models.AnsibleHostModel import AnsibleOrderedHostModel | ||
from tests.engine.providers.data.APIProxy_data import CLUSTER_MODEL, CONFIG_DOC | ||
|
||
|
||
def test_get_ips_for_feature(mocker: MockerFixture): | ||
""" | ||
Make sure that hostnames in inventory are sorted. | ||
""" | ||
|
||
mocker.patch('cli.engine.providers.any.APIProxy.Log') | ||
proxy = APIProxy(CLUSTER_MODEL('any'), CONFIG_DOC()) | ||
|
||
EXPECTED_RESULT = [ | ||
AnsibleOrderedHostModel('service-vm-0', '20.73.105.240'), | ||
AnsibleOrderedHostModel('service-vm-1', '20.73.105.188'), | ||
AnsibleOrderedHostModel('service-vm-2', '20.73.105.18'), | ||
AnsibleOrderedHostModel('service-vm-3', '20.73.105.33'), | ||
AnsibleOrderedHostModel('service-vm-4', '20.73.105.54') | ||
] | ||
|
||
result = proxy.get_ips_for_feature('service') | ||
|
||
assert EXPECTED_RESULT == result |
Empty file.
Empty file.
Oops, something went wrong.