From 2c93c997cf95fab98af3db9533a88560b7309a5e Mon Sep 17 00:00:00 2001 From: Bas Date: Mon, 6 Feb 2023 10:35:16 +0100 Subject: [PATCH] pre-commit autocorrected files (#9750) --- .ansible-lint | 7 +++ .pre-commit-config.yaml | 15 +++++++ CNAME | 2 +- LICENSE | 2 +- OWNERS | 2 +- contrib/aws_inventory/requirements.txt | 2 +- contrib/azurerm/.gitignore | 2 +- .../templates/inventory.j2 | 1 - .../templates/availability-sets.json | 2 +- .../generate-templates/templates/bastion.json | 2 +- .../templates/clear-rg.json | 2 +- .../generate-templates/templates/storage.json | 2 +- contrib/inventory_builder/requirements.txt | 2 +- .../inventory_builder/test-requirements.txt | 2 +- contrib/kvm-setup/group_vars/all | 1 - .../glusterfs/inventory.example | 1 - .../glusterfs-kubernetes-endpoint.json.j2 | 1 - contrib/terraform/equinix/output.tf | 1 - contrib/terraform/equinix/variables.tf | 1 - contrib/terraform/hetzner/main.tf | 2 +- .../kubernetes-cluster-flatcar/outputs.tf | 2 +- .../templates/machine.yaml.tmpl | 2 +- .../kubernetes-cluster-flatcar/versions.tf | 2 +- .../modules/kubernetes-cluster/output.tf | 2 +- .../templates/cloud-init.tmpl | 1 - .../terraform/openstack/modules/ips/main.tf | 1 - .../openstack/sample-inventory/cluster.tfvars | 2 +- .../modules/kubernetes-cluster/main.tf | 6 +-- docs/vars.md | 6 +-- inventory/sample/group_vars/all/etcd.yml | 2 +- inventory/sample/group_vars/all/upcloud.yml | 2 +- .../kube-controller-manager+merge.yaml | 2 +- .../sample/patches/kube-scheduler+merge.yaml | 2 +- logo/logo-clear.svg | 2 +- logo/logo-dark.svg | 2 +- logo/logo-text-clear.svg | 2 +- logo/logo-text-dark.svg | 2 +- logo/logo-text-mixed.svg | 2 +- pipeline.Dockerfile | 2 +- requirements-2.11.txt | 4 +- requirements-2.12.txt | 4 +- roles/bastion-ssh-config/defaults/main.yml | 2 +- .../containerd-common/meta/main.yml | 2 +- .../cri-o/templates/config.json.j2 | 2 +- .../docker/templates/docker-dns.conf.j2 | 2 +- .../templates/docker-orphan-cleanup.conf.j2 | 2 +- .../templates/configuration-qemu.toml.j2 | 2 +- roles/etcd/templates/etcd.env.j2 | 2 +- .../controller-manager-config.yml.j2 | 1 - .../oci/templates/oci-cloud-provider.yml.j2 | 1 - .../aws-ebs-csi-controllerservice.yml.j2 | 1 - .../templates/cinder-csi-cloud-config.j2 | 2 +- .../csi_driver/upcloud/defaults/main.yml | 2 +- .../csi_driver/upcloud/tasks/main.yml | 2 +- .../templates/upcloud-csi-controller.yml.j2 | 2 +- .../templates/upcloud-csi-driver.yml.j2 | 2 +- .../upcloud/templates/upcloud-csi-node.yml.j2 | 2 +- .../templates/upcloud-csi-setup.yml.j2 | 2 +- .../templates/vsphere-csi-namespace.yml.j2 | 2 +- .../alb_ingress_controller/OWNERS | 2 +- .../ingress_nginx/defaults/main.yml | 2 +- .../metrics_server/defaults/main.yml | 2 +- .../metrics-server-deployment.yaml.j2 | 2 +- .../network_plugin/kube-router/OWNERS | 2 +- .../persistent_volumes/meta/main.yml | 2 +- .../control-plane/tasks/psp-install.yml | 2 +- .../kubeadm-controlplane.v1beta3.yaml.j2 | 2 +- .../cloud-configs/gce-cloud-config.j2 | 3 +- .../templates/manifests/kube-vip.manifest.j2 | 1 - .../canal/templates/canal-config.yaml.j2 | 1 - .../cilium/templates/cilium/secret.yml.j2 | 2 +- roles/network_plugin/kube-router/OWNERS | 2 +- .../macvlan/files/ifdown-macvlan | 1 - .../network_plugin/macvlan/files/ifup-macvlan | 1 - .../templates/centos-network-macvlan.cfg.j2 | 1 - .../templates/centos-postdown-macvlan.cfg.j2 | 1 - .../templates/centos-postup-macvlan.cfg.j2 | 1 - .../templates/coreos-network-macvlan.cfg.j2 | 1 - .../templates/debian-network-macvlan.cfg.j2 | 1 - .../weave/templates/weave-net.yml.j2 | 2 +- run.rc | 45 +++++++++++++++++++ tests/files/vagrant_ubuntu18-flannel.rb | 2 +- tests/files/vagrant_ubuntu20-flannel.rb | 2 +- tests/requirements-2.11.txt | 12 ++--- tests/requirements-2.12.txt | 12 ++--- tests/scripts/md-table/requirements.txt | 2 +- tests/scripts/md-table/table.md.j2 | 4 +- tests/scripts/md-table/test.sh | 2 +- tests/scripts/vagrant_clean.sh | 2 +- 89 files changed, 150 insertions(+), 104 deletions(-) create mode 100644 run.rc diff --git a/.ansible-lint b/.ansible-lint index 048a89787..5848a6034 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -24,7 +24,14 @@ skip_list: # (Disabled in June 2021) - 'role-name' + - 'experimental' # [var-naming] "defaults/main.yml" File defines variable 'apiVersion' that violates variable naming standards # In Kubespray we use variables that use camelCase to match their k8s counterparts # (Disabled in June 2021) - 'var-naming' + - 'var-spacing' + + # [fqcn-builtins] + # Roles in kubespray don't need fully qualified collection names + # (Disabled in Feb 2023) + - 'fqcn-builtins' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 28cf7a907..3f4f0918c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,20 @@ --- repos: + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-executables-have-shebangs + - id: check-xml + - id: check-merge-conflict + - id: detect-private-key + - id: end-of-file-fixer + - id: forbid-new-submodules + - id: requirements-txt-fixer + - id: trailing-whitespace + - repo: https://github.com/adrienverge/yamllint.git rev: v1.27.1 hooks: diff --git a/CNAME b/CNAME index 4d47144bc..e5bd1ffa1 100644 --- a/CNAME +++ b/CNAME @@ -1 +1 @@ -kubespray.io \ No newline at end of file +kubespray.io diff --git a/LICENSE b/LICENSE index 51004adce..0b540e19a 100644 --- a/LICENSE +++ b/LICENSE @@ -187,7 +187,7 @@ identification within third-party archives. Copyright 2016 Kubespray - + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/OWNERS b/OWNERS index a52158cbd..e4ac17f45 100644 --- a/OWNERS +++ b/OWNERS @@ -5,4 +5,4 @@ approvers: reviewers: - kubespray-reviewers emeritus_approvers: - - kubespray-emeritus_approvers \ No newline at end of file + - kubespray-emeritus_approvers diff --git a/contrib/aws_inventory/requirements.txt b/contrib/aws_inventory/requirements.txt index 4989ce660..179d5de54 100644 --- a/contrib/aws_inventory/requirements.txt +++ b/contrib/aws_inventory/requirements.txt @@ -1 +1 @@ -boto3 # Apache-2.0 \ No newline at end of file +boto3 # Apache-2.0 diff --git a/contrib/azurerm/.gitignore b/contrib/azurerm/.gitignore index 3a04fb276..3ef07f874 100644 --- a/contrib/azurerm/.gitignore +++ b/contrib/azurerm/.gitignore @@ -1,2 +1,2 @@ .generated -/inventory \ No newline at end of file +/inventory diff --git a/contrib/azurerm/roles/generate-inventory_2/templates/inventory.j2 b/contrib/azurerm/roles/generate-inventory_2/templates/inventory.j2 index 6ab59df1b..2f6ac5c43 100644 --- a/contrib/azurerm/roles/generate-inventory_2/templates/inventory.j2 +++ b/contrib/azurerm/roles/generate-inventory_2/templates/inventory.j2 @@ -31,4 +31,3 @@ [k8s_cluster:children] kube_node kube_control_plane - diff --git a/contrib/azurerm/roles/generate-templates/templates/availability-sets.json b/contrib/azurerm/roles/generate-templates/templates/availability-sets.json index 4f458cd66..78c1547a9 100644 --- a/contrib/azurerm/roles/generate-templates/templates/availability-sets.json +++ b/contrib/azurerm/roles/generate-templates/templates/availability-sets.json @@ -27,4 +27,4 @@ } } ] -} \ No newline at end of file +} diff --git a/contrib/azurerm/roles/generate-templates/templates/bastion.json b/contrib/azurerm/roles/generate-templates/templates/bastion.json index d7fd9c8f6..4cf8fc7a6 100644 --- a/contrib/azurerm/roles/generate-templates/templates/bastion.json +++ b/contrib/azurerm/roles/generate-templates/templates/bastion.json @@ -103,4 +103,4 @@ } {% endif %} ] -} \ No newline at end of file +} diff --git a/contrib/azurerm/roles/generate-templates/templates/clear-rg.json b/contrib/azurerm/roles/generate-templates/templates/clear-rg.json index 5facf5e67..faf31e8cc 100644 --- a/contrib/azurerm/roles/generate-templates/templates/clear-rg.json +++ b/contrib/azurerm/roles/generate-templates/templates/clear-rg.json @@ -5,4 +5,4 @@ "variables": {}, "resources": [], "outputs": {} -} \ No newline at end of file +} diff --git a/contrib/azurerm/roles/generate-templates/templates/storage.json b/contrib/azurerm/roles/generate-templates/templates/storage.json index 2632aba2c..1ed086697 100644 --- a/contrib/azurerm/roles/generate-templates/templates/storage.json +++ b/contrib/azurerm/roles/generate-templates/templates/storage.json @@ -16,4 +16,4 @@ } } ] -} \ No newline at end of file +} diff --git a/contrib/inventory_builder/requirements.txt b/contrib/inventory_builder/requirements.txt index 3d833f66e..c54501a4b 100644 --- a/contrib/inventory_builder/requirements.txt +++ b/contrib/inventory_builder/requirements.txt @@ -1,3 +1,3 @@ configparser>=3.3.0 -ruamel.yaml>=0.15.88 ipaddress +ruamel.yaml>=0.15.88 diff --git a/contrib/inventory_builder/test-requirements.txt b/contrib/inventory_builder/test-requirements.txt index 4e334a094..98a662a4d 100644 --- a/contrib/inventory_builder/test-requirements.txt +++ b/contrib/inventory_builder/test-requirements.txt @@ -1,3 +1,3 @@ hacking>=0.10.2 -pytest>=2.8.0 mock>=1.3.0 +pytest>=2.8.0 diff --git a/contrib/kvm-setup/group_vars/all b/contrib/kvm-setup/group_vars/all index 6edfd8fd1..d497c5888 100644 --- a/contrib/kvm-setup/group_vars/all +++ b/contrib/kvm-setup/group_vars/all @@ -1,3 +1,2 @@ #k8s_deployment_user: kubespray #k8s_deployment_user_pkey_path: /tmp/ssh_rsa - diff --git a/contrib/network-storage/glusterfs/inventory.example b/contrib/network-storage/glusterfs/inventory.example index 84dd022e9..985647e8c 100644 --- a/contrib/network-storage/glusterfs/inventory.example +++ b/contrib/network-storage/glusterfs/inventory.example @@ -41,4 +41,3 @@ # [network-storage:children] # gfs-cluster - diff --git a/contrib/network-storage/glusterfs/roles/kubernetes-pv/ansible/templates/glusterfs-kubernetes-endpoint.json.j2 b/contrib/network-storage/glusterfs/roles/kubernetes-pv/ansible/templates/glusterfs-kubernetes-endpoint.json.j2 index 866c09f3e..36cc1ccca 100644 --- a/contrib/network-storage/glusterfs/roles/kubernetes-pv/ansible/templates/glusterfs-kubernetes-endpoint.json.j2 +++ b/contrib/network-storage/glusterfs/roles/kubernetes-pv/ansible/templates/glusterfs-kubernetes-endpoint.json.j2 @@ -21,4 +21,3 @@ {% endfor %} ] } - diff --git a/contrib/terraform/equinix/output.tf b/contrib/terraform/equinix/output.tf index 299bced95..f4ab63a94 100644 --- a/contrib/terraform/equinix/output.tf +++ b/contrib/terraform/equinix/output.tf @@ -13,4 +13,3 @@ output "k8s_etcds" { output "k8s_nodes" { value = equinix_metal_device.k8s_node.*.access_public_ipv4 } - diff --git a/contrib/terraform/equinix/variables.tf b/contrib/terraform/equinix/variables.tf index d8e2d3da1..82c701508 100644 --- a/contrib/terraform/equinix/variables.tf +++ b/contrib/terraform/equinix/variables.tf @@ -54,4 +54,3 @@ variable "number_of_etcd" { variable "number_of_k8s_nodes" { default = 1 } - diff --git a/contrib/terraform/hetzner/main.tf b/contrib/terraform/hetzner/main.tf index fc2f27108..d02a06484 100644 --- a/contrib/terraform/hetzner/main.tf +++ b/contrib/terraform/hetzner/main.tf @@ -53,4 +53,4 @@ resource "null_resource" "inventories" { triggers = { template = data.template_file.inventory.rendered } -} \ No newline at end of file +} diff --git a/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/outputs.tf b/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/outputs.tf index c6bb276da..5c31aaa00 100644 --- a/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/outputs.tf +++ b/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/outputs.tf @@ -24,4 +24,4 @@ output "cluster_private_network_cidr" { output "network_id" { value = hcloud_network.kubernetes.id -} \ No newline at end of file +} diff --git a/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/templates/machine.yaml.tmpl b/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/templates/machine.yaml.tmpl index 26e05f867..426cb09ae 100644 --- a/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/templates/machine.yaml.tmpl +++ b/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/templates/machine.yaml.tmpl @@ -13,4 +13,4 @@ storage: #!/bin/bash set -euo pipefail hostname="$(hostname)" - echo My name is ${name} and the hostname is $${hostname} \ No newline at end of file + echo My name is ${name} and the hostname is $${hostname} diff --git a/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/versions.tf b/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/versions.tf index 4291f8a61..5fa23ff85 100644 --- a/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/versions.tf +++ b/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/versions.tf @@ -10,4 +10,4 @@ terraform { source = "hashicorp/null" } } -} \ No newline at end of file +} diff --git a/contrib/terraform/hetzner/modules/kubernetes-cluster/output.tf b/contrib/terraform/hetzner/modules/kubernetes-cluster/output.tf index c6bb276da..5c31aaa00 100644 --- a/contrib/terraform/hetzner/modules/kubernetes-cluster/output.tf +++ b/contrib/terraform/hetzner/modules/kubernetes-cluster/output.tf @@ -24,4 +24,4 @@ output "cluster_private_network_cidr" { output "network_id" { value = hcloud_network.kubernetes.id -} \ No newline at end of file +} diff --git a/contrib/terraform/hetzner/modules/kubernetes-cluster/templates/cloud-init.tmpl b/contrib/terraform/hetzner/modules/kubernetes-cluster/templates/cloud-init.tmpl index c81aef5dd..02a4e2dd0 100644 --- a/contrib/terraform/hetzner/modules/kubernetes-cluster/templates/cloud-init.tmpl +++ b/contrib/terraform/hetzner/modules/kubernetes-cluster/templates/cloud-init.tmpl @@ -14,4 +14,3 @@ ssh_authorized_keys: %{ for ssh_public_key in ssh_public_keys ~} - ${ssh_public_key} %{ endfor ~} - diff --git a/contrib/terraform/openstack/modules/ips/main.tf b/contrib/terraform/openstack/modules/ips/main.tf index 3f962fdfc..b0989dcc2 100644 --- a/contrib/terraform/openstack/modules/ips/main.tf +++ b/contrib/terraform/openstack/modules/ips/main.tf @@ -44,4 +44,3 @@ resource "openstack_networking_floatingip_v2" "k8s_nodes" { pool = var.floatingip_pool depends_on = [null_resource.dummy_dependency] } - diff --git a/contrib/terraform/openstack/sample-inventory/cluster.tfvars b/contrib/terraform/openstack/sample-inventory/cluster.tfvars index 3c2576775..8ab7c6d38 100644 --- a/contrib/terraform/openstack/sample-inventory/cluster.tfvars +++ b/contrib/terraform/openstack/sample-inventory/cluster.tfvars @@ -86,4 +86,4 @@ floatingip_pool = "" bastion_allowed_remote_ips = ["0.0.0.0/0"] # Force port security to be null. Some cloud providers do not allow to set port security. -# force_null_port_security = false \ No newline at end of file +# force_null_port_security = false diff --git a/contrib/terraform/upcloud/modules/kubernetes-cluster/main.tf b/contrib/terraform/upcloud/modules/kubernetes-cluster/main.tf index afa801948..d638c3e74 100644 --- a/contrib/terraform/upcloud/modules/kubernetes-cluster/main.tf +++ b/contrib/terraform/upcloud/modules/kubernetes-cluster/main.tf @@ -80,7 +80,7 @@ resource "upcloud_server" "master" { lifecycle { ignore_changes = [storage_devices] } - + firewall = var.firewall_enabled dynamic "storage_devices" { @@ -525,7 +525,7 @@ resource "upcloud_loadbalancer_backend" "lb_backend" { resource "upcloud_loadbalancer_frontend" "lb_frontend" { for_each = var.loadbalancer_enabled ? var.loadbalancers : {} - + loadbalancer = upcloud_loadbalancer.lb[0].id name = "lb-frontend-${each.key}" mode = "tcp" @@ -535,7 +535,7 @@ resource "upcloud_loadbalancer_frontend" "lb_frontend" { resource "upcloud_loadbalancer_static_backend_member" "lb_backend_member" { for_each = { - for be_server in local.lb_backend_servers: + for be_server in local.lb_backend_servers: "${be_server.server_name}-lb-backend-${be_server.lb_name}" => be_server if var.loadbalancer_enabled } diff --git a/docs/vars.md b/docs/vars.md index 877c78f7e..2fa8ea029 100644 --- a/docs/vars.md +++ b/docs/vars.md @@ -189,7 +189,7 @@ Stack](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/dns-stack.m * *http_proxy/https_proxy/no_proxy/no_proxy_exclude_workers/additional_no_proxy* - Proxy variables for deploying behind a proxy. Note that no_proxy defaults to all internal cluster IPs and hostnames that correspond to each node. - + * *kubelet_cgroup_driver* - Allows manual override of the cgroup-driver option for Kubelet. By default autodetection is used to match container manager configuration. `systemd` is the preferred driver for `containerd` though it can have issues with `cgroups v1` and `kata-containers` in which case you may want to change to `cgroupfs`. @@ -213,9 +213,9 @@ Stack](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/dns-stack.m * *kubelet_secure_addresses* - By default *kubelet_systemd_hardening* set the **control plane** `ansible_host` IPs as the `kubelet_secure_addresses`. In case you have multiple interfaces in your control plane nodes and the `kube-apiserver` is not bound to the default interface, you can override them with this variable. Example: - + The **control plane** node may have 2 interfaces with the following IP addresses: `eth0:10.0.0.110`, `eth1:192.168.1.110`. - + By default the `kubelet_secure_addresses` is set with the `10.0.0.110` the ansible control host uses `eth0` to connect to the machine. In case you want to use `eth1` as the outgoing interface on which `kube-apiserver` connects to the `kubelet`s, you should override the variable in this way: `kubelet_secure_addresses: "192.168.1.110"`. * *node_labels* - Labels applied to nodes via `kubectl label node`. diff --git a/inventory/sample/group_vars/all/etcd.yml b/inventory/sample/group_vars/all/etcd.yml index 7206a06b5..39600c35f 100644 --- a/inventory/sample/group_vars/all/etcd.yml +++ b/inventory/sample/group_vars/all/etcd.yml @@ -13,4 +13,4 @@ etcd_data_dir: /var/lib/etcd ## Settings for etcd deployment type # Set this to docker if you are using container_manager: docker -etcd_deployment_type: host \ No newline at end of file +etcd_deployment_type: host diff --git a/inventory/sample/group_vars/all/upcloud.yml b/inventory/sample/group_vars/all/upcloud.yml index c2d7f5df8..f05435daa 100644 --- a/inventory/sample/group_vars/all/upcloud.yml +++ b/inventory/sample/group_vars/all/upcloud.yml @@ -21,4 +21,4 @@ # is_default: false # expand_persistent_volumes: true # parameters: -# tier: hdd \ No newline at end of file +# tier: hdd diff --git a/inventory/sample/patches/kube-controller-manager+merge.yaml b/inventory/sample/patches/kube-controller-manager+merge.yaml index a8aa5a785..3f0fbbcd5 100644 --- a/inventory/sample/patches/kube-controller-manager+merge.yaml +++ b/inventory/sample/patches/kube-controller-manager+merge.yaml @@ -5,4 +5,4 @@ metadata: name: kube-controller-manager annotations: prometheus.io/scrape: 'true' - prometheus.io/port: '10257' \ No newline at end of file + prometheus.io/port: '10257' diff --git a/inventory/sample/patches/kube-scheduler+merge.yaml b/inventory/sample/patches/kube-scheduler+merge.yaml index 0bb39509d..00f457237 100644 --- a/inventory/sample/patches/kube-scheduler+merge.yaml +++ b/inventory/sample/patches/kube-scheduler+merge.yaml @@ -5,4 +5,4 @@ metadata: name: kube-scheduler annotations: prometheus.io/scrape: 'true' - prometheus.io/port: '10259' \ No newline at end of file + prometheus.io/port: '10259' diff --git a/logo/logo-clear.svg b/logo/logo-clear.svg index 00798d6d8..7d6023212 100644 --- a/logo/logo-clear.svg +++ b/logo/logo-clear.svg @@ -77,4 +77,4 @@ - \ No newline at end of file + diff --git a/logo/logo-dark.svg b/logo/logo-dark.svg index d9d8cb56b..3f6f0a66f 100644 --- a/logo/logo-dark.svg +++ b/logo/logo-dark.svg @@ -80,4 +80,4 @@ - \ No newline at end of file + diff --git a/logo/logo-text-clear.svg b/logo/logo-text-clear.svg index c24f78819..b1029ded9 100644 --- a/logo/logo-text-clear.svg +++ b/logo/logo-text-clear.svg @@ -104,4 +104,4 @@ - \ No newline at end of file + diff --git a/logo/logo-text-dark.svg b/logo/logo-text-dark.svg index 171df353d..52bdb4e1e 100644 --- a/logo/logo-text-dark.svg +++ b/logo/logo-text-dark.svg @@ -107,4 +107,4 @@ - \ No newline at end of file + diff --git a/logo/logo-text-mixed.svg b/logo/logo-text-mixed.svg index ed058c07c..44ea1feb6 100644 --- a/logo/logo-text-mixed.svg +++ b/logo/logo-text-mixed.svg @@ -107,4 +107,4 @@ - \ No newline at end of file + diff --git a/pipeline.Dockerfile b/pipeline.Dockerfile index 10fe1d845..7e1667db1 100644 --- a/pipeline.Dockerfile +++ b/pipeline.Dockerfile @@ -48,4 +48,4 @@ RUN wget https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAG # Install Kubernetes collections RUN pip3 install kubernetes \ - && ansible-galaxy collection install kubernetes.core \ No newline at end of file + && ansible-galaxy collection install kubernetes.core diff --git a/requirements-2.11.txt b/requirements-2.11.txt index ef2e02315..b38115915 100644 --- a/requirements-2.11.txt +++ b/requirements-2.11.txt @@ -2,9 +2,9 @@ ansible==4.10.0 ansible-core==2.11.11 cryptography==3.4.8 jinja2==2.11.3 +jmespath==0.9.5 +MarkupSafe==1.1.1 netaddr==0.7.19 pbr==5.4.4 -jmespath==0.9.5 ruamel.yaml==0.16.10 ruamel.yaml.clib==0.2.7 -MarkupSafe==1.1.1 diff --git a/requirements-2.12.txt b/requirements-2.12.txt index 722cc99e3..14779e2a9 100644 --- a/requirements-2.12.txt +++ b/requirements-2.12.txt @@ -2,9 +2,9 @@ ansible==5.7.1 ansible-core==2.12.5 cryptography==3.4.8 jinja2==2.11.3 +jmespath==0.9.5 +MarkupSafe==1.1.1 netaddr==0.7.19 pbr==5.4.4 -jmespath==0.9.5 ruamel.yaml==0.16.10 ruamel.yaml.clib==0.2.7 -MarkupSafe==1.1.1 diff --git a/roles/bastion-ssh-config/defaults/main.yml b/roles/bastion-ssh-config/defaults/main.yml index d322814e9..83aafedef 100644 --- a/roles/bastion-ssh-config/defaults/main.yml +++ b/roles/bastion-ssh-config/defaults/main.yml @@ -1,2 +1,2 @@ --- -ssh_bastion_confing__name: ssh-bastion.conf \ No newline at end of file +ssh_bastion_confing__name: ssh-bastion.conf diff --git a/roles/container-engine/containerd-common/meta/main.yml b/roles/container-engine/containerd-common/meta/main.yml index a4159c5bf..61d3ffe4f 100644 --- a/roles/container-engine/containerd-common/meta/main.yml +++ b/roles/container-engine/containerd-common/meta/main.yml @@ -1,2 +1,2 @@ --- -allow_duplicates: true \ No newline at end of file +allow_duplicates: true diff --git a/roles/container-engine/cri-o/templates/config.json.j2 b/roles/container-engine/cri-o/templates/config.json.j2 index 522ade7a4..4afd49f6b 100644 --- a/roles/container-engine/cri-o/templates/config.json.j2 +++ b/roles/container-engine/cri-o/templates/config.json.j2 @@ -1,5 +1,5 @@ {% if crio_registry_auth is defined and crio_registry_auth|length %} -{ +{ {% for reg in crio_registry_auth %} "auths": { "{{ reg.registry }}": { diff --git a/roles/container-engine/docker/templates/docker-dns.conf.j2 b/roles/container-engine/docker/templates/docker-dns.conf.j2 index d501a19c0..01dbd3b20 100644 --- a/roles/container-engine/docker/templates/docker-dns.conf.j2 +++ b/roles/container-engine/docker/templates/docker-dns.conf.j2 @@ -3,4 +3,4 @@ Environment="DOCKER_DNS_OPTIONS=\ {% for d in docker_dns_servers %}--dns {{ d }} {% endfor %} \ {% for d in docker_dns_search_domains %}--dns-search {{ d }} {% endfor %} \ {% for o in docker_dns_options %}--dns-opt {{ o }} {% endfor %} \ -" \ No newline at end of file +" diff --git a/roles/container-engine/docker/templates/docker-orphan-cleanup.conf.j2 b/roles/container-engine/docker/templates/docker-orphan-cleanup.conf.j2 index 787a941ed..370f1e71a 100644 --- a/roles/container-engine/docker/templates/docker-orphan-cleanup.conf.j2 +++ b/roles/container-engine/docker/templates/docker-orphan-cleanup.conf.j2 @@ -1,2 +1,2 @@ [Service] -ExecStartPost=-{{ bin_dir }}/cleanup-docker-orphans.sh \ No newline at end of file +ExecStartPost=-{{ bin_dir }}/cleanup-docker-orphans.sh diff --git a/roles/container-engine/kata-containers/templates/configuration-qemu.toml.j2 b/roles/container-engine/kata-containers/templates/configuration-qemu.toml.j2 index 40382423d..9e89deeda 100644 --- a/roles/container-engine/kata-containers/templates/configuration-qemu.toml.j2 +++ b/roles/container-engine/kata-containers/templates/configuration-qemu.toml.j2 @@ -375,7 +375,7 @@ valid_entropy_sources = ["/dev/urandom","/dev/random",""] # When enable_guest_swap is enabled, insert a raw file to the guest as the swap device # if the swappiness of a container (set by annotation "io.katacontainers.container.resource.swappiness") # is bigger than 0. -# The size of the swap device should be +# The size of the swap device should be # swap_in_bytes (set by annotation "io.katacontainers.container.resource.swap_in_bytes") - memory_limit_in_bytes. # If swap_in_bytes is not set, the size should be memory_limit_in_bytes. # If swap_in_bytes and memory_limit_in_bytes is not set, the size should diff --git a/roles/etcd/templates/etcd.env.j2 b/roles/etcd/templates/etcd.env.j2 index 18395c9b6..c3013f679 100644 --- a/roles/etcd/templates/etcd.env.j2 +++ b/roles/etcd/templates/etcd.env.j2 @@ -65,4 +65,4 @@ ETCDCTL_CERT={{ etcd_cert_dir }}/admin-{{ inventory_hostname }}.pem # ETCD 3.5.x issue # https://groups.google.com/a/kubernetes.io/g/dev/c/B7gJs88XtQc/m/rSgNOzV2BwAJ?utm_medium=email&utm_source=footer -ETCD_EXPERIMENTAL_INITIAL_CORRUPT_CHECK={{ etcd_experimental_initial_corrupt_check }} \ No newline at end of file +ETCD_EXPERIMENTAL_INITIAL_CORRUPT_CHECK={{ etcd_experimental_initial_corrupt_check }} diff --git a/roles/kubernetes-apps/cloud_controller/oci/templates/controller-manager-config.yml.j2 b/roles/kubernetes-apps/cloud_controller/oci/templates/controller-manager-config.yml.j2 index b8dcc60fa..de7709354 100644 --- a/roles/kubernetes-apps/cloud_controller/oci/templates/controller-manager-config.yml.j2 +++ b/roles/kubernetes-apps/cloud_controller/oci/templates/controller-manager-config.yml.j2 @@ -87,4 +87,3 @@ rateLimiter: rateLimitBucketWrite: {{ oci_rate_limit.rate_limit_bucket_write }} {% endif %} {% endif %} - diff --git a/roles/kubernetes-apps/cloud_controller/oci/templates/oci-cloud-provider.yml.j2 b/roles/kubernetes-apps/cloud_controller/oci/templates/oci-cloud-provider.yml.j2 index bacd1e95c..d50f1393f 100644 --- a/roles/kubernetes-apps/cloud_controller/oci/templates/oci-cloud-provider.yml.j2 +++ b/roles/kubernetes-apps/cloud_controller/oci/templates/oci-cloud-provider.yml.j2 @@ -70,4 +70,3 @@ spec: - name: kubernetes mountPath: /etc/kubernetes readOnly: true - diff --git a/roles/kubernetes-apps/csi_driver/aws_ebs/templates/aws-ebs-csi-controllerservice.yml.j2 b/roles/kubernetes-apps/csi_driver/aws_ebs/templates/aws-ebs-csi-controllerservice.yml.j2 index ffce40bd8..d58490aeb 100644 --- a/roles/kubernetes-apps/csi_driver/aws_ebs/templates/aws-ebs-csi-controllerservice.yml.j2 +++ b/roles/kubernetes-apps/csi_driver/aws_ebs/templates/aws-ebs-csi-controllerservice.yml.j2 @@ -129,4 +129,3 @@ spec: volumes: - name: socket-dir emptyDir: {} - diff --git a/roles/kubernetes-apps/csi_driver/cinder/templates/cinder-csi-cloud-config.j2 b/roles/kubernetes-apps/csi_driver/cinder/templates/cinder-csi-cloud-config.j2 index 1a83f7dbd..04d0c68ab 100644 --- a/roles/kubernetes-apps/csi_driver/cinder/templates/cinder-csi-cloud-config.j2 +++ b/roles/kubernetes-apps/csi_driver/cinder/templates/cinder-csi-cloud-config.j2 @@ -41,4 +41,4 @@ node-volume-attach-limit="{{ node_volume_attach_limit }}" {% endif %} {% if cinder_csi_rescan_on_resize is defined %} rescan-on-resize={{ cinder_csi_rescan_on_resize | bool }} -{% endif %} \ No newline at end of file +{% endif %} diff --git a/roles/kubernetes-apps/csi_driver/upcloud/defaults/main.yml b/roles/kubernetes-apps/csi_driver/upcloud/defaults/main.yml index 657b3006d..0f9eac471 100644 --- a/roles/kubernetes-apps/csi_driver/upcloud/defaults/main.yml +++ b/roles/kubernetes-apps/csi_driver/upcloud/defaults/main.yml @@ -13,4 +13,4 @@ upcloud_csi_snapshot_controller_replicas: 2 upcloud_csi_snapshotter_image_tag: "v4.2.1" upcloud_csi_snapshot_controller_image_tag: "v4.2.1" upcloud_csi_snapshot_validation_webhook_image_tag: "v4.2.1" -upcloud_cacert: "{{ lookup('env','OS_CACERT') }}" \ No newline at end of file +upcloud_cacert: "{{ lookup('env','OS_CACERT') }}" diff --git a/roles/kubernetes-apps/csi_driver/upcloud/tasks/main.yml b/roles/kubernetes-apps/csi_driver/upcloud/tasks/main.yml index f37daba92..63e37bcf5 100644 --- a/roles/kubernetes-apps/csi_driver/upcloud/tasks/main.yml +++ b/roles/kubernetes-apps/csi_driver/upcloud/tasks/main.yml @@ -37,4 +37,4 @@ - inventory_hostname == groups['kube_control_plane'][0] - not item is skipped loop_control: - label: "{{ item.item.file }}" \ No newline at end of file + label: "{{ item.item.file }}" diff --git a/roles/kubernetes-apps/csi_driver/upcloud/templates/upcloud-csi-controller.yml.j2 b/roles/kubernetes-apps/csi_driver/upcloud/templates/upcloud-csi-controller.yml.j2 index 0d52837a9..1b8519dfa 100644 --- a/roles/kubernetes-apps/csi_driver/upcloud/templates/upcloud-csi-controller.yml.j2 +++ b/roles/kubernetes-apps/csi_driver/upcloud/templates/upcloud-csi-controller.yml.j2 @@ -90,4 +90,4 @@ spec: - name: regcred volumes: - name: socket-dir - emptyDir: {} \ No newline at end of file + emptyDir: {} diff --git a/roles/kubernetes-apps/csi_driver/upcloud/templates/upcloud-csi-driver.yml.j2 b/roles/kubernetes-apps/csi_driver/upcloud/templates/upcloud-csi-driver.yml.j2 index 363394a21..8f4c61224 100644 --- a/roles/kubernetes-apps/csi_driver/upcloud/templates/upcloud-csi-driver.yml.j2 +++ b/roles/kubernetes-apps/csi_driver/upcloud/templates/upcloud-csi-driver.yml.j2 @@ -5,4 +5,4 @@ metadata: spec: attachRequired: true podInfoOnMount: true - fsGroupPolicy: File \ No newline at end of file + fsGroupPolicy: File diff --git a/roles/kubernetes-apps/csi_driver/upcloud/templates/upcloud-csi-node.yml.j2 b/roles/kubernetes-apps/csi_driver/upcloud/templates/upcloud-csi-node.yml.j2 index 7173c6baf..7ed39be47 100644 --- a/roles/kubernetes-apps/csi_driver/upcloud/templates/upcloud-csi-node.yml.j2 +++ b/roles/kubernetes-apps/csi_driver/upcloud/templates/upcloud-csi-node.yml.j2 @@ -98,4 +98,4 @@ spec: {% if upcloud_tolerations %} tolerations: {{ upcloud_tolerations | to_nice_yaml(indent=2) | indent(width=8) }} -{% endif %} \ No newline at end of file +{% endif %} diff --git a/roles/kubernetes-apps/csi_driver/upcloud/templates/upcloud-csi-setup.yml.j2 b/roles/kubernetes-apps/csi_driver/upcloud/templates/upcloud-csi-setup.yml.j2 index 3bc0bd580..5af71d2fb 100644 --- a/roles/kubernetes-apps/csi_driver/upcloud/templates/upcloud-csi-setup.yml.j2 +++ b/roles/kubernetes-apps/csi_driver/upcloud/templates/upcloud-csi-setup.yml.j2 @@ -182,4 +182,4 @@ subjects: roleRef: kind: ClusterRole name: csi-upcloud-resizer-role - apiGroup: rbac.authorization.k8s.io \ No newline at end of file + apiGroup: rbac.authorization.k8s.io diff --git a/roles/kubernetes-apps/csi_driver/vsphere/templates/vsphere-csi-namespace.yml.j2 b/roles/kubernetes-apps/csi_driver/vsphere/templates/vsphere-csi-namespace.yml.j2 index 0a28bda12..6cf31509a 100644 --- a/roles/kubernetes-apps/csi_driver/vsphere/templates/vsphere-csi-namespace.yml.j2 +++ b/roles/kubernetes-apps/csi_driver/vsphere/templates/vsphere-csi-namespace.yml.j2 @@ -1,4 +1,4 @@ apiVersion: v1 kind: Namespace metadata: - name: "{{ vsphere_csi_namespace }}" \ No newline at end of file + name: "{{ vsphere_csi_namespace }}" diff --git a/roles/kubernetes-apps/ingress_controller/alb_ingress_controller/OWNERS b/roles/kubernetes-apps/ingress_controller/alb_ingress_controller/OWNERS index e8c0fcc26..a80e72427 100644 --- a/roles/kubernetes-apps/ingress_controller/alb_ingress_controller/OWNERS +++ b/roles/kubernetes-apps/ingress_controller/alb_ingress_controller/OWNERS @@ -3,4 +3,4 @@ approvers: - kubespray-approvers reviewers: - - kubespray-reviewers \ No newline at end of file + - kubespray-reviewers diff --git a/roles/kubernetes-apps/ingress_controller/ingress_nginx/defaults/main.yml b/roles/kubernetes-apps/ingress_controller/ingress_nginx/defaults/main.yml index 10cf1a7fc..16dfe9a46 100644 --- a/roles/kubernetes-apps/ingress_controller/ingress_nginx/defaults/main.yml +++ b/roles/kubernetes-apps/ingress_controller/ingress_nginx/defaults/main.yml @@ -17,4 +17,4 @@ ingress_nginx_termination_grace_period_seconds: 300 ingress_nginx_webhook_enabled: false ingress_nginx_webhook_job_ttl: 1800 -ingress_nginx_probe_initial_delay_seconds: 10 \ No newline at end of file +ingress_nginx_probe_initial_delay_seconds: 10 diff --git a/roles/kubernetes-apps/metrics_server/defaults/main.yml b/roles/kubernetes-apps/metrics_server/defaults/main.yml index 4e247a166..548cf0ee8 100644 --- a/roles/kubernetes-apps/metrics_server/defaults/main.yml +++ b/roles/kubernetes-apps/metrics_server/defaults/main.yml @@ -8,4 +8,4 @@ metrics_server_limits_memory: 200Mi metrics_server_requests_cpu: 100m metrics_server_requests_memory: 200Mi metrics_server_host_network: false -metrics_server_replicas: 1 \ No newline at end of file +metrics_server_replicas: 1 diff --git a/roles/kubernetes-apps/metrics_server/templates/metrics-server-deployment.yaml.j2 b/roles/kubernetes-apps/metrics_server/templates/metrics-server-deployment.yaml.j2 index 86247b9e1..d44dc8f5e 100644 --- a/roles/kubernetes-apps/metrics_server/templates/metrics-server-deployment.yaml.j2 +++ b/roles/kubernetes-apps/metrics_server/templates/metrics-server-deployment.yaml.j2 @@ -104,4 +104,4 @@ spec: - metrics-server topologyKey: kubernetes.io/hostname namespaces: - - kube-system \ No newline at end of file + - kube-system diff --git a/roles/kubernetes-apps/network_plugin/kube-router/OWNERS b/roles/kubernetes-apps/network_plugin/kube-router/OWNERS index c95aad2e3..c40af3c30 100644 --- a/roles/kubernetes-apps/network_plugin/kube-router/OWNERS +++ b/roles/kubernetes-apps/network_plugin/kube-router/OWNERS @@ -3,4 +3,4 @@ approvers: - bozzo reviewers: - - bozzo \ No newline at end of file + - bozzo diff --git a/roles/kubernetes-apps/persistent_volumes/meta/main.yml b/roles/kubernetes-apps/persistent_volumes/meta/main.yml index fdfd80778..e3066bb62 100644 --- a/roles/kubernetes-apps/persistent_volumes/meta/main.yml +++ b/roles/kubernetes-apps/persistent_volumes/meta/main.yml @@ -40,4 +40,4 @@ dependencies: - upcloud_csi_enabled tags: - persistent_volumes_upcloud_csi - - upcloud-csi-driver \ No newline at end of file + - upcloud-csi-driver diff --git a/roles/kubernetes/control-plane/tasks/psp-install.yml b/roles/kubernetes/control-plane/tasks/psp-install.yml index 581d1286d..4a990f82a 100644 --- a/roles/kubernetes/control-plane/tasks/psp-install.yml +++ b/roles/kubernetes/control-plane/tasks/psp-install.yml @@ -35,4 +35,4 @@ environment: KUBECONFIG: "{{ kube_config_dir }}/admin.conf" loop_control: - label: "{{ item.item.file }}" \ No newline at end of file + label: "{{ item.item.file }}" diff --git a/roles/kubernetes/control-plane/templates/kubeadm-controlplane.v1beta3.yaml.j2 b/roles/kubernetes/control-plane/templates/kubeadm-controlplane.v1beta3.yaml.j2 index b4b3c5ecc..78e399d5f 100644 --- a/roles/kubernetes/control-plane/templates/kubeadm-controlplane.v1beta3.yaml.j2 +++ b/roles/kubernetes/control-plane/templates/kubeadm-controlplane.v1beta3.yaml.j2 @@ -31,4 +31,4 @@ nodeRegistration: {% if kubeadm_patches is defined and kubeadm_patches.enabled %} patches: directory: {{ kubeadm_patches.dest_dir }} -{% endif %} \ No newline at end of file +{% endif %} diff --git a/roles/kubernetes/node/templates/cloud-configs/gce-cloud-config.j2 b/roles/kubernetes/node/templates/cloud-configs/gce-cloud-config.j2 index f4cac50f3..399512677 100644 --- a/roles/kubernetes/node/templates/cloud-configs/gce-cloud-config.j2 +++ b/roles/kubernetes/node/templates/cloud-configs/gce-cloud-config.j2 @@ -1,3 +1,2 @@ [global] -node-tags = {{ gce_node_tags }} - +node-tags = {{ gce_node_tags }} diff --git a/roles/kubernetes/node/templates/manifests/kube-vip.manifest.j2 b/roles/kubernetes/node/templates/manifests/kube-vip.manifest.j2 index 3de8b8aec..1ed5f492a 100644 --- a/roles/kubernetes/node/templates/manifests/kube-vip.manifest.j2 +++ b/roles/kubernetes/node/templates/manifests/kube-vip.manifest.j2 @@ -94,4 +94,3 @@ spec: path: /etc/kubernetes/admin.conf name: kubeconfig status: {} - diff --git a/roles/network_plugin/canal/templates/canal-config.yaml.j2 b/roles/network_plugin/canal/templates/canal-config.yaml.j2 index 8aab6fb75..81f7f5de8 100644 --- a/roles/network_plugin/canal/templates/canal-config.yaml.j2 +++ b/roles/network_plugin/canal/templates/canal-config.yaml.j2 @@ -77,4 +77,3 @@ data: "Type": "vxlan" } } - diff --git a/roles/network_plugin/cilium/templates/cilium/secret.yml.j2 b/roles/network_plugin/cilium/templates/cilium/secret.yml.j2 index a5fcc56eb..776c68938 100644 --- a/roles/network_plugin/cilium/templates/cilium/secret.yml.j2 +++ b/roles/network_plugin/cilium/templates/cilium/secret.yml.j2 @@ -6,4 +6,4 @@ kind: Secret metadata: name: cilium-ipsec-keys namespace: kube-system -type: Opaque \ No newline at end of file +type: Opaque diff --git a/roles/network_plugin/kube-router/OWNERS b/roles/network_plugin/kube-router/OWNERS index c95aad2e3..c40af3c30 100644 --- a/roles/network_plugin/kube-router/OWNERS +++ b/roles/network_plugin/kube-router/OWNERS @@ -3,4 +3,4 @@ approvers: - bozzo reviewers: - - bozzo \ No newline at end of file + - bozzo diff --git a/roles/network_plugin/macvlan/files/ifdown-macvlan b/roles/network_plugin/macvlan/files/ifdown-macvlan index 4d26db5af..b79b9c11e 100755 --- a/roles/network_plugin/macvlan/files/ifdown-macvlan +++ b/roles/network_plugin/macvlan/files/ifdown-macvlan @@ -38,4 +38,3 @@ fi ${OTHERSCRIPT} ${CONFIG} ip link del ${DEVICE} type ${TYPE:-macvlan} - diff --git a/roles/network_plugin/macvlan/files/ifup-macvlan b/roles/network_plugin/macvlan/files/ifup-macvlan index 8dc61aad2..97daec0c4 100755 --- a/roles/network_plugin/macvlan/files/ifup-macvlan +++ b/roles/network_plugin/macvlan/files/ifup-macvlan @@ -41,4 +41,3 @@ ip link add \ type ${TYPE:-macvlan} mode ${MACVLAN_MODE:-private} ${OTHERSCRIPT} ${CONFIG} - diff --git a/roles/network_plugin/macvlan/templates/centos-network-macvlan.cfg.j2 b/roles/network_plugin/macvlan/templates/centos-network-macvlan.cfg.j2 index e7bad788e..a7431c8b4 100644 --- a/roles/network_plugin/macvlan/templates/centos-network-macvlan.cfg.j2 +++ b/roles/network_plugin/macvlan/templates/centos-network-macvlan.cfg.j2 @@ -11,4 +11,3 @@ MACVLAN_MODE=bridge IPADDR={{ node_pod_cidr|ipaddr('net')|ipaddr(1)|ipaddr('address') }} NETMASK={{ node_pod_cidr|ipaddr('netmask') }} NETWORK={{ node_pod_cidr|ipaddr('network') }} - diff --git a/roles/network_plugin/macvlan/templates/centos-postdown-macvlan.cfg.j2 b/roles/network_plugin/macvlan/templates/centos-postdown-macvlan.cfg.j2 index f3edd99b9..d62ac2e7d 100644 --- a/roles/network_plugin/macvlan/templates/centos-postdown-macvlan.cfg.j2 +++ b/roles/network_plugin/macvlan/templates/centos-postdown-macvlan.cfg.j2 @@ -1,4 +1,3 @@ {% if enable_nat_default_gateway %} iptables -t nat -D POSTROUTING -s {{ node_pod_cidr|ipaddr('net') }} -o {{ node_default_gateway_interface }} -j MASQUERADE {% endif %} - diff --git a/roles/network_plugin/macvlan/templates/centos-postup-macvlan.cfg.j2 b/roles/network_plugin/macvlan/templates/centos-postup-macvlan.cfg.j2 index 35cd5b542..340bf7257 100644 --- a/roles/network_plugin/macvlan/templates/centos-postup-macvlan.cfg.j2 +++ b/roles/network_plugin/macvlan/templates/centos-postup-macvlan.cfg.j2 @@ -1,4 +1,3 @@ {% if enable_nat_default_gateway %} iptables -t nat -I POSTROUTING -s {{ node_pod_cidr|ipaddr('net') }} -o {{ node_default_gateway_interface }} -j MASQUERADE {% endif %} - diff --git a/roles/network_plugin/macvlan/templates/coreos-network-macvlan.cfg.j2 b/roles/network_plugin/macvlan/templates/coreos-network-macvlan.cfg.j2 index 696eba501..ac6738989 100644 --- a/roles/network_plugin/macvlan/templates/coreos-network-macvlan.cfg.j2 +++ b/roles/network_plugin/macvlan/templates/coreos-network-macvlan.cfg.j2 @@ -15,4 +15,3 @@ GatewayOnlink=yes {% endif %} {% endif %} {% endfor %} - diff --git a/roles/network_plugin/macvlan/templates/debian-network-macvlan.cfg.j2 b/roles/network_plugin/macvlan/templates/debian-network-macvlan.cfg.j2 index 9edd6d157..3b3e2e4ca 100644 --- a/roles/network_plugin/macvlan/templates/debian-network-macvlan.cfg.j2 +++ b/roles/network_plugin/macvlan/templates/debian-network-macvlan.cfg.j2 @@ -24,4 +24,3 @@ iface mac0 inet static {% endfor %} post-down iptables -t nat -D POSTROUTING -s {{ node_pod_cidr|ipaddr('net') }} -o {{ node_default_gateway_interface }} -j MASQUERADE post-down ip link delete mac0 - diff --git a/roles/network_plugin/weave/templates/weave-net.yml.j2 b/roles/network_plugin/weave/templates/weave-net.yml.j2 index 84c4fa0da..3a3886510 100644 --- a/roles/network_plugin/weave/templates/weave-net.yml.j2 +++ b/roles/network_plugin/weave/templates/weave-net.yml.j2 @@ -233,7 +233,7 @@ items: {% if weave_npc_extra_args %} - name: EXTRA_ARGS value: "{{ weave_npc_extra_args }}" -{% endif %} +{% endif %} image: {{ weave_npc_image_repo }}:{{ weave_npc_image_tag }} imagePullPolicy: {{ k8s_image_pull_policy }} resources: diff --git a/run.rc b/run.rc new file mode 100644 index 000000000..f87ad4e0d --- /dev/null +++ b/run.rc @@ -0,0 +1,45 @@ +# use virtualenv to install all python requirements +VENVDIR=venv +python3 -m venv $VENVDIR +source $VENVDIR/bin/activate +pip install --upgrade pip +pip install wheel +pip install --upgrade setuptools +pip install -r requirements.txt +pip install -r tests/requirements.txt +pre-commit install +# prepare an inventory to test with +INV=inventory/lab +rm -rf ${INV}.bak &> /dev/null +mv ${INV} ${INV}.bak &> /dev/null +cp -a inventory/sample ${INV} +rm -f ${INV}/hosts.ini + +# customize the vagrant environment +mkdir vagrant +cat << EOF > vagrant/config.rb +\$instance_name_prefix = kub" +\$vm_cpus = 2 +\$num_instances = 3 +\$os = "almalinux8" +\$subnet = "192.168.56" +\$network_plugin = "calico" +\$inventory = "$INV" +\$shared_folders = { 'temp/docker_rpms' => "/var/cache/yum/x86_64/7/docker-ce/packages" } +EOF + +# make the rpm cache +mkdir -p temp/docker_rpms + +vagrant up + +# make a copy of the downloaded docker rpm, to speed up the next provisioning run +scp kub-1:/var/cache/yum/x86_64/7/docker-ce/packages/* temp/docker_rpms/ + +# copy kubectl access configuration in place +mkdir $HOME/.kube/ &> /dev/null +ln -s $PWD/$INV/artifacts/admin.conf $HOME/.kube/config +# make the kubectl binary available +sudo ln -s $PWD/$INV/artifacts/kubectl /usr/local/bin/kubectl +#or +export PATH=$PATH:$PWD/$INV/artifacts diff --git a/tests/files/vagrant_ubuntu18-flannel.rb b/tests/files/vagrant_ubuntu18-flannel.rb index 25b86904c..ce942edbb 100644 --- a/tests/files/vagrant_ubuntu18-flannel.rb +++ b/tests/files/vagrant_ubuntu18-flannel.rb @@ -4,4 +4,4 @@ $libvirt_volume_cache = "unsafe" # Checking for box update can trigger API rate limiting # https://www.vagrantup.com/docs/vagrant-cloud/request-limits.html $box_check_update = false -$vm_cpus = 2 \ No newline at end of file +$vm_cpus = 2 diff --git a/tests/files/vagrant_ubuntu20-flannel.rb b/tests/files/vagrant_ubuntu20-flannel.rb index c739f58a2..55daa19e3 100644 --- a/tests/files/vagrant_ubuntu20-flannel.rb +++ b/tests/files/vagrant_ubuntu20-flannel.rb @@ -6,4 +6,4 @@ $libvirt_volume_cache = "unsafe" # Checking for box update can trigger API rate limiting # https://www.vagrantup.com/docs/vagrant-cloud/request-limits.html $box_check_update = false -$vm_cpus = 2 \ No newline at end of file +$vm_cpus = 2 diff --git a/tests/requirements-2.11.txt b/tests/requirements-2.11.txt index d3241516b..4b2c06004 100644 --- a/tests/requirements-2.11.txt +++ b/tests/requirements-2.11.txt @@ -1,11 +1,11 @@ -r ../requirements-2.11.txt -yamllint==1.19.0 -apache-libcloud==2.2.1 -tox==3.11.1 -dopy==0.3.7 ansible-lint==5.4.0 +apache-libcloud==2.2.1 +ara[server]==1.6.1 +dopy==0.3.7 molecule==3.0.6 molecule-vagrant==0.3 -testinfra==5.2.2 python-vagrant==0.5.15 -ara[server]==1.6.1 +testinfra==5.2.2 +tox==3.11.1 +yamllint==1.19.0 diff --git a/tests/requirements-2.12.txt b/tests/requirements-2.12.txt index 2fb47e1ab..6b0d6220b 100644 --- a/tests/requirements-2.12.txt +++ b/tests/requirements-2.12.txt @@ -1,11 +1,11 @@ -r ../requirements-2.12.txt -yamllint==1.19.0 -apache-libcloud==2.2.1 -tox==3.11.1 -dopy==0.3.7 ansible-lint==5.4.0 +apache-libcloud==2.2.1 +ara[server]==1.6.1 +dopy==0.3.7 molecule==3.0.6 molecule-vagrant==0.3 -testinfra==5.2.2 python-vagrant==0.5.15 -ara[server]==1.6.1 +testinfra==5.2.2 +tox==3.11.1 +yamllint==1.19.0 diff --git a/tests/scripts/md-table/requirements.txt b/tests/scripts/md-table/requirements.txt index ecf5aac53..6d4aca36a 100644 --- a/tests/scripts/md-table/requirements.txt +++ b/tests/scripts/md-table/requirements.txt @@ -1,4 +1,4 @@ -pyaml jinja2 pathlib ; python_version < '3.10' +pyaml pydblite diff --git a/tests/scripts/md-table/table.md.j2 b/tests/scripts/md-table/table.md.j2 index 7e8f4cae1..c5cf37d01 100644 --- a/tests/scripts/md-table/table.md.j2 +++ b/tests/scripts/md-table/table.md.j2 @@ -1,6 +1,6 @@ # CI test coverage -To generate this Matrix run `./tests/scripts/md-table/main.py` +To generate this Matrix run `./tests/scripts/md-table/main.py` {%- for container_engine in container_engines %} @@ -12,4 +12,4 @@ To generate this Matrix run `./tests/scripts/md-table/main.py` {{ os }} | {% for cni in network_plugins %} {{ ':white_check_mark:' if exists(container_engine, cni, os) else ':x:' }} |{% endfor %} {%- endfor %} -{%- endfor %} \ No newline at end of file +{%- endfor %} diff --git a/tests/scripts/md-table/test.sh b/tests/scripts/md-table/test.sh index 3c2e58174..46daa6384 100755 --- a/tests/scripts/md-table/test.sh +++ b/tests/scripts/md-table/test.sh @@ -8,4 +8,4 @@ echo "Generate current file..." ./tests/scripts/md-table/main.py > tmp.md echo "Compare docs/ci.md with actual tests in tests/files/*.yml ..." -cmp docs/ci.md tmp.md \ No newline at end of file +cmp docs/ci.md tmp.md diff --git a/tests/scripts/vagrant_clean.sh b/tests/scripts/vagrant_clean.sh index b04881836..5a44956e2 100755 --- a/tests/scripts/vagrant_clean.sh +++ b/tests/scripts/vagrant_clean.sh @@ -16,4 +16,4 @@ done for i in $(virsh vol-list default|grep \.img |grep -v VAGRANTSLASH | cut -f 2 -d ' ') do virsh vol-delete "$i" --pool default -done \ No newline at end of file +done