diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml index 95a053c8..d840cbf2 100644 --- a/.github/workflows/ansible-test.yml +++ b/.github/workflows/ansible-test.yml @@ -93,7 +93,7 @@ jobs: # # OPTIONAL If your integration test requires Python libraries or modules from other collections # # Install them like this # - name: Install collection dependencies - # run: ansible-galaxy collection install community.kubernetes -p . + # run: ansible-galaxy collection install kubernetes.core -p . # # Run the integration tests # - name: Run integration test diff --git a/Makefile b/Makefile index 9c30f610..e0bd8655 100644 --- a/Makefile +++ b/Makefile @@ -12,9 +12,9 @@ build: clean ansible-galaxy collection build install-kubernetes-src: - mkdir -p ansible_collections/community/kubernetes - rm -rf ansible_collections/community/kubernetes/* - curl -L https://github.com/ansible-collections/community.kubernetes/archive/main.tar.gz | tar -xz -C ansible_collections/community/kubernetes --strip-components 1 + mkdir -p ansible_collections/kubernetes/core + rm -rf ansible_collections/kubernetes/core/* + curl -L https://github.com/ansible-collections/kubernetes.core/archive/main.tar.gz | tar -xz -C ansible_collections/kubernetes/core --strip-components 1 # TODO: Once we no longer rely on features in main we should drop the install-kubernetes-src dependency install: build install-kubernetes-src diff --git a/ci/downstream.sh b/ci/downstream.sh index 81ac577c..99d1d9c4 100755 --- a/ci/downstream.sh +++ b/ci/downstream.sh @@ -43,8 +43,7 @@ f_text_sub() sed -i.bak "s/Kubernetes/OpenShift/g" "${_build_dir}/galaxy.yml" sed -i.bak "s/^version\:.*$/version: ${DOWNSTREAM_VERSION}/" "${_build_dir}/galaxy.yml" sed -i.bak "/STARTREMOVE/,/ENDREMOVE/d" "${_build_dir}/README.md" - - find ${_build_dir} -type f -exec sed -i.bak "s/community\.kubernetes/kubernetes\.core/g" {} \; + find ${_build_dir} -type f -exec sed -i.bak "s/community\.okd/redhat\.openshift/g" {} \; find "${_build_dir}" -type f -name "*.bak" -delete } @@ -130,19 +129,19 @@ f_create_collection_dir_structure() f_install_kubernetes_core_from_src() { - local community_k8s_tmpdir="${_tmp_dir}/community.kubernetes" + local community_k8s_tmpdir="${_tmp_dir}/kubernetes.core" local install_collections_dir="${_tmp_dir}/ansible_collections" mkdir -p "${community_k8s_tmpdir}" pushd "${_tmp_dir}" # curl -L \ - # https://github.com/ansible-collections/community.kubernetes/archive/main.tar.gz \ + # https://github.com/ansible-collections/kubernetes.core/archive/main.tar.gz \ # | tar -xz -C "${community_k8s_tmpdir}" --strip-components 1 # pushd "${community_k8s_tmpdir}" # make downstream-build # ansible-galaxy collection install -p "${install_collections_dir}" "${community_k8s_tmpdir}"/kubernetes-core-*.tar.gz # popd #popd - git clone https://github.com/ansible-collections/community.kubernetes "${community_k8s_tmpdir}" + git clone https://github.com/ansible-collections/kubernetes.core "${community_k8s_tmpdir}" pushd "${community_k8s_tmpdir}" make downstream-build ansible-galaxy collection install -p "${install_collections_dir}" "${community_k8s_tmpdir}"/kubernetes-core-*.tar.gz @@ -175,7 +174,7 @@ f_test_sanity_option() pushd "${_build_dir}" || return ansible-galaxy collection build f_log_info "SANITY TEST PWD: ${PWD}" - ## Can't do this because the upstream community.kubernetes dependency logic + ## Can't do this because the upstream kubernetes.core dependency logic ## is bound as a Makefile dep to the test-sanity target #SANITY_TEST_ARGS="--docker --color --python 3.6" make test-sanity # Run tests in docker if available, venv otherwise @@ -211,7 +210,7 @@ f_build_option() f_log_info "BUILD WD: ${PWD}" # FIXME # This doesn't work because we end up either recursively curl'ing - # community.kubernetes and redoing the text replacement over and over + # kubernetes.core and redoing the text replacement over and over # # make build ansible-galaxy collection build diff --git a/galaxy.yml b/galaxy.yml index 788eb2cf..5a7ef260 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -5,7 +5,7 @@ authors: - willthames (https://github.com/willthames) - Akasurde (https://github.com/akasurde) dependencies: - community.kubernetes: '>=1.0.0' + kubernetes.core: '>=1.1.1' description: OKD Collection for Ansible. documentation: '' homepage: '' diff --git a/molecule/default/tasks/openshift_auth.yml b/molecule/default/tasks/openshift_auth.yml index 32ecd422..9c30c78d 100644 --- a/molecule/default/tasks/openshift_auth.yml +++ b/molecule/default/tasks/openshift_auth.yml @@ -12,7 +12,7 @@ register: openshift_auth_results - name: Get the test User - community.kubernetes.k8s_info: + kubernetes.core.k8s_info: api_key: "{{ openshift_auth_results.openshift_auth.api_key }}" host: '{{ openshift_host }}' verify_ssl: false @@ -35,7 +35,7 @@ verify_ssl: false - name: Get the test user - community.kubernetes.k8s_info: + kubernetes.core.k8s_info: api_key: "{{ openshift_auth_results.openshift_auth.api_key }}" host: '{{ openshift_host }}' verify_ssl: false diff --git a/molecule/default/tasks/openshift_process.yml b/molecule/default/tasks/openshift_process.yml index 373f0bc6..8decc79d 100644 --- a/molecule/default/tasks/openshift_process.yml +++ b/molecule/default/tasks/openshift_process.yml @@ -133,7 +133,7 @@ that: result is not changed - name: Get the created configmap - community.kubernetes.k8s_info: + kubernetes.core.k8s_info: api_version: v1 kind: ConfigMap name: example diff --git a/plugins/connection/oc.py b/plugins/connection/oc.py index 00bc26b8..7236c014 100644 --- a/plugins/connection/oc.py +++ b/plugins/connection/oc.py @@ -147,7 +147,7 @@ aliases: [ oc_verify_ssl ] ''' -from ansible_collections.community.kubernetes.plugins.connection.kubectl import Connection as KubectlConnection +from ansible_collections.kubernetes.core.plugins.connection.kubectl import Connection as KubectlConnection CONNECTION_TRANSPORT = 'oc' diff --git a/plugins/inventory/openshift.py b/plugins/inventory/openshift.py index 3666c8f2..b44eab3b 100644 --- a/plugins/inventory/openshift.py +++ b/plugins/inventory/openshift.py @@ -113,7 +113,7 @@ context: 'awx/192-168-64-4:8443/developer' ''' -from ansible_collections.community.kubernetes.plugins.inventory.k8s import K8sInventoryException, InventoryModule as K8sInventoryModule, format_dynamic_api_exc +from ansible_collections.kubernetes.core.plugins.inventory.k8s import K8sInventoryException, InventoryModule as K8sInventoryModule, format_dynamic_api_exc try: from openshift.dynamic.exceptions import DynamicApiError diff --git a/plugins/modules/k8s.py b/plugins/modules/k8s.py index 5aa640e2..fb089b29 100644 --- a/plugins/modules/k8s.py +++ b/plugins/modules/k8s.py @@ -36,10 +36,10 @@ - Optimized for OKD/OpenShift Kubernetes flavors extends_documentation_fragment: - - community.kubernetes.k8s_state_options - - community.kubernetes.k8s_name_options - - community.kubernetes.k8s_resource_options - - community.kubernetes.k8s_auth_options + - kubernetes.core.k8s_state_options + - kubernetes.core.k8s_name_options + - kubernetes.core.k8s_resource_options + - kubernetes.core.k8s_auth_options notes: - If your OpenShift Python library is not 0.9.0 or newer and you are trying to @@ -273,7 +273,7 @@ from ansible.module_utils._text import to_native try: - from ansible_collections.community.kubernetes.plugins.module_utils.raw import KubernetesRawModule + from ansible_collections.kubernetes.core.plugins.module_utils.raw import KubernetesRawModule HAS_KUBERNETES_COLLECTION = True except ImportError as e: HAS_KUBERNETES_COLLECTION = False @@ -297,7 +297,7 @@ class OKDRawModule(KubernetesRawModule): def __init__(self): if not HAS_KUBERNETES_COLLECTION: self.fail_json( - msg="The community.kubernetes collection must be installed", + msg="The kubernetes.core collection must be installed", exception=K8S_COLLECTION_ERROR, error=to_native(k8s_collection_import_exception) ) diff --git a/plugins/modules/openshift_auth.py b/plugins/modules/openshift_auth.py index 571c8413..6af1a9a8 100644 --- a/plugins/modules/openshift_auth.py +++ b/plugins/modules/openshift_auth.py @@ -99,7 +99,7 @@ # Previous task provides the token/api_key, while all other parameters # are taken from module_defaults - name: Get a list of all pods from any namespace - community.kubernetes.k8s_info: + kubernetes.core.k8s_info: api_key: "{{ openshift_auth_results.openshift_auth.api_key }}" kind: Pod register: pod_list diff --git a/plugins/modules/openshift_process.py b/plugins/modules/openshift_process.py index feee81b8..df6f29ca 100644 --- a/plugins/modules/openshift_process.py +++ b/plugins/modules/openshift_process.py @@ -25,9 +25,9 @@ - For CRUD operations on Template resources themselves, see the community.okd.k8s module. extends_documentation_fragment: - - community.kubernetes.k8s_auth_options - - community.kubernetes.k8s_wait_options - - community.kubernetes.k8s_resource_options + - kubernetes.core.k8s_auth_options + - kubernetes.core.k8s_wait_options + - kubernetes.core.k8s_resource_options requirements: - "python >= 2.7" @@ -212,7 +212,7 @@ from ansible.module_utils._text import to_native try: - from ansible_collections.community.kubernetes.plugins.module_utils.common import ( + from ansible_collections.kubernetes.core.plugins.module_utils.common import ( K8sAnsibleMixin, AUTH_ARG_SPEC, RESOURCE_ARG_SPEC, WAIT_ARG_SPEC ) HAS_KUBERNETES_COLLECTION = True @@ -243,7 +243,7 @@ def __init__(self): if not HAS_KUBERNETES_COLLECTION: self.module.fail_json( - msg="The community.kubernetes collection must be installed", + msg="The kubernetes.core collection must be installed", exception=K8S_COLLECTION_ERROR, error=to_native(k8s_collection_import_exception) ) diff --git a/plugins/modules/openshift_route.py b/plugins/modules/openshift_route.py index 77c28b3c..6e40c0e5 100644 --- a/plugins/modules/openshift_route.py +++ b/plugins/modules/openshift_route.py @@ -21,12 +21,12 @@ description: - Looks up a Service and creates a new Route based on it. - Analogous to `oc expose` and `oc create route` for creating Routes, but does not support creating Services. - - For creating Services from other resources, see community.kubernetes.k8s_expose + - For creating Services from other resources, see kubernetes.core.k8s_expose extends_documentation_fragment: - - community.kubernetes.k8s_auth_options - - community.kubernetes.k8s_wait_options - - community.kubernetes.k8s_state_options + - kubernetes.core.k8s_auth_options + - kubernetes.core.k8s_wait_options + - kubernetes.core.k8s_state_options requirements: - "python >= 2.7" @@ -304,7 +304,7 @@ from ansible.module_utils._text import to_native try: - from ansible_collections.community.kubernetes.plugins.module_utils.common import ( + from ansible_collections.kubernetes.core.plugins.module_utils.common import ( K8sAnsibleMixin, AUTH_ARG_SPEC, WAIT_ARG_SPEC, COMMON_ARG_SPEC ) HAS_KUBERNETES_COLLECTION = True @@ -332,7 +332,7 @@ def __init__(self): if not HAS_KUBERNETES_COLLECTION: self.module.fail_json( - msg="The community.kubernetes collection must be installed", + msg="The kubernetes.core collection must be installed", exception=K8S_COLLECTION_ERROR, error=to_native(k8s_collection_import_exception) )