From ef63114475ae32cb42afb15ea7ffef0f31ba2a36 Mon Sep 17 00:00:00 2001 From: Andrei Pavlov Date: Fri, 13 Dec 2024 15:03:21 +0700 Subject: [PATCH 1/4] Update docs/templates for v0.0.5 Signed-off-by: Andrei Pavlov --- README.md | 6 +++--- templates/provider/hmc-templates/Chart.yaml | 2 +- templates/provider/hmc-templates/files/release.yaml | 6 +++--- templates/provider/hmc-templates/files/templates/hmc.yaml | 4 ++-- templates/provider/hmc/Chart.yaml | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 1336d5bf3..c7190c6d1 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,13 @@ Detailed documentation is available in [Project 0x2A Docs](https://mirantis.gith ### TL;DR ```bash -kubectl apply -f https://github.com/Mirantis/hmc/releases/download/v0.0.4/install.yaml +kubectl apply -f https://github.com/Mirantis/hmc/releases/download/v0.0.5/install.yaml ``` or install using `helm` ```bash -helm install hmc oci://ghcr.io/mirantis/hmc/charts/hmc --version 0.0.4 -n hmc-system --create-namespace +helm install hmc oci://ghcr.io/mirantis/hmc/charts/hmc --version 0.0.5 -n hmc-system --create-namespace ``` Then follow the [Deploy a managed cluster](#deploy-a-managed-cluster) guide to @@ -83,7 +83,7 @@ spec: - name: cluster-api-provider-azure - name: cluster-api-provider-vsphere - name: projectsveltos - release: hmc-0-0-4 + release: hmc-0-0-5 ``` There are two options to override the default management configuration of HMC: diff --git a/templates/provider/hmc-templates/Chart.yaml b/templates/provider/hmc-templates/Chart.yaml index b98df9e22..29a97e1fa 100644 --- a/templates/provider/hmc-templates/Chart.yaml +++ b/templates/provider/hmc-templates/Chart.yaml @@ -13,4 +13,4 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.3 +version: 0.0.5 diff --git a/templates/provider/hmc-templates/files/release.yaml b/templates/provider/hmc-templates/files/release.yaml index faedfe11b..c882afc7d 100644 --- a/templates/provider/hmc-templates/files/release.yaml +++ b/templates/provider/hmc-templates/files/release.yaml @@ -1,13 +1,13 @@ apiVersion: hmc.mirantis.com/v1alpha1 kind: Release metadata: - name: hmc-0-0-4 + name: hmc-0-0-5 annotations: helm.sh/resource-policy: keep spec: - version: 0.0.4 + version: 0.0.5 hmc: - template: hmc-0-0-4 + template: hmc-0-0-5 capi: template: cluster-api-0-0-5 providers: diff --git a/templates/provider/hmc-templates/files/templates/hmc.yaml b/templates/provider/hmc-templates/files/templates/hmc.yaml index 5cb8fcd9a..8beb29aef 100644 --- a/templates/provider/hmc-templates/files/templates/hmc.yaml +++ b/templates/provider/hmc-templates/files/templates/hmc.yaml @@ -1,14 +1,14 @@ apiVersion: hmc.mirantis.com/v1alpha1 kind: ProviderTemplate metadata: - name: hmc-0-0-4 + name: hmc-0-0-5 annotations: helm.sh/resource-policy: keep spec: helm: chartSpec: chart: hmc - version: 0.0.4 + version: 0.0.5 interval: 10m0s sourceRef: kind: HelmRepository diff --git a/templates/provider/hmc/Chart.yaml b/templates/provider/hmc/Chart.yaml index 3ed7ce2d9..86ba32b1f 100644 --- a/templates/provider/hmc/Chart.yaml +++ b/templates/provider/hmc/Chart.yaml @@ -13,7 +13,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.4 +version: 0.0.5 dependencies: - name: flux2 From 7c83fbc5879a4cedea8e32f259f256408566dc36 Mon Sep 17 00:00:00 2001 From: Ekaterina Kazakova <41469478+eromanova@users.noreply.github.com> Date: Mon, 16 Dec 2024 21:28:15 +0400 Subject: [PATCH 2/4] Fix panic when tracking managed cluster heartbeat (#798) --- api/v1alpha1/templates_common.go | 2 ++ internal/controller/template_controller.go | 2 ++ internal/telemetry/tracker.go | 2 +- .../hmc/templates/crds/hmc.mirantis.com_clustertemplates.yaml | 4 ++++ .../templates/crds/hmc.mirantis.com_providertemplates.yaml | 4 ++++ .../hmc/templates/crds/hmc.mirantis.com_servicetemplates.yaml | 4 ++++ 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/api/v1alpha1/templates_common.go b/api/v1alpha1/templates_common.go index fd5e4f1da..8e457ee17 100644 --- a/api/v1alpha1/templates_common.go +++ b/api/v1alpha1/templates_common.go @@ -68,6 +68,8 @@ type TemplateStatusCommon struct { // ChartRef is a reference to a source controller resource containing the // Helm chart representing the template. ChartRef *helmcontrollerv2.CrossNamespaceSourceReference `json:"chartRef,omitempty"` + // ChartVersion represents the version of the Helm Chart associated with this template. + ChartVersion string `json:"chartVersion,omitempty"` // Description contains information about the template. Description string `json:"description,omitempty"` diff --git a/internal/controller/template_controller.go b/internal/controller/template_controller.go index 32f33a521..0dc3fd252 100644 --- a/internal/controller/template_controller.go +++ b/internal/controller/template_controller.go @@ -214,6 +214,8 @@ func (r *TemplateReconciler) ReconcileTemplate(ctx context.Context, template tem Name: hcChart.Name, Namespace: hcChart.Namespace, } + status.ChartVersion = hcChart.Spec.Version + if reportStatus, err := helm.ArtifactReady(hcChart); err != nil { l.Info("HelmChart Artifact is not ready") if reportStatus { diff --git a/internal/telemetry/tracker.go b/internal/telemetry/tracker.go index b44d90573..8e2e42068 100644 --- a/internal/telemetry/tracker.go +++ b/internal/telemetry/tracker.go @@ -91,7 +91,7 @@ func (t *Tracker) trackManagedClusterHeartbeat(ctx context.Context) error { string(managedCluster.UID), clusterID, managedCluster.Spec.Template, - template.Spec.Helm.ChartSpec.Version, + template.Status.ChartVersion, template.Status.Providers, ) if err != nil { diff --git a/templates/provider/hmc/templates/crds/hmc.mirantis.com_clustertemplates.yaml b/templates/provider/hmc/templates/crds/hmc.mirantis.com_clustertemplates.yaml index e207d6ec4..220d710ea 100644 --- a/templates/provider/hmc/templates/crds/hmc.mirantis.com_clustertemplates.yaml +++ b/templates/provider/hmc/templates/crds/hmc.mirantis.com_clustertemplates.yaml @@ -295,6 +295,10 @@ spec: - kind - name type: object + chartVersion: + description: ChartVersion represents the version of the Helm Chart + associated with this template. + type: string config: description: |- Config demonstrates available parameters for template customization, diff --git a/templates/provider/hmc/templates/crds/hmc.mirantis.com_providertemplates.yaml b/templates/provider/hmc/templates/crds/hmc.mirantis.com_providertemplates.yaml index 449faa5a3..cfe629e81 100644 --- a/templates/provider/hmc/templates/crds/hmc.mirantis.com_providertemplates.yaml +++ b/templates/provider/hmc/templates/crds/hmc.mirantis.com_providertemplates.yaml @@ -300,6 +300,10 @@ spec: - kind - name type: object + chartVersion: + description: ChartVersion represents the version of the Helm Chart + associated with this template. + type: string config: description: |- Config demonstrates available parameters for template customization, diff --git a/templates/provider/hmc/templates/crds/hmc.mirantis.com_servicetemplates.yaml b/templates/provider/hmc/templates/crds/hmc.mirantis.com_servicetemplates.yaml index 739906789..1a96f18cb 100644 --- a/templates/provider/hmc/templates/crds/hmc.mirantis.com_servicetemplates.yaml +++ b/templates/provider/hmc/templates/crds/hmc.mirantis.com_servicetemplates.yaml @@ -284,6 +284,10 @@ spec: - kind - name type: object + chartVersion: + description: ChartVersion represents the version of the Helm Chart + associated with this template. + type: string config: description: |- Config demonstrates available parameters for template customization, From 3e20b8a099d3e1f28906199f70d218e1e2b97380 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 17:51:27 +0000 Subject: [PATCH 3/4] Bump helm.sh/helm/v3 from 3.16.3 to 3.16.4 Bumps [helm.sh/helm/v3](https://github.com/helm/helm) from 3.16.3 to 3.16.4. - [Release notes](https://github.com/helm/helm/releases) - [Commits](https://github.com/helm/helm/compare/v3.16.3...v3.16.4) --- updated-dependencies: - dependency-name: helm.sh/helm/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e8572b80d..d1e7090d0 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/vmware-tanzu/velero v1.15.0 gopkg.in/yaml.v3 v3.0.1 - helm.sh/helm/v3 v3.16.3 + helm.sh/helm/v3 v3.16.4 k8s.io/api v0.31.3 k8s.io/apiextensions-apiserver v0.31.3 k8s.io/apimachinery v0.31.3 diff --git a/go.sum b/go.sum index 05e8521c9..2ad4e741d 100644 --- a/go.sum +++ b/go.sum @@ -648,8 +648,8 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= -helm.sh/helm/v3 v3.16.3 h1:kb8bSxMeRJ+knsK/ovvlaVPfdis0X3/ZhYCSFRP+YmY= -helm.sh/helm/v3 v3.16.3/go.mod h1:zeVWGDR4JJgiRbT3AnNsjYaX8OTJlIE9zC+Q7F7iUSU= +helm.sh/helm/v3 v3.16.4 h1:rBn/h9MACw+QlhxQTjpl8Ifx+VTWaYsw3rguGBYBzr0= +helm.sh/helm/v3 v3.16.4/go.mod h1:k8QPotUt57wWbi90w3LNmg3/MWcLPigVv+0/X4B8BzA= k8s.io/api v0.31.3 h1:umzm5o8lFbdN/hIXbrK9oRpOproJO62CV1zqxXrLgk8= k8s.io/api v0.31.3/go.mod h1:UJrkIp9pnMOI9K2nlL6vwpxRzzEX5sWgn8kGQe92kCE= k8s.io/apiextensions-apiserver v0.31.3 h1:+GFGj2qFiU7rGCsA5o+p/rul1OQIq6oYpQw4+u+nciE= From 60a6edc796c01874a72dda41db4791097fbbbacf Mon Sep 17 00:00:00 2001 From: Dina Belova Date: Tue, 17 Dec 2024 20:04:53 -0800 Subject: [PATCH 4/4] Add issue templates (bug, small feature, epic) --- .github/ISSUE_TEMPLATE/bug_report.md | 23 ++++++++++++++ .github/ISSUE_TEMPLATE/epic.md | 37 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature-request.md | 20 ++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/epic.md create mode 100644 .github/ISSUE_TEMPLATE/feature-request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..016b950d1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,23 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[bug] " +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. +2. +3. + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/epic.md b/.github/ISSUE_TEMPLATE/epic.md new file mode 100644 index 000000000..4a66255f3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/epic.md @@ -0,0 +1,37 @@ +--- +name: Epic +about: Feature request that is larger body of work +title: '' +labels: epic +assignees: '' + +--- + +**Goals** + + +**Major deliverables** + + +**Who it benefits** + + +**Acceptance criteria** +- +- +- + +**Telemetry & Success Criteria** + + +**Assumptions** + + +**Limitations** + + +**Out of scope** + + +**User stories** + diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 000000000..efbdf8359 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[enhancement] " +labels: enhancement +assignees: '' + +--- + +**Is your enhancement / feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here.