Rename collection to kubevirt.core

This replaces all occurences of the old kubernetes.core name.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
Felix Matouschek
2023-08-03 11:22:57 +02:00
parent 874003ed14
commit 38c76a9545
18 changed files with 46 additions and 46 deletions

View File

@@ -13,11 +13,11 @@ jobs:
- name: Check out code - name: Check out code
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
path: ansible_collections/kubernetes/kubevirt path: ansible_collections/kubevirt/core
fetch-depth: 0 fetch-depth: 0
- run: | - run: |
mkdir -p /home/runner/.kube/ 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 cat /home/runner/.kube/config
sanity: sanity:
uses: ansible-network/github_actions/.github/workflows/sanity.yml@main uses: ansible-network/github_actions/.github/workflows/sanity.yml@main

View File

@@ -16,7 +16,7 @@ env:
jobs: jobs:
docs: docs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'kubevirt/kubernetes.kubevirt' if: github.repository == 'kubevirt/kubevirt.core'
permissions: permissions:
actions: write actions: write
checks: write checks: write
@@ -28,7 +28,7 @@ jobs:
- name: Check out code - name: Check out code
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
path: ansible_collections/kubernetes/kubevirt path: ansible_collections/kubevirt/core
fetch-depth: 0 fetch-depth: 0
- name: Set up Python - name: Set up Python
@@ -40,9 +40,9 @@ jobs:
- name: Install doc dependencies - name: Install doc dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install -r ansible_collections/kubernetes/kubevirt/docs/requirements.txt pip install -r ansible_collections/kubevirt/core/docs/requirements.txt
pip install -r ansible_collections/kubernetes/kubevirt/requirements.txt pip install -r ansible_collections/kubevirt/core/requirements.txt
ansible-galaxy collection install -r ansible_collections/kubernetes/kubevirt/requirements.yml -p /home/runner/.ansible/collections --force-with-deps 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 sudo apt install -y sed hub
- name: Create default collection path - name: Create default collection path
@@ -53,12 +53,12 @@ jobs:
- name: Create changelog and documentation - name: Create changelog and documentation
uses: ansible-middleware/collection-docs-action@main uses: ansible-middleware/collection-docs-action@main
with: with:
collection_fqcn: kubernetes.kubevirt collection_fqcn: kubevirt.core
collection_repo: kubevirt/kubernetes.kubevirt collection_repo: kubevirt/kubevirt.core
dependencies: false dependencies: false
commit_changelog: false commit_changelog: false
commit_ghpages: true commit_ghpages: true
changelog_release: false changelog_release: false
generate_docs: true 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 }} token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -6,7 +6,7 @@ on:
jobs: jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'kubevirt/kubernetes.kubevirt' if: github.repository == 'kubevirt/kubevirt.core'
permissions: permissions:
actions: write actions: write
checks: write checks: write
@@ -58,8 +58,8 @@ jobs:
- name: Create changelog and documentation - name: Create changelog and documentation
uses: ansible-middleware/collection-docs-action@main uses: ansible-middleware/collection-docs-action@main
with: with:
collection_fqcn: kubernetes.kubevirt collection_fqcn: kubevirt.core
collection_repo: kubevirt/kubernetes.kubevirt collection_repo: kubevirt/kubevirt.core
dependencies: false dependencies: false
commit_changelog: true commit_changelog: true
commit_ghpages: false commit_ghpages: false

View File

@@ -1,9 +1,9 @@
# Lean Ansible bindings for KubeVirt # Lean Ansible bindings for KubeVirt
<!-- Add CI and code coverage badges here. Samples included below. --> <!-- Add CI and code coverage badges here. Samples included below. -->
[![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)
<!-- Describe the collection and why a user would want to use it. What does the collection do? --> <!-- Describe the collection and why a user would want to use it. What does the collection do? -->
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. 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: Before using this collection, you need to install it with the Ansible Galaxy command-line tool:
```bash ```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: 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 ```yaml
--- ---
collections: 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: 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 ```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`: 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 ```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. See [Ansible Using collections](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for more details.

View File

@@ -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 Welcome to Kubevirt Collection documentation
======================================= =======================================

View File

@@ -1,4 +1,4 @@
plugin: kubernetes.kubevirt.kubevirt plugin: kubevirt.core.kubevirt
connections: connections:
- namespaces: - namespaces:
- default - default

View File

@@ -1,4 +1,4 @@
plugin: kubernetes.kubevirt.kubevirt plugin: kubevirt.core.kubevirt
connections: connections:
- namespaces: - namespaces:
- default - default

View File

@@ -1,7 +1,7 @@
- hosts: localhost - hosts: localhost
tasks: tasks:
- name: Create VM - name: Create VM
kubernetes.kubevirt.kubevirt_vm: kubevirt.core.kubevirt_vm:
state: present state: present
name: testvm-with-dv name: testvm-with-dv
namespace: default namespace: default

View File

@@ -1,7 +1,7 @@
- hosts: localhost - hosts: localhost
tasks: tasks:
- name: Create VM - name: Create VM
kubernetes.kubevirt.kubevirt_vm: kubevirt.core.kubevirt_vm:
state: present state: present
name: testvm name: testvm
namespace: default namespace: default

View File

@@ -1,7 +1,7 @@
- hosts: localhost - hosts: localhost
tasks: tasks:
- name: Create VM - name: Create VM
kubernetes.kubevirt.kubevirt_vm: kubevirt.core.kubevirt_vm:
state: present state: present
name: testvm name: testvm
namespace: default namespace: default

View File

@@ -1,7 +1,7 @@
- hosts: localhost - hosts: localhost
tasks: tasks:
- name: Delete VM - name: Delete VM
kubernetes.kubevirt.kubevirt_vm: kubevirt.core.kubevirt_vm:
name: testvm-with-dv name: testvm-with-dv
namespace: default namespace: default
state: absent state: absent

View File

@@ -1,7 +1,7 @@
- hosts: localhost - hosts: localhost
tasks: tasks:
- name: Delete VM - name: Delete VM
kubernetes.kubevirt.kubevirt_vm: kubevirt.core.kubevirt_vm:
name: testvm name: testvm
namespace: default namespace: default
state: absent state: absent

View File

@@ -1,4 +1,4 @@
plugin: kubernetes.kubevirt.kubevirt plugin: kubevirt.core.kubevirt
connections: connections:
- namespaces: - namespaces:
- default - default

View File

@@ -1,7 +1,7 @@
# See https://docs.ansible.com/ansible/latest/dev_guide/collections_galaxy_meta.html # See https://docs.ansible.com/ansible/latest/dev_guide/collections_galaxy_meta.html
namespace: kubernetes namespace: kubevirt
name: kubevirt name: core
version: "0.1.0" version: "0.1.0"
readme: README.md readme: README.md
authors: authors:
@@ -20,10 +20,10 @@ tags:
- virtualization - virtualization
- cloud - cloud
- infrastructure - infrastructure
repository: https://github.com/kubevirt/kubernetes.kubevirt repository: https://github.com/kubevirt/kubevirt.core
documentation: https://github.com/kubevirt/kubernetes.kubevirt/tree/main/docs documentation: https://github.com/kubevirt/kubevirt.core/tree/main/docs
homepage: https://kubevirt.io homepage: https://kubevirt.io
issues: https://github.com/kubevirt/kubernetes.kubevirt/issues issues: https://github.com/kubevirt/kubevirt.core/issues
build_ignore: build_ignore:
- .gitignore - .gitignore
- changelogs/.plugin-cache.yaml - changelogs/.plugin-cache.yaml

View File

@@ -29,7 +29,7 @@ options:
plugin: plugin:
description: Token that ensures this is a source file for the "kubevirt" plugin. description: Token that ensures this is a source file for the "kubevirt" plugin.
required: True required: True
choices: ["kubevirt", "kubernetes.kubevirt.kubevirt"] choices: ["kubevirt", "kubevirt.core.kubevirt"]
host_format: host_format:
description: description:
- 'Specify the format of the host in the inventory group. Available specifiers: name, namespace, uid.' - '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] # Filename must end with kubevirt.[yml|yaml]
# Authenticate with token, and return all VirtualMachineInstances for all accessible namespaces # Authenticate with token, and return all VirtualMachineInstances for all accessible namespaces
plugin: kubernetes.kubevirt.kubevirt plugin: kubevirt.core.kubevirt
connections: connections:
- host: https://192.168.64.4:8443 - host: https://192.168.64.4:8443
api_key: xxxxxxxxxxxxxxxx api_key: xxxxxxxxxxxxxxxx
@@ -135,7 +135,7 @@ connections:
# Use default config (~/.kube/config) file and active context, and return VirtualMachineInstances # Use default config (~/.kube/config) file and active context, and return VirtualMachineInstances
# from namespace testing with interfaces connected to network bridge-network # from namespace testing with interfaces connected to network bridge-network
plugin: kubernetes.kubevirt.kubevirt plugin: kubevirt.core.kubevirt
connections: connections:
- namespaces: - namespaces:
- testing - testing
@@ -143,14 +143,14 @@ connections:
# Use default config (~/.kube/config) file and active context, and return VirtualMachineInstances # Use default config (~/.kube/config) file and active context, and return VirtualMachineInstances
# from namespace testing with label app=test # from namespace testing with label app=test
plugin: kubernetes.kubevirt.kubevirt plugin: kubevirt.core.kubevirt
connections: connections:
- namespaces: - namespaces:
- testing - testing
label_selector: app=test label_selector: app=test
# Use a custom config file, and a specific context. # Use a custom config file, and a specific context.
plugin: kubernetes.kubevirt.kubevirt plugin: kubevirt.core.kubevirt
connections: connections:
- kubeconfig: /path/to/config - kubeconfig: /path/to/config
context: 'awx/192-168-64-4:8443/developer' context: 'awx/192-168-64-4:8443/developer'
@@ -231,7 +231,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
This class implements the actual inventory module. This class implements the actual inventory module.
""" """
NAME = "kubernetes.kubevirt.kubevirt" NAME = "kubevirt.core.kubevirt"
connection_plugin = "kubernetes.core.kubectl" connection_plugin = "kubernetes.core.kubectl"
transport = "kubectl" transport = "kubectl"

View File

@@ -114,7 +114,7 @@ requirements:
EXAMPLES = """ EXAMPLES = """
- name: Create a VirtualMachine - name: Create a VirtualMachine
kubernetes.kubevirt.kubevirt_vm: kubevirt.core.kubevirt_vm:
state: present state: present
name: testvm name: testvm
namespace: default namespace: default
@@ -151,7 +151,7 @@ EXAMPLES = """
name: cloudinit name: cloudinit
- name: Create a VirtualMachine with a DataVolume template - name: Create a VirtualMachine with a DataVolume template
kubernetes.kubevirt.kubevirt_vm: kubevirt.core.kubevirt_vm:
state: present state: present
name: testvm-with-dv name: testvm-with-dv
namespace: default namespace: default
@@ -191,7 +191,7 @@ EXAMPLES = """
wait: yes wait: yes
- name: Delete a VirtualMachine - name: Delete a VirtualMachine
kubernetes.kubevirt.kubevirt_vm: kubevirt.core.kubevirt_vm:
name: testvm name: testvm
namespace: default namespace: default
state: absent state: absent

View File

@@ -41,10 +41,10 @@ EOF
################################################# #################################################
# run the plugin second # 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" cat << EOF > "$OUTPUT_DIR/test.kubevirt.yml"
plugin: kubernetes.kubevirt.kubevirt plugin: kubevirt.core.kubevirt
connections: connections:
- namespaces: - namespaces:
- default - default

View File

@@ -12,8 +12,8 @@ from unittest.mock import patch, ANY
from ansible.module_utils import basic from ansible.module_utils import basic
from ansible_collections.kubernetes.core.plugins.module_utils.k8s import runner from ansible_collections.kubernetes.core.plugins.module_utils.k8s import runner
from ansible_collections.kubernetes.kubevirt.plugins.modules import kubevirt_vm from ansible_collections.kubevirt.core.plugins.modules import kubevirt_vm
from ansible_collections.kubernetes.kubevirt.tests.unit.utils.ansible_module_mock import ( from ansible_collections.kubevirt.core.tests.unit.utils.ansible_module_mock import (
AnsibleFailJson, AnsibleFailJson,
AnsibleExitJson, AnsibleExitJson,
exit_json, exit_json,