From f7059e5a9e13eca8bbd796148a741119aff85ce5 Mon Sep 17 00:00:00 2001 From: fabriziopandini Date: Mon, 10 May 2021 19:05:09 +0200 Subject: [PATCH] Include metadata for the CAPI releases --- Makefile | 2 ++ cmd/clusterctl/hack/create-local-repository.py | 16 ++++++++++------ metadata.yaml | 10 ++++++++++ 3 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 metadata.yaml diff --git a/Makefile b/Makefile index 569c81d3fc75..fc76a78fbefd 100644 --- a/Makefile +++ b/Makefile @@ -476,6 +476,8 @@ release-manifests: $(RELEASE_DIR) $(KUSTOMIZE) ## Builds the manifests to publis cat $(RELEASE_DIR)/bootstrap-components.yaml >> $(RELEASE_DIR)/cluster-api-components.yaml echo "---" >> $(RELEASE_DIR)/cluster-api-components.yaml cat $(RELEASE_DIR)/control-plane-components.yaml >> $(RELEASE_DIR)/cluster-api-components.yaml + # Add metadata to the release artifacts + cp metadata.yaml $(RELEASE_DIR)/metadata.yaml .PHONY: release-manifests-dev release-manifests-dev: ## Builds the development manifests and copies them in the release folder diff --git a/cmd/clusterctl/hack/create-local-repository.py b/cmd/clusterctl/hack/create-local-repository.py index 5e78b2e0f548..bcb026b6d948 100755 --- a/cmd/clusterctl/hack/create-local-repository.py +++ b/cmd/clusterctl/hack/create-local-repository.py @@ -44,6 +44,7 @@ import subprocess import os from distutils.dir_util import copy_tree +from distutils.file_util import copy_file import errno import sys @@ -52,24 +53,24 @@ providers = { 'cluster-api': { 'componentsFile': 'core-components.yaml', - 'nextVersion': 'v0.3.8', + 'nextVersion': 'v0.3.99', 'type': 'CoreProvider', }, 'bootstrap-kubeadm': { 'componentsFile': 'bootstrap-components.yaml', - 'nextVersion': 'v0.3.8', + 'nextVersion': 'v0.3.99', 'type': 'BootstrapProvider', 'configFolder': 'bootstrap/kubeadm/config', }, 'control-plane-kubeadm': { 'componentsFile': 'control-plane-components.yaml', - 'nextVersion': 'v0.3.8', + 'nextVersion': 'v0.3.99', 'type': 'ControlPlaneProvider', 'configFolder': 'controlplane/kubeadm/config', }, 'infrastructure-docker': { 'componentsFile': 'infrastructure-components.yaml', - 'nextVersion': 'v0.3.8', + 'nextVersion': 'v0.3.99', 'type': 'InfrastructureProvider', 'configFolder': 'test/infrastructure/docker/config', }, @@ -116,7 +117,7 @@ def get_repository_folder(): home = get_home() return os.path.join(home, '.cluster-api', 'dev-repository') -def write_local_repository(provider, version, components_file, components_yaml): +def write_local_repository(provider, version, components_file, components_yaml, metadata_file): try: repository_folder = get_repository_folder() provider_folder = os.path.join(repository_folder, provider, version) @@ -130,6 +131,8 @@ def write_local_repository(provider, version, components_file, components_yaml): f.write(components_yaml) f.close() + copy_file(metadata_file, provider_folder) + if provider == "infrastructure-docker": copy_tree("test/infrastructure/docker/templates", provider_folder) @@ -148,6 +151,7 @@ def create_local_repositories(): repo = p.get('repo', '.') config_folder = p.get('configFolder', 'config') + metadata_file = repo+'/metadata.yaml' next_version = p.get('nextVersion') assert next_version is not None, 'invalid configuration for provider {}: please provide nextVersion value'.format(provider) @@ -159,7 +163,7 @@ def create_local_repositories(): assert components_file is not None, 'invalid configuration for provider {}: please provide componentsFile value'.format(provider) components_yaml = execCmd(['kustomize', 'build', os.path.join(repo, config_folder)]) - components_path = write_local_repository(provider, next_version, components_file, components_yaml) + components_path = write_local_repository(provider, next_version, components_file, components_yaml, metadata_file) yield name, type, next_version, components_path diff --git a/metadata.yaml b/metadata.yaml new file mode 100644 index 000000000000..d28b451c7417 --- /dev/null +++ b/metadata.yaml @@ -0,0 +1,10 @@ +# maps release series of major.minor to cluster-api contract version +# the contract version may change between minor or major versions, but *not* +# between patch versions. +# +# update this file only when a new major or minor version is released +apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3 +releaseSeries: + - major: 0 + minor: 3 + contract: v1alpha3