From e9310cf39012ca75fceb1d6c555b41b3d01d37e6 Mon Sep 17 00:00:00 2001 From: Sirajudeen Date: Wed, 9 Jun 2021 21:35:52 +0000 Subject: [PATCH] [uplift] - Uplift airshipctl to stable version Airshipctl reference commits: => https://review.opendev.org/c/airship/airshipctl/+/792060 Update metadata.yaml to kubernetes style => https://review.opendev.org/c/airship/airshipctl/+/793502 Move CAPI resources to target-infra namespace => https://review.opendev.org/c/airship/airshipctl/+/789398 Embed validation cfg into phase and plan definition => https://review.opendev.org/c/airship/airshipctl/+/794701 Enable static validation for all available plans per site => https://review.opendev.org/c/airship/airshipctl/+/796574 Decouple secret from other replacements in workers-capm3 => https://review.opendev.org/c/airship/airshipctl/+/795167 Added replacements for composite/infra Change-Id: I2c107b3d2b94acda540b09792640dbafd55b23eb --- .../function/k8scontrol-ha/kustomization.yaml | 2 ++ .../function/workers-capm3/kustomization.yaml | 3 +++ manifests/function/workers-capm3/namespace.yaml | 5 +++++ .../site/reference-airship-core/metadata.yaml | 15 ++++++++++----- .../site/reference-multi-tenant/metadata.yaml | 15 ++++++++++----- .../ephemeral/bootstrap/baremetalhost.yaml | 6 ++++++ .../ephemeral/bootstrap/kustomization.yaml | 2 ++ .../test-site/ephemeral/bootstrap/namespace.yaml | 5 +++++ .../ephemeral/controlplane/kustomization.yaml | 3 +++ .../initinfra-networking/kustomization.yaml | 3 +++ manifests/site/test-site/metadata.yaml | 15 ++++++++++----- .../site/test-site/phases/kustomization.yaml | 4 ++++ .../initinfra-networking/kustomization.yaml | 5 +++++ .../target/initinfra-networking/namespace.yaml | 5 +++++ .../test-site/target/workers/kustomization.yaml | 3 +++ .../site/virtual-network-cloud/metadata.yaml | 15 ++++++++++----- .../replacements/kustomization.yaml | 2 ++ manifests/type/airship-core/metadata.yaml | 13 ++++++++++--- .../type/airship-core/phases/kustomization.yaml | 7 ++++--- .../phases/patches/delete-deploy-gating.yaml | 5 +++++ .../type/airship-core/phases/plan-patch.yaml | 10 ++++++++++ manifests/type/airship-core/phases/plan.yaml | 7 +++++++ .../replacements/kustomization.yaml | 2 ++ .../workers/replacements/kustomization.yaml | 1 + .../type/multi-tenant/phases/kustomization.yaml | 3 --- tools/validate_docs | 9 ++++++++- zuul.d/jobs.yaml | 2 +- zuul.d/projects.yaml | 2 +- 28 files changed, 137 insertions(+), 32 deletions(-) create mode 100644 manifests/function/workers-capm3/namespace.yaml create mode 100644 manifests/site/test-site/ephemeral/bootstrap/namespace.yaml create mode 100644 manifests/site/test-site/target/initinfra-networking/namespace.yaml create mode 100644 manifests/type/airship-core/ephemeral/initinfra-networking/replacements/kustomization.yaml create mode 100644 manifests/type/airship-core/phases/patches/delete-deploy-gating.yaml create mode 100644 manifests/type/airship-core/phases/plan-patch.yaml create mode 100644 manifests/type/airship-core/target/initinfra-networking/replacements/kustomization.yaml diff --git a/manifests/function/k8scontrol-ha/kustomization.yaml b/manifests/function/k8scontrol-ha/kustomization.yaml index 6e05c7cad..a5bbbac34 100644 --- a/manifests/function/k8scontrol-ha/kustomization.yaml +++ b/manifests/function/k8scontrol-ha/kustomization.yaml @@ -8,6 +8,8 @@ resources: patchesStrategicMerge: - oidc-apiserver-extra-args.yaml +namespace: target-infra + patchesJson6902: - target: group: controlplane.cluster.x-k8s.io diff --git a/manifests/function/workers-capm3/kustomization.yaml b/manifests/function/workers-capm3/kustomization.yaml index b9d6ba11a..3972ba58c 100644 --- a/manifests/function/workers-capm3/kustomization.yaml +++ b/manifests/function/workers-capm3/kustomization.yaml @@ -1,4 +1,7 @@ resources: + - namespace.yaml - kubeadmconfigtemplate.yaml - machinedeployment.yaml - metal3machinetemplate.yaml + +namespace: target-infra diff --git a/manifests/function/workers-capm3/namespace.yaml b/manifests/function/workers-capm3/namespace.yaml new file mode 100644 index 000000000..b32028483 --- /dev/null +++ b/manifests/function/workers-capm3/namespace.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: target-infra diff --git a/manifests/site/reference-airship-core/metadata.yaml b/manifests/site/reference-airship-core/metadata.yaml index de0cec6e8..69205075b 100644 --- a/manifests/site/reference-airship-core/metadata.yaml +++ b/manifests/site/reference-airship-core/metadata.yaml @@ -1,6 +1,11 @@ -phase: - docEntryPointPrefix: manifests/site/reference-airship-core - path: manifests/site/reference-airship-core/phases +apiVersion: airshipit.org/v1alpha1 +kind: ManifestMetadata +metadata: + name: manifest-metadata +spec: + phase: + docEntryPointPrefix: manifests/site/reference-airship-core + path: manifests/site/reference-airship-core/phases -inventory: - path: manifests/site/reference-airship-core/host-inventory + inventory: + path: manifests/site/reference-airship-core/host-inventory diff --git a/manifests/site/reference-multi-tenant/metadata.yaml b/manifests/site/reference-multi-tenant/metadata.yaml index 41b721e75..5fe0b34cc 100644 --- a/manifests/site/reference-multi-tenant/metadata.yaml +++ b/manifests/site/reference-multi-tenant/metadata.yaml @@ -1,6 +1,11 @@ -phase: - docEntryPointPrefix: manifests/site/reference-multi-tenant - path: manifests/site/reference-multi-tenant/phases +apiVersion: airshipit.org/v1alpha1 +kind: ManifestMetadata +metadata: + name: manifest-metadata +spec: + phase: + docEntryPointPrefix: manifests/site/reference-multi-tenant + path: manifests/site/reference-multi-tenant/phases -inventory: - path: manifests/site/reference-multi-tenant/host-inventory + inventory: + path: manifests/site/reference-multi-tenant/host-inventory diff --git a/manifests/site/test-site/ephemeral/bootstrap/baremetalhost.yaml b/manifests/site/test-site/ephemeral/bootstrap/baremetalhost.yaml index 7d8282cc8..20593058b 100644 --- a/manifests/site/test-site/ephemeral/bootstrap/baremetalhost.yaml +++ b/manifests/site/test-site/ephemeral/bootstrap/baremetalhost.yaml @@ -18,3 +18,9 @@ status: # when we have more flexible labeling system in place, we will not # deliver this document to ephemeral cluster state: externally provisioned + ID: "" + operationHistory: {} + errorMessage: "" + hardwareProfile: "" + operationalStatus: "" + poweredOn: false diff --git a/manifests/site/test-site/ephemeral/bootstrap/kustomization.yaml b/manifests/site/test-site/ephemeral/bootstrap/kustomization.yaml index e20954834..2e9099776 100644 --- a/manifests/site/test-site/ephemeral/bootstrap/kustomization.yaml +++ b/manifests/site/test-site/ephemeral/bootstrap/kustomization.yaml @@ -1,9 +1,11 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: + - namespace.yaml - ../../../../type/airship-core/ephemeral/bootstrap - ../catalogues +namespace: target-infra generators: - hostgenerator diff --git a/manifests/site/test-site/ephemeral/bootstrap/namespace.yaml b/manifests/site/test-site/ephemeral/bootstrap/namespace.yaml new file mode 100644 index 000000000..b32028483 --- /dev/null +++ b/manifests/site/test-site/ephemeral/bootstrap/namespace.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: target-infra diff --git a/manifests/site/test-site/ephemeral/controlplane/kustomization.yaml b/manifests/site/test-site/ephemeral/controlplane/kustomization.yaml index 0f7ffaf97..0e8ced4d8 100644 --- a/manifests/site/test-site/ephemeral/controlplane/kustomization.yaml +++ b/manifests/site/test-site/ephemeral/controlplane/kustomization.yaml @@ -6,5 +6,8 @@ resources: # TODO (dukov) It's recocommended to upload BareMetalHost objects separately # otherwise nodes will hang in 'registering' state for quite a long time - nodes + +namespace: target-infra + transformers: - ../../../../type/airship-core/ephemeral/controlplane/replacements diff --git a/manifests/site/test-site/ephemeral/initinfra-networking/kustomization.yaml b/manifests/site/test-site/ephemeral/initinfra-networking/kustomization.yaml index 75c3dbd13..2cf709690 100644 --- a/manifests/site/test-site/ephemeral/initinfra-networking/kustomization.yaml +++ b/manifests/site/test-site/ephemeral/initinfra-networking/kustomization.yaml @@ -1,2 +1,5 @@ resources: + - ../catalogues - ../../../../type/airship-core/ephemeral/initinfra-networking +transformers: + - ../../../../type/airship-core/ephemeral/initinfra-networking/replacements diff --git a/manifests/site/test-site/metadata.yaml b/manifests/site/test-site/metadata.yaml index 0e4026946..118963dc1 100644 --- a/manifests/site/test-site/metadata.yaml +++ b/manifests/site/test-site/metadata.yaml @@ -1,6 +1,11 @@ -phase: - docEntryPointPrefix: manifests/site/test-site - path: manifests/site/test-site/phases +apiVersion: airshipit.org/v1alpha1 +kind: ManifestMetadata +metadata: + name: manifest-metadata +spec: + phase: + docEntryPointPrefix: manifests/site/test-site + path: manifests/site/test-site/phases -inventory: - path: manifests/site/test-site/host-inventory + inventory: + path: manifests/site/test-site/host-inventory diff --git a/manifests/site/test-site/phases/kustomization.yaml b/manifests/site/test-site/phases/kustomization.yaml index 324f3bb94..88587fc35 100644 --- a/manifests/site/test-site/phases/kustomization.yaml +++ b/manifests/site/test-site/phases/kustomization.yaml @@ -1,6 +1,10 @@ resources: - ../kubeconfig - ../../../type/airship-core/phases + - ../target/catalogues + +transformers: + - ../../../../../airshipctl/manifests/function/clusterctl/replacements ## TODO Consider making a catalogue combined with variable substitution instead patchesStrategicMerge: - phase-patch.yaml diff --git a/manifests/site/test-site/target/initinfra-networking/kustomization.yaml b/manifests/site/test-site/target/initinfra-networking/kustomization.yaml index 411ba4f89..cb4adf16b 100644 --- a/manifests/site/test-site/target/initinfra-networking/kustomization.yaml +++ b/manifests/site/test-site/target/initinfra-networking/kustomization.yaml @@ -1,2 +1,7 @@ resources: + - ../catalogues - ../../../../type/airship-core/target/initinfra-networking + - namespace.yaml + +transformers: + - ../../../../type/airship-core/target/initinfra-networking/replacements diff --git a/manifests/site/test-site/target/initinfra-networking/namespace.yaml b/manifests/site/test-site/target/initinfra-networking/namespace.yaml new file mode 100644 index 000000000..b32028483 --- /dev/null +++ b/manifests/site/test-site/target/initinfra-networking/namespace.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: target-infra diff --git a/manifests/site/test-site/target/workers/kustomization.yaml b/manifests/site/test-site/target/workers/kustomization.yaml index 5dabe65b3..99374ef67 100644 --- a/manifests/site/test-site/target/workers/kustomization.yaml +++ b/manifests/site/test-site/target/workers/kustomization.yaml @@ -4,5 +4,8 @@ resources: - ../../../../type/airship-core/target/workers - ../catalogues - nodes + +namespace: target-infra + transformers: - ../../../../type/airship-core/target/workers/replacements diff --git a/manifests/site/virtual-network-cloud/metadata.yaml b/manifests/site/virtual-network-cloud/metadata.yaml index 1b9ae2b2a..a2511fea0 100644 --- a/manifests/site/virtual-network-cloud/metadata.yaml +++ b/manifests/site/virtual-network-cloud/metadata.yaml @@ -1,6 +1,11 @@ -phase: - docEntryPointPrefix: manifests/site/virtual-network-cloud - path: manifests/site/virtual-network-cloud/phases +apiVersion: airshipit.org/v1alpha1 +kind: ManifestMetadata +metadata: + name: manifest-metadata +spec: + phase: + docEntryPointPrefix: manifests/site/virtual-network-cloud + path: manifests/site/virtual-network-cloud/phases -inventory: - path: manifests/site/virtual-network-cloud/host-inventory + inventory: + path: manifests/site/virtual-network-cloud/host-inventory diff --git a/manifests/type/airship-core/ephemeral/initinfra-networking/replacements/kustomization.yaml b/manifests/type/airship-core/ephemeral/initinfra-networking/replacements/kustomization.yaml new file mode 100644 index 000000000..5aaebe940 --- /dev/null +++ b/manifests/type/airship-core/ephemeral/initinfra-networking/replacements/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - ../../../../../../../airshipctl/manifests/composite/infra/replacements diff --git a/manifests/type/airship-core/metadata.yaml b/manifests/type/airship-core/metadata.yaml index 3b68feea4..31dba409e 100644 --- a/manifests/type/airship-core/metadata.yaml +++ b/manifests/type/airship-core/metadata.yaml @@ -1,3 +1,10 @@ -phase: - docEntryPointPrefix: manifests/type/airship-core - path: manifests/type/airship-core/phases +apiVersion: airshipit.org/v1alpha1 +kind: ManifestMetadata +metadata: + name: manifest-metadata +spec: + phase: + docEntryPointPrefix: manifests/type/airship-core + path: manifests/type/airship-core/phases + inventory: + path: "" diff --git a/manifests/type/airship-core/phases/kustomization.yaml b/manifests/type/airship-core/phases/kustomization.yaml index 8e942fb39..ed65c1a59 100644 --- a/manifests/type/airship-core/phases/kustomization.yaml +++ b/manifests/type/airship-core/phases/kustomization.yaml @@ -1,10 +1,11 @@ resources: - ../../../../../airshipctl/manifests/phases/ - lma-infra-target.yaml - - validation-config.yaml - ../../../function/phase-helper/ - executors.yaml - phases.yaml - plan.yaml -transformers: - - ../../../../../airshipctl/manifests/function/validator + +patchesStrategicMerge: + - patches/delete-deploy-gating.yaml + - plan-patch.yaml diff --git a/manifests/type/airship-core/phases/patches/delete-deploy-gating.yaml b/manifests/type/airship-core/phases/patches/delete-deploy-gating.yaml new file mode 100644 index 000000000..a75cec7e5 --- /dev/null +++ b/manifests/type/airship-core/phases/patches/delete-deploy-gating.yaml @@ -0,0 +1,5 @@ +$patch: delete +apiVersion: airshipit.org/v1alpha1 +kind: PhasePlan +metadata: + name: deploy-gating diff --git a/manifests/type/airship-core/phases/plan-patch.yaml b/manifests/type/airship-core/phases/plan-patch.yaml new file mode 100644 index 000000000..7cdd862c2 --- /dev/null +++ b/manifests/type/airship-core/phases/plan-patch.yaml @@ -0,0 +1,10 @@ +apiVersion: airshipit.org/v1alpha1 +kind: PhasePlan +metadata: + name: iso +validation: + kindsToSkip: + - RemoteDirectConfiguration + - VariableCatalogue + - StorageCatalogue + - BareMetalHost diff --git a/manifests/type/airship-core/phases/plan.yaml b/manifests/type/airship-core/phases/plan.yaml index b657d51b0..9f7f7a5da 100644 --- a/manifests/type/airship-core/phases/plan.yaml +++ b/manifests/type/airship-core/phases/plan.yaml @@ -147,3 +147,10 @@ phases: # - name: lma-stack # - name: lma-configs # - name: deliver-network-policy +validation: + kindsToSkip: + - Clusterctl + - VariableCatalogue + - StorageCatalogue + crdList: + - airshipctl/manifests/function/airshipctl-schemas diff --git a/manifests/type/airship-core/target/initinfra-networking/replacements/kustomization.yaml b/manifests/type/airship-core/target/initinfra-networking/replacements/kustomization.yaml new file mode 100644 index 000000000..5aaebe940 --- /dev/null +++ b/manifests/type/airship-core/target/initinfra-networking/replacements/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - ../../../../../../../airshipctl/manifests/composite/infra/replacements diff --git a/manifests/type/airship-core/target/workers/replacements/kustomization.yaml b/manifests/type/airship-core/target/workers/replacements/kustomization.yaml index 9696c138e..1e2900802 100644 --- a/manifests/type/airship-core/target/workers/replacements/kustomization.yaml +++ b/manifests/type/airship-core/target/workers/replacements/kustomization.yaml @@ -2,3 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - ../../../../../../../airshipctl/manifests/function/workers-capm3/replacements + - ../../../../../../../airshipctl/manifests/function/workers-capm3/replacements-secrets diff --git a/manifests/type/multi-tenant/phases/kustomization.yaml b/manifests/type/multi-tenant/phases/kustomization.yaml index f332f4150..53dd0a1ef 100644 --- a/manifests/type/multi-tenant/phases/kustomization.yaml +++ b/manifests/type/multi-tenant/phases/kustomization.yaml @@ -6,8 +6,5 @@ resources: - phases.yaml - executors.yaml - ../../../function/phase-helper - - validation-config.yaml patchesStrategicMerge: - cluster_map_patch.yaml -transformers: - - ../../../../../airshipctl/manifests/function/validator diff --git a/tools/validate_docs b/tools/validate_docs index a6903ec22..e153b88e2 100755 --- a/tools/validate_docs +++ b/tools/validate_docs @@ -25,5 +25,12 @@ export SITE_ROOTS=$SITE_ROOTS export MANIFEST_REPO_URL=$MANIFEST_REPO_URL cd ${AIRSHIPCTL_PROJECT} -./tools/validate_docs + +# Validate only specific site if set +if [ ! -z "$1" ]; then + ./tools/validate_docs $1 +else + ./tools/validate_docs +fi + diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 4f88da823..f02cf800d 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -31,7 +31,7 @@ - ./tools/deployment/common/21_systemwide_executable.sh - ./tools/deployment/common/22_test_configs.sh - ./tools/deployment/common/23_pull_documents.sh - - ./tools/validate_docs + - ./tools/validate_docs test-site # validate only test-site till we get other site specific plans to work with document validation - job: name: treasuremap-upload-git-mirror diff --git a/zuul.d/projects.yaml b/zuul.d/projects.yaml index 2c24cd996..ebe4e1e9c 100644 --- a/zuul.d/projects.yaml +++ b/zuul.d/projects.yaml @@ -14,7 +14,7 @@ vars: # NOTE(drewwalters96): Set AIRSHIPCTL_REF to a commit SHA in order to pin # the cloned version of airshipctl to a known/compatible reference. - AIRSHIPCTL_REF: "16da661959b69ae54be83266cf7db0920083a2d4" + AIRSHIPCTL_REF: "1e8f31a160016a71c454507e529620e837efea78" sphinx_build_dir: docs/build check: jobs: