1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 15:47:14 +01:00

openstack: Test manifest creation

Add a script for testing OpenStack manifest generation.

Co-Authored-By: Matthew Booth <mbooth@redhat.com>
This commit is contained in:
Pierre Prinetti
2020-11-28 12:13:05 +01:00
parent 64ec239bc5
commit b85276295a
7 changed files with 221 additions and 0 deletions

4
scripts/openstack/OWNERS Normal file
View File

@@ -0,0 +1,4 @@
approvers:
- openstack-approvers
reviewers:
- openstack-reviewers

View File

@@ -0,0 +1,39 @@
apiVersion: v1
baseDomain: shiftstack.example.com
clusterID: manifests1
controlPlane:
hyperthreading: Enabled
architecture: amd64
name: master
platform:
openstack:
type: ${COMPUTE_FLAVOR}
additionalSecurityGroupIDs:
- aaaaaaaa-bbbb-4ccc-dddd-111111111111
replicas: 3
compute:
- name: worker
platform:
openstack:
type: ${COMPUTE_FLAVOR}
additionalSecurityGroupIDs:
- aaaaaaaa-bbbb-4ccc-dddd-000000000000
replicas: 3
metadata:
name: manifests1
networking:
clusterNetwork:
- cidr: 10.128.0.0/14
hostPrefix: 23
machineNetwork:
- cidr: 10.0.128.0/17
networkType: OpenShiftSDN
serviceNetwork:
- 172.30.0.0/16
platform:
openstack:
cloud: ${OS_CLOUD}
externalNetwork: ${EXTERNAL_NETWORK}
computeFlavor: ${COMPUTE_FLAVOR} # deprecated in 4.7
lbFloatingIP: ${API_FIP}
pullSecret: ${PULL_SECRET}

View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -Eeuxo pipefail
declare -r assets_dir="$1"
declare -a machines=(
"${assets_dir}/openshift/99_openshift-cluster-api_master-machines-0.yaml"
"${assets_dir}/openshift/99_openshift-cluster-api_master-machines-1.yaml"
"${assets_dir}/openshift/99_openshift-cluster-api_master-machines-2.yaml"
)
declare -i exit_code=0
for machine in "${machines[@]}"; do
if ! [ -f "$machine" ]; then
>&2 echo "Machine resource $machine not found"
exit_code=$((exit_code+1))
fi
if ! >/dev/null yq -e '.spec.providerSpec.value.securityGroups[] | select(.uuid=="aaaaaaaa-bbbb-4ccc-dddd-111111111111")' "$machine"; then
>&2 echo "Security group UUID not found in Machine $machine"
>&2 echo
>&2 echo 'The file was:'
>&2 cat "$machine"
>&2 echo
exit_code=$((exit_code+1))
fi
done
exit $exit_code

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -Eeuxo pipefail
declare -r assets_dir="$1"
declare machineset="${assets_dir}/openshift/99_openshift-cluster-api_worker-machineset-0.yaml"
declare -i exit_code=0
if ! [ -f "$machineset" ]; then
>&2 echo 'MachineSet not found'
exit_code=$((exit_code+1))
fi
if ! >/dev/null yq -e '.spec.template.spec.providerSpec.value.securityGroups[] | select(.uuid=="aaaaaaaa-bbbb-4ccc-dddd-000000000000")' "$machineset"; then
>&2 echo 'Security group UUID not found in the MachineSet'
>&2 echo
>&2 echo 'The file was:'
>&2 cat "$machineset"
>&2 echo
exit_code=$((exit_code+1))
fi
exit $exit_code