From 38c76a9545b0c51eb3664703e20564cd60c2ff76 Mon Sep 17 00:00:00 2001 From: Felix Matouschek Date: Thu, 3 Aug 2023 11:22:57 +0200 Subject: [PATCH] Rename collection to kubevirt.core This replaces all occurences of the old kubernetes.core name. Signed-off-by: Felix Matouschek --- .github/workflows/ci.yml | 4 ++-- .github/workflows/docs.yml | 16 ++++++++-------- .github/workflows/release.yml | 6 +++--- README.md | 12 ++++++------ docs/index.rst | 2 +- examples/inventory.kubevirt.yml | 2 +- examples/kubesecondarydns.kubevirt.yml | 2 +- examples/play-create-dv.yml | 2 +- examples/play-create-min.yml | 2 +- examples/play-create.yml | 2 +- examples/play-delete-dv.yml | 2 +- examples/play-delete.yml | 2 +- examples/services.kubevirt.yml | 2 +- galaxy.yml | 10 +++++----- plugins/inventory/kubevirt.py | 12 ++++++------ plugins/modules/kubevirt_vm.py | 6 +++--- .../targets/inventory_kubevirt/runme.sh | 4 ++-- tests/unit/modules/test_module_kubevirt_vm.py | 4 ++-- 18 files changed, 46 insertions(+), 46 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6563074..aadc389 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,11 +13,11 @@ jobs: - name: Check out code uses: actions/checkout@v2 with: - path: ansible_collections/kubernetes/kubevirt + path: ansible_collections/kubevirt/core fetch-depth: 0 - run: | mkdir -p /home/runner/.kube/ - cp -rp ${GITHUB_WORKSPACE}/ansible_collections/kubernetes/kubevirt/tests/.kubeconfig /home/runner/.kube/config + cp -rp ${GITHUB_WORKSPACE}/ansible_collections/kubevirt/core/tests/.kubeconfig /home/runner/.kube/config cat /home/runner/.kube/config sanity: uses: ansible-network/github_actions/.github/workflows/sanity.yml@main diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index be474e8..1b29538 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,7 +16,7 @@ env: jobs: docs: runs-on: ubuntu-latest - if: github.repository == 'kubevirt/kubernetes.kubevirt' + if: github.repository == 'kubevirt/kubevirt.core' permissions: actions: write checks: write @@ -28,7 +28,7 @@ jobs: - name: Check out code uses: actions/checkout@v2 with: - path: ansible_collections/kubernetes/kubevirt + path: ansible_collections/kubevirt/core fetch-depth: 0 - name: Set up Python @@ -40,9 +40,9 @@ jobs: - name: Install doc dependencies run: | python -m pip install --upgrade pip - pip install -r ansible_collections/kubernetes/kubevirt/docs/requirements.txt - pip install -r ansible_collections/kubernetes/kubevirt/requirements.txt - ansible-galaxy collection install -r ansible_collections/kubernetes/kubevirt/requirements.yml -p /home/runner/.ansible/collections --force-with-deps + pip install -r ansible_collections/kubevirt/core/docs/requirements.txt + pip install -r ansible_collections/kubevirt/core/requirements.txt + ansible-galaxy collection install -r ansible_collections/kubevirt/core/requirements.yml -p /home/runner/.ansible/collections --force-with-deps sudo apt install -y sed hub - name: Create default collection path @@ -53,12 +53,12 @@ jobs: - name: Create changelog and documentation uses: ansible-middleware/collection-docs-action@main with: - collection_fqcn: kubernetes.kubevirt - collection_repo: kubevirt/kubernetes.kubevirt + collection_fqcn: kubevirt.core + collection_repo: kubevirt/kubevirt.core dependencies: false commit_changelog: false commit_ghpages: true changelog_release: false generate_docs: true - path: /home/runner/.ansible/collections/ansible_collections/kubernetes/kubevirt + path: /home/runner/.ansible/collections/ansible_collections/kubevirt/core token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ece5aa8..11a6dc1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: jobs: release: runs-on: ubuntu-latest - if: github.repository == 'kubevirt/kubernetes.kubevirt' + if: github.repository == 'kubevirt/kubevirt.core' permissions: actions: write checks: write @@ -58,8 +58,8 @@ jobs: - name: Create changelog and documentation uses: ansible-middleware/collection-docs-action@main with: - collection_fqcn: kubernetes.kubevirt - collection_repo: kubevirt/kubernetes.kubevirt + collection_fqcn: kubevirt.core + collection_repo: kubevirt/kubevirt.core dependencies: false commit_changelog: true commit_ghpages: false diff --git a/README.md b/README.md index 0180d05..c27b264 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Lean Ansible bindings for KubeVirt -[![CI](https://github.com/kubevirt/kubernetes.kubevirt/workflows/CI/badge.svg?event=push)](https://github.com/kubevirt/kubernetes.kubevirt/actions) +[![CI](https://github.com/kubevirt/kubevirt.core/workflows/CI/badge.svg?event=push)](https://github.com/kubevirt/kubevirt.core/actions) -This repo hosts the kubernetes.kubevirt Ansible Collection. +This repo hosts the kubevirt.core Ansible Collection. The collection includes an inventory plugin for Ansible to automate the management of VMs running on KubeVirt. @@ -89,25 +89,25 @@ Python libraries: Before using this collection, you need to install it with the Ansible Galaxy command-line tool: ```bash -ansible-galaxy collection install kubernetes.kubevirt +ansible-galaxy collection install kubevirt.core ``` You can also include it in a `requirements.yml` file and install it with `ansible-galaxy collection install -r requirements.yml`, using the format: ```yaml --- collections: - - name: kubernetes.kubevirt + - name: kubevirt.core ``` Note that if you install the collection from Ansible Galaxy, it will not be upgraded automatically when you upgrade the `ansible` package. To upgrade the collection to the latest available version, run the following command: ```bash -ansible-galaxy collection install kubernetes.kubevirt --upgrade +ansible-galaxy collection install kubevirt.core --upgrade ``` You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax to install version `0.1.0`: ```bash -ansible-galaxy collection install kubernetes.kubevirt:==0.1.0 +ansible-galaxy collection install kubevirt.core:==0.1.0 ``` See [Ansible Using collections](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for more details. diff --git a/docs/index.rst b/docs/index.rst index 5058f92..8f8e852 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,4 +1,4 @@ -.. Red Hat kubernetes kubevirt Ansible Collection documentation main file +.. Red Hat kubevirt core Ansible Collection documentation main file Welcome to Kubevirt Collection documentation ======================================= diff --git a/examples/inventory.kubevirt.yml b/examples/inventory.kubevirt.yml index d3b0e09..d2b88e2 100644 --- a/examples/inventory.kubevirt.yml +++ b/examples/inventory.kubevirt.yml @@ -1,4 +1,4 @@ -plugin: kubernetes.kubevirt.kubevirt +plugin: kubevirt.core.kubevirt connections: - namespaces: - default diff --git a/examples/kubesecondarydns.kubevirt.yml b/examples/kubesecondarydns.kubevirt.yml index 94e5747..24b3c65 100644 --- a/examples/kubesecondarydns.kubevirt.yml +++ b/examples/kubesecondarydns.kubevirt.yml @@ -1,4 +1,4 @@ -plugin: kubernetes.kubevirt.kubevirt +plugin: kubevirt.core.kubevirt connections: - namespaces: - default diff --git a/examples/play-create-dv.yml b/examples/play-create-dv.yml index 38f6aa4..7e78c7f 100644 --- a/examples/play-create-dv.yml +++ b/examples/play-create-dv.yml @@ -1,7 +1,7 @@ - hosts: localhost tasks: - name: Create VM - kubernetes.kubevirt.kubevirt_vm: + kubevirt.core.kubevirt_vm: state: present name: testvm-with-dv namespace: default diff --git a/examples/play-create-min.yml b/examples/play-create-min.yml index 4d41341..e5c7a93 100644 --- a/examples/play-create-min.yml +++ b/examples/play-create-min.yml @@ -1,7 +1,7 @@ - hosts: localhost tasks: - name: Create VM - kubernetes.kubevirt.kubevirt_vm: + kubevirt.core.kubevirt_vm: state: present name: testvm namespace: default diff --git a/examples/play-create.yml b/examples/play-create.yml index 7e654f2..ba24fe4 100644 --- a/examples/play-create.yml +++ b/examples/play-create.yml @@ -1,7 +1,7 @@ - hosts: localhost tasks: - name: Create VM - kubernetes.kubevirt.kubevirt_vm: + kubevirt.core.kubevirt_vm: state: present name: testvm namespace: default diff --git a/examples/play-delete-dv.yml b/examples/play-delete-dv.yml index b17cf2b..60fce20 100644 --- a/examples/play-delete-dv.yml +++ b/examples/play-delete-dv.yml @@ -1,7 +1,7 @@ - hosts: localhost tasks: - name: Delete VM - kubernetes.kubevirt.kubevirt_vm: + kubevirt.core.kubevirt_vm: name: testvm-with-dv namespace: default state: absent diff --git a/examples/play-delete.yml b/examples/play-delete.yml index a14e5bc..dc89332 100644 --- a/examples/play-delete.yml +++ b/examples/play-delete.yml @@ -1,7 +1,7 @@ - hosts: localhost tasks: - name: Delete VM - kubernetes.kubevirt.kubevirt_vm: + kubevirt.core.kubevirt_vm: name: testvm namespace: default state: absent diff --git a/examples/services.kubevirt.yml b/examples/services.kubevirt.yml index e766204..fcf92ad 100644 --- a/examples/services.kubevirt.yml +++ b/examples/services.kubevirt.yml @@ -1,4 +1,4 @@ -plugin: kubernetes.kubevirt.kubevirt +plugin: kubevirt.core.kubevirt connections: - namespaces: - default diff --git a/galaxy.yml b/galaxy.yml index a3c8671..e1e3a2d 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,7 +1,7 @@ # See https://docs.ansible.com/ansible/latest/dev_guide/collections_galaxy_meta.html -namespace: kubernetes -name: kubevirt +namespace: kubevirt +name: core version: "0.1.0" readme: README.md authors: @@ -20,10 +20,10 @@ tags: - virtualization - cloud - infrastructure -repository: https://github.com/kubevirt/kubernetes.kubevirt -documentation: https://github.com/kubevirt/kubernetes.kubevirt/tree/main/docs +repository: https://github.com/kubevirt/kubevirt.core +documentation: https://github.com/kubevirt/kubevirt.core/tree/main/docs homepage: https://kubevirt.io -issues: https://github.com/kubevirt/kubernetes.kubevirt/issues +issues: https://github.com/kubevirt/kubevirt.core/issues build_ignore: - .gitignore - changelogs/.plugin-cache.yaml diff --git a/plugins/inventory/kubevirt.py b/plugins/inventory/kubevirt.py index 15413ea..53784f0 100644 --- a/plugins/inventory/kubevirt.py +++ b/plugins/inventory/kubevirt.py @@ -29,7 +29,7 @@ options: plugin: description: Token that ensures this is a source file for the "kubevirt" plugin. required: True - choices: ["kubevirt", "kubernetes.kubevirt.kubevirt"] + choices: ["kubevirt", "kubevirt.core.kubevirt"] host_format: description: - 'Specify the format of the host in the inventory group. Available specifiers: name, namespace, uid.' @@ -127,7 +127,7 @@ EXAMPLES = """ # Filename must end with kubevirt.[yml|yaml] # Authenticate with token, and return all VirtualMachineInstances for all accessible namespaces -plugin: kubernetes.kubevirt.kubevirt +plugin: kubevirt.core.kubevirt connections: - host: https://192.168.64.4:8443 api_key: xxxxxxxxxxxxxxxx @@ -135,7 +135,7 @@ connections: # Use default config (~/.kube/config) file and active context, and return VirtualMachineInstances # from namespace testing with interfaces connected to network bridge-network -plugin: kubernetes.kubevirt.kubevirt +plugin: kubevirt.core.kubevirt connections: - namespaces: - testing @@ -143,14 +143,14 @@ connections: # Use default config (~/.kube/config) file and active context, and return VirtualMachineInstances # from namespace testing with label app=test -plugin: kubernetes.kubevirt.kubevirt +plugin: kubevirt.core.kubevirt connections: - namespaces: - testing label_selector: app=test # Use a custom config file, and a specific context. -plugin: kubernetes.kubevirt.kubevirt +plugin: kubevirt.core.kubevirt connections: - kubeconfig: /path/to/config context: 'awx/192-168-64-4:8443/developer' @@ -231,7 +231,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): This class implements the actual inventory module. """ - NAME = "kubernetes.kubevirt.kubevirt" + NAME = "kubevirt.core.kubevirt" connection_plugin = "kubernetes.core.kubectl" transport = "kubectl" diff --git a/plugins/modules/kubevirt_vm.py b/plugins/modules/kubevirt_vm.py index ba80ebd..915771d 100644 --- a/plugins/modules/kubevirt_vm.py +++ b/plugins/modules/kubevirt_vm.py @@ -114,7 +114,7 @@ requirements: EXAMPLES = """ - name: Create a VirtualMachine - kubernetes.kubevirt.kubevirt_vm: + kubevirt.core.kubevirt_vm: state: present name: testvm namespace: default @@ -151,7 +151,7 @@ EXAMPLES = """ name: cloudinit - name: Create a VirtualMachine with a DataVolume template - kubernetes.kubevirt.kubevirt_vm: + kubevirt.core.kubevirt_vm: state: present name: testvm-with-dv namespace: default @@ -191,7 +191,7 @@ EXAMPLES = """ wait: yes - name: Delete a VirtualMachine - kubernetes.kubevirt.kubevirt_vm: + kubevirt.core.kubevirt_vm: name: testvm namespace: default state: absent diff --git a/tests/integration/targets/inventory_kubevirt/runme.sh b/tests/integration/targets/inventory_kubevirt/runme.sh index c8f629a..4233d3c 100755 --- a/tests/integration/targets/inventory_kubevirt/runme.sh +++ b/tests/integration/targets/inventory_kubevirt/runme.sh @@ -41,10 +41,10 @@ EOF ################################################# # run the plugin second -export ANSIBLE_INVENTORY_ENABLED=kubernetes.kubevirt.kubevirt +export ANSIBLE_INVENTORY_ENABLED=kubevirt.core.kubevirt cat << EOF > "$OUTPUT_DIR/test.kubevirt.yml" -plugin: kubernetes.kubevirt.kubevirt +plugin: kubevirt.core.kubevirt connections: - namespaces: - default diff --git a/tests/unit/modules/test_module_kubevirt_vm.py b/tests/unit/modules/test_module_kubevirt_vm.py index 3f44ace..709b185 100644 --- a/tests/unit/modules/test_module_kubevirt_vm.py +++ b/tests/unit/modules/test_module_kubevirt_vm.py @@ -12,8 +12,8 @@ from unittest.mock import patch, ANY from ansible.module_utils import basic from ansible_collections.kubernetes.core.plugins.module_utils.k8s import runner -from ansible_collections.kubernetes.kubevirt.plugins.modules import kubevirt_vm -from ansible_collections.kubernetes.kubevirt.tests.unit.utils.ansible_module_mock import ( +from ansible_collections.kubevirt.core.plugins.modules import kubevirt_vm +from ansible_collections.kubevirt.core.tests.unit.utils.ansible_module_mock import ( AnsibleFailJson, AnsibleExitJson, exit_json,