Skip to content

Commit

Permalink
Merge pull request #139 from SovereignCloudStack/ani/issues/138
Browse files Browse the repository at this point in the history
🌱 Remove helmchartstatus after hook is finished
  • Loading branch information
aniruddha2000 committed Apr 30, 2024
2 parents fa9b2fc + 4073ab9 commit 7d5e64c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
15 changes: 10 additions & 5 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@ rules:
min-spaces-from-content: 1

yaml-files:
- '*.yaml'
- '*.yml'
- "*.yaml"
- "*.yml"

ignore:
- '**/vendor/**'
- '.cache'
- "**/vendor/**"
- ".cache"
- _artifacts
- config/crd/**/*.yaml
- config/rbac/**/*.yaml
- config/webhook/**/*.yaml
- config/webhook/**/*.yaml
- test/infrastructure/**/config/webhook/**/*.yaml
- test/infrastructure/**/config/crd/**/*.yaml
- test/infrastructure/**/config/rbac/**/*.yaml
- test/releases/**
- test/cluster-stacks/**
8 changes: 7 additions & 1 deletion internal/controller/clusteraddon_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ func (r *ClusterAddonReconciler) Reconcile(ctx context.Context, req reconcile.Re

clusterAddon.Spec.ClusterStack = cluster.Spec.Topology.Class

// store the release kubernetes version and current hook
// remove the helm chart status from the status.
clusterAddon.Status.HelmChartStatus = make(map[string]csov1alpha1.HelmChartStatusConditions)
clusterAddon.Status.Ready = true

return ctrl.Result{}, nil
Expand Down Expand Up @@ -387,6 +388,11 @@ func (r *ClusterAddonReconciler) Reconcile(ctx context.Context, req reconcile.Re
// clusterAddon.Spec.Version = metadata.Versions.Components.ClusterAddon
conditions.MarkTrue(clusterAddon, csov1alpha1.HelmChartAppliedCondition)

// remove the helm chart status from the status.
clusterAddon.Status.HelmChartStatus = make(map[string]csov1alpha1.HelmChartStatusConditions)

// store the release kubernetes version and current hook
clusterAddon.Status.KubernetesVersion = releaseAsset.Meta.Versions.Kubernetes
clusterAddon.Status.CurrentHook = clusterAddon.Spec.Hook
clusterAddon.Status.Ready = true
}
Expand Down

0 comments on commit 7d5e64c

Please sign in to comment.