-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support dynamic OCP default version #1049
Support dynamic OCP default version #1049
Conversation
/hold |
1ee0b5c
to
e8eee06
Compare
e8eee06
to
4bb8801
Compare
/unhold |
/test e2e-metal-assisted-multi-version |
4bb8801
to
54df102
Compare
/test ? |
@eliorerz: The following commands are available to trigger required jobs:
The following commands are available to trigger optional jobs:
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/test e2e-metal-assisted-ipv6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good.. I added a few comments.
@@ -13,25 +12,14 @@ def api_client(): | |||
yield get_api_client() | |||
|
|||
|
|||
def get_api_client(offline_token=None, **kwargs) -> InventoryClient: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discovery-infra/test_infra/utils/global_variables/env_variables_utils.py
Show resolved
Hide resolved
with open(OCP_VERSIONS_JSON_PATH, 'r') as f: | ||
data = json.load(f) | ||
|
||
d = [k for k, v in data.items() if v.get('default', False)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe set default as const, e.g.
d = [k for k, v in data.items() if v.get('default', False)] | |
d = [k for k, v in data.items() if v.get(consts.OCP_VERSIONS_DEFAULT_KEY, False)] |
Also too many generic name in this function, data, k,v, d..
54df102
to
d659764
Compare
/test e2e-metal-assisted-multi-version |
d659764
to
f6c3196
Compare
/test e2e-metal-assisted-multi-version |
/test e2e-metal-assisted-kube-api |
a677bd3
to
200b04f
Compare
/test e2e-metal-assisted-multi-version |
/test ? |
@YuviGold: The following commands are available to trigger required jobs:
The following commands are available to trigger optional jobs:
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/test e2e-metal-assisted-olm |
/retest |
Return the openshift version that needs to be handled according to the following process: 1. In case env var OPENSHIFT_INSTALL_RELEASE_IMAGE is defined to override the release image - extract its OCP version. 2. In case env var OPENSHIFT_VERSION is defined - return it. 3. In case allow_default is enabled, return the default supported version by assisted-service. 3.1 If a client is provided, request the versions fron the service (supports remote service). 3.2 Otherwise, Get from the JSON file in assisted-service repository.
200b04f
to
63151a8
Compare
/test e2e-metal-assisted-ipv6 |
1 similar comment
/test e2e-metal-assisted-ipv6 |
/test e2e-metal-assisted-olm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/hold
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: eliorerz, YuviGold The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test e2e-metal-assisted-ipv6 |
Everything passed 🎉 |
@@ -16,7 +15,7 @@ class _EnvVariablesUtils(ABC): | |||
remote_service_url: str = get_env("REMOTE_SERVICE_URL") | |||
pull_secret: str = get_env("PULL_SECRET") | |||
offline_token: str = get_env("OFFLINE_TOKEN") | |||
openshift_version: str = get_openshift_version() | |||
openshift_version: str = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe None? to be consistent with all others
@@ -44,6 +47,11 @@ class GlobalVariables(_EnvVariablesUtils): | |||
|
|||
def __post_init__(self): | |||
super().__post_init__() | |||
client=None | |||
if not self.is_kube_api: | |||
with suppress(RuntimeError, TimeoutError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why it is ok to fail ? please comment
@@ -740,7 +735,31 @@ def get_kubeconfig_path(cluster_name: str) -> str: | |||
return kubeconfig_path | |||
|
|||
|
|||
def get_openshift_version(default=consts.DEFAULT_OPENSHIFT_VERSION): | |||
def get_default_openshift_version(client=None) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure regarding utils. Why it is not part of cluster configuration classes?
On openshift/assisted-test-infra#1049 assisted-test-infra became aware dynamically for the default version of a deployed assisted-service. The CI should use it and avoid setting an harcoded version.
Return the openshift version that needs to be handled
according to the following process:
OPENSHIFT_INSTALL_RELEASE_IMAGE
is defined to override the release image -extract its OCP version.
OPENSHIFT_VERSION
is defined - return it.allow_default
is enabled, return the default supported version by assisted-service.3.1 If a client is provided, request the versions from the service (supports remote service).
3.2 Otherwise, Get from the JSON file in assisted-service repository.
/cc @eliorerz