Skip to content

Commit

Permalink
Merge pull request #4589 from fabriziopandini/include-metadata-for-CA…
Browse files Browse the repository at this point in the history
…PI-releases

🌱 Include metadata for the CAPI v0.3 releases
  • Loading branch information
k8s-ci-robot authored May 10, 2021
2 parents eeac0f6 + f7059e5 commit 3bf624d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 10 additions & 6 deletions cmd/clusterctl/hack/create-local-repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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',
},
Expand Down Expand Up @@ -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)
Expand All @@ -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)

Expand All @@ -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)
Expand All @@ -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

Expand Down
10 changes: 10 additions & 0 deletions metadata.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3bf624d

Please sign in to comment.