[backport/stable-4] Add ansible-lint to tox linters (#258) and Update tests for newer version of openshift (#254) (#259)

* Add ansible-lint to tox linters (#258)

* Add ansible-lint to tox linters

* Bump black

* Black formatting

* fix linting

(cherry picked from commit f54297c2ac)

* Update tests for newer version of openshift (#254)

* Update tests for newer version of openshift

More recent versions of ocp no longer automatically create tokens for
service accounts. This updates the tests to manually create the tokens.

* Update nginx template version

The old image was EOL and the deployment was failing to deploy.

* Fix nginx version for all tasks

* Add missing var

(cherry picked from commit a3c3a69bbf)

---------

Co-authored-by: Mike Graves <mgraves@redhat.com>
This commit is contained in:
Mandar Kulkarni
2025-05-21 05:45:53 -07:00
committed by GitHub
parent a890d14253
commit db863c9089
12 changed files with 50 additions and 48 deletions

View File

@@ -295,9 +295,9 @@ class OpenShiftMigrateTemplateInstances(AnsibleOpenshiftModule):
object_type in transforms.keys()
and obj["ref"].get("apiVersion") != transforms[object_type]
):
ti_elem["status"]["objects"][i]["ref"][
"apiVersion"
] = transforms[object_type]
ti_elem["status"]["objects"][i]["ref"]["apiVersion"] = (
transforms[object_type]
)
ti_to_be_migrated.append(ti_elem)
return ti_to_be_migrated

View File

@@ -225,7 +225,7 @@ def get_oauthaccesstoken_objectname_from_token(token_name):
sha256Prefix = "sha256~"
if token_name.startswith(sha256Prefix):
content = token_name[len(sha256Prefix):]
content = token_name[len(sha256Prefix) :]
else:
content = token_name
b64encoded = urlsafe_b64encode(hashlib.sha256(content.encode()).digest()).rstrip(

View File

@@ -421,9 +421,9 @@ class OpenShiftRoute(AnsibleOpenshiftModule):
if tls_insecure_policy == "disallow":
tls_insecure_policy = None
else:
tls_ca_cert = (
tls_cert
) = tls_dest_ca_cert = tls_key = tls_insecure_policy = None
tls_ca_cert = tls_cert = tls_dest_ca_cert = tls_key = (
tls_insecure_policy
) = None
route = {
"apiVersion": "route.openshift.io/v1",