Skip to content

Commit f5febd2

Browse files
feat: include installer version to the cluster configuration configmap (#108)
feat: include installer version include installer version to the cluster configuration configmap.
1 parent af6122b commit f5febd2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/addons/adminconsole/customize.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"sigs.k8s.io/controller-runtime/pkg/log/zap"
2424
"sigs.k8s.io/yaml"
2525

26+
"github.com/replicatedhq/helmvm/pkg/defaults"
2627
"github.com/replicatedhq/helmvm/pkg/preflights"
2728
)
2829

@@ -190,6 +191,10 @@ func (a *AdminConsoleCustomization) clusterConfig(ctx context.Context, version s
190191
if err != nil {
191192
return fmt.Errorf("unable to create kubernetes client: %w", err)
192193
}
194+
content := map[string]string{
195+
"AdminConsoleVersion": version,
196+
"InstallerVersion": defaults.Version,
197+
}
193198
nsn := client.ObjectKey{Namespace: clusterConfigMapNS, Name: clusterConfigMapName}
194199
var cm corev1.ConfigMap
195200
if err := kubeclient.Get(ctx, nsn, &cm); err != nil {
@@ -199,15 +204,15 @@ func (a *AdminConsoleCustomization) clusterConfig(ctx context.Context, version s
199204
logrus.Infof("Creating cluster config configmap")
200205
cm = corev1.ConfigMap{
201206
ObjectMeta: metav1.ObjectMeta{Namespace: nsn.Namespace, Name: nsn.Name},
202-
Data: map[string]string{"version": version},
207+
Data: content,
203208
}
204209
if err := kubeclient.Create(ctx, &cm); err != nil {
205210
return fmt.Errorf("unable to create cluster config configmap: %w", err)
206211
}
207212
return nil
208213
}
209214
logrus.Infof("Updating cluster config configmap")
210-
cm.Data["version"] = version
215+
cm.Data = content
211216
if err := kubeclient.Update(ctx, &cm); err != nil {
212217
return fmt.Errorf("unable to update cluster config configmap: %w", err)
213218
}

0 commit comments

Comments
 (0)