Skip to content

Commit

Permalink
Merge pull request #156 from cjeanner/ci/lint-schema
Browse files Browse the repository at this point in the history
Add new workflow: yamllint
  • Loading branch information
abays committed Apr 3, 2024
2 parents a00aa3a + ad99343 commit 2733a76
Show file tree
Hide file tree
Showing 83 changed files with 2,214 additions and 2,089 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: Build Docs
on:
on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
branches:
Expand All @@ -10,7 +11,8 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
# this fetches all branches. Needed because we need gh-pages branch for deploy to work
# this fetches all branches. Needed because we need
# gh-pages branch for deploy to work
fetch-depth: 0
- uses: actions/setup-python@v2
with:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Run yaml-lint
on: # yamllint disable-line rule:truthy
pull_request:
branches:
- main
- stable
paths:
- "**.yaml"
- "**.yml"

jobs:
yaml-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install yaml-lint
run: pip install yamllint

- name: Run yaml-lint
run: yamllint -c .yamllint.yml -s .
9 changes: 9 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
extends: default
ignore:
- '*.md'

rules:
line-length:
max: 100
level: warning
1 change: 1 addition & 0 deletions examples/common/metallb/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
components:
- ../../../lib/metallb
1 change: 1 addition & 0 deletions examples/common/nmstate/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
components:
- ../../../lib/nmstate
1 change: 1 addition & 0 deletions examples/common/olm/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
components:
- ../../../lib/olm-deps
- ../../../lib/olm-openstack
Expand Down
1 change: 1 addition & 0 deletions examples/common/olm/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# local-config: referenced, but not emitted by kustomize
---
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
1 change: 1 addition & 0 deletions examples/va/hci/control-plane/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

Expand Down
28 changes: 14 additions & 14 deletions examples/va/hci/control-plane/nncp/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

transformers:
# Set namespace to OpenStack on all namespaced objects without a namespace
- |-
apiVersion: builtin
kind: NamespaceTransformer
metadata:
name: _ignored_
namespace: openstack
setRoleBindingSubjects: none
unsetOnly: true
fieldSpecs:
- path: metadata/name
kind: Namespace
create: true
# Set namespace to OpenStack on all namespaced objects without a namespace
- |-
apiVersion: builtin
kind: NamespaceTransformer
metadata:
name: _ignored_
namespace: openstack
setRoleBindingSubjects: none
unsetOnly: true
fieldSpecs:
- path: metadata/name
kind: Namespace
create: true
components:
- ../../../../../lib/nncp

resources:
- values.yaml

17 changes: 9 additions & 8 deletions examples/va/hci/control-plane/nncp/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# local-config: referenced, but not emitted by kustomize
---
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down Expand Up @@ -42,7 +43,7 @@ data:
iface: enp6s0
mtu: 9000
lb_addresses:
- 192.168.122.80-192.168.122.90
- 192.168.122.80-192.168.122.90
endpoint_annotations:
metallb.universe.tf/address-pool: ctlplane
metallb.universe.tf/allow-shared-ip: ctlplane
Expand Down Expand Up @@ -75,12 +76,12 @@ data:
vlan: 20
base_iface: enp6s0
lb_addresses:
- 172.17.0.80-172.17.0.90
- 172.17.0.80-172.17.0.90
endpoint_annotations:
metallb.universe.tf/address-pool: internalapi
metallb.universe.tf/allow-shared-ip: internalapi
metallb.universe.tf/loadBalancerIPs: 172.17.0.80
net-attach-def: |
net-attach-def: |
{
"cniVersion": "0.3.1",
"name": "internalapi",
Expand Down Expand Up @@ -108,7 +109,7 @@ data:
vlan: 21
base_iface: enp6s0
lb_addresses:
- 172.18.0.80-172.18.0.90
- 172.18.0.80-172.18.0.90
net-attach-def: |
{
"cniVersion": "0.3.1",
Expand Down Expand Up @@ -147,7 +148,7 @@ data:
vlan: 22
base_iface: enp6s0
lb_addresses:
- 172.19.0.80-172.19.0.90
- 172.19.0.80-172.19.0.90
net-attach-def: |
{
"cniVersion": "0.3.1",
Expand Down Expand Up @@ -193,9 +194,9 @@ data:

routes:
config:
- destination: 0.0.0.0/0
next-hop-address: 192.168.122.1
next-hop-interface: enp6s0
- destination: 0.0.0.0/0
next-hop-address: 192.168.122.1
next-hop-interface: enp6s0

rabbitmq:
endpoint_annotations:
Expand Down
1 change: 1 addition & 0 deletions examples/va/hci/edpm-pre-ceph/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

Expand Down
99 changes: 51 additions & 48 deletions examples/va/hci/edpm-pre-ceph/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# yamllint disable rule:line-length
# local-config: referenced, but not emitted by kustomize
---
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -22,18 +24,19 @@ data:
- hostname: clock.redhat.com
# CHANGEME -- see https://access.redhat.com/solutions/253273
# edpm_bootstrap_command: |
# subscription-manager register --username <subscription_manager_username> --password <subscription_manager_password>
# subscription-manager register --username <subscription_manager_username> \
# --password <subscription_manager_password>
# podman login -u <registry_username> -p <registry_password> registry.redhat.io
edpm_iscsid_image: '{{ registry_url }}/openstack-iscsid:{{ image_tag }}'
edpm_logrotate_crond_image: '{{ registry_url }}/openstack-cron:{{ image_tag }}'
edpm_network_config_hide_sensitive_logs: false
edpm_network_config_os_net_config_mappings:
edpm-compute-0:
nic2: 6a:fe:54:3f:8a:02 # CHANGEME
nic2: 6a:fe:54:3f:8a:02 # CHANGEME
edpm-compute-1:
nic2: 6b:fe:54:3f:8a:02 # CHANGEME
nic2: 6b:fe:54:3f:8a:02 # CHANGEME
edpm-compute-2:
nic2: 6c:fe:54:3f:8a:02 # CHANGEME
nic2: 6c:fe:54:3f:8a:02 # CHANGEME
edpm_network_config_template: |
---
{% set mtu_list = [ctlplane_mtu] %}
Expand Down Expand Up @@ -116,61 +119,61 @@ data:
ansibleHost: 192.168.122.100
hostName: edpm-compute-0
networks:
- defaultRoute: true
fixedIP: 192.168.122.100
name: CtlPlane
subnetName: subnet1
- name: InternalApi
subnetName: subnet1
- name: Storage
subnetName: subnet1
- name: StorageMgmt
subnetName: subnet1
- name: Tenant
subnetName: subnet1
- defaultRoute: true
fixedIP: 192.168.122.100
name: CtlPlane
subnetName: subnet1
- name: InternalApi
subnetName: subnet1
- name: Storage
subnetName: subnet1
- name: StorageMgmt
subnetName: subnet1
- name: Tenant
subnetName: subnet1
edpm-compute-1:
ansible:
ansibleHost: 192.168.122.101
hostName: edpm-compute-1
networks:
- defaultRoute: true
fixedIP: 192.168.122.101
name: CtlPlane
subnetName: subnet1
- name: InternalApi
subnetName: subnet1
- name: Storage
subnetName: subnet1
- name: StorageMgmt
subnetName: subnet1
- name: Tenant
subnetName: subnet1
- defaultRoute: true
fixedIP: 192.168.122.101
name: CtlPlane
subnetName: subnet1
- name: InternalApi
subnetName: subnet1
- name: Storage
subnetName: subnet1
- name: StorageMgmt
subnetName: subnet1
- name: Tenant
subnetName: subnet1
edpm-compute-2:
ansible:
ansibleHost: 192.168.122.102
hostName: edpm-compute-2
networks:
- defaultRoute: true
fixedIP: 192.168.122.102
name: CtlPlane
subnetName: subnet1
- name: InternalApi
subnetName: subnet1
- name: Storage
subnetName: subnet1
- name: StorageMgmt
subnetName: subnet1
- name: Tenant
subnetName: subnet1
- defaultRoute: true
fixedIP: 192.168.122.102
name: CtlPlane
subnetName: subnet1
- name: InternalApi
subnetName: subnet1
- name: Storage
subnetName: subnet1
- name: StorageMgmt
subnetName: subnet1
- name: Tenant
subnetName: subnet1
services:
- bootstrap
- configure-network
- validate-network
- install-os
- ceph-hci-pre
- configure-os
- run-os
- reboot-os
- bootstrap
- configure-network
- validate-network
- install-os
- ceph-hci-pre
- configure-os
- run-os
- reboot-os
nova:
migration:
ssh_keys:
Expand Down
1 change: 1 addition & 0 deletions examples/va/hci/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This is the kustomization for the FINAL step, edpm-post-ceph
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

Expand Down
2 changes: 1 addition & 1 deletion examples/va/hci/service-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# local-config: referenced, but not emitted by kustomize
---
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down Expand Up @@ -80,4 +81,3 @@ data:
- name: ceph
mountPath: /etc/ceph
readOnly: true

11 changes: 6 additions & 5 deletions examples/va/hci/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# local-config: referenced, but not emitted by kustomize
---
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -8,11 +9,11 @@ metadata:
data:
nodeset:
services:
- ceph-client
- ovn
- neutron-metadata
- libvirt
- nova-custom-ceph
- ceph-client
- ovn
- neutron-metadata
- libvirt
- nova-custom-ceph
ceph:
conf: CHANGEME_CEPH_CONF
keyring: CHANGEME_CEPH_KEYRING
Expand Down
5 changes: 3 additions & 2 deletions examples/va/nfv/ovs-dpdk-sriov/edpm/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

components:
- ../../../../../va/nfv/ovs-dpdk-sriov/edpm/
# - https://github.com/openstack-k8s-operators/architecture/va/nfv/ovs-dpdk-sriov/edpm/?ref=main
## It's possible to replace ../../../../../va/nfv/ovs-dpdk-sriov/edpm/ with a git checkout URL as per:
## https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md
## It's possible to replace ../../../../../va/nfv/ovs-dpdk-sriov/edpm/ with a git checkout URL
## as per: https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md

resources:
- values.yaml
Loading

0 comments on commit 2733a76

Please sign in to comment.