From c1c967a06d506fbbca1cd1085e61351fb4942f0b Mon Sep 17 00:00:00 2001 From: Rajat Chopra Date: Wed, 5 Sep 2018 15:19:04 -0400 Subject: [PATCH] Bubble ClusterName to top level so that its easily discoverable (still keep metadata) Signed-off-by: Rajat Chopra --- pkg/asset/installconfig/installconfig.go | 6 +++--- pkg/types/installconfig.go | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/asset/installconfig/installconfig.go b/pkg/asset/installconfig/installconfig.go index fae7ade008e..4c0a85dd358 100644 --- a/pkg/asset/installconfig/installconfig.go +++ b/pkg/asset/installconfig/installconfig.go @@ -6,10 +6,9 @@ import ( "github.com/ghodss/yaml" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/openshift/installer/pkg/asset" "github.com/openshift/installer/pkg/types" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // installConfig generates the install-config.yml file. @@ -49,7 +48,8 @@ func (a *installConfig) Generate(dependencies map[asset.Asset]*asset.State) (*as ObjectMeta: metav1.ObjectMeta{ Name: clusterName, }, - ClusterID: clusterID, + ClusterName: clusterName, + ClusterID: clusterID, Admin: types.Admin{ Email: emailAddress, Password: password, diff --git a/pkg/types/installconfig.go b/pkg/types/installconfig.go index 9322a8fb050..496463a27d4 100644 --- a/pkg/types/installconfig.go +++ b/pkg/types/installconfig.go @@ -12,8 +12,12 @@ type InstallConfig struct { // +optional metav1.TypeMeta `json:",inline"` + // +optional metav1.ObjectMeta `json:"metadata"` + // ClusterName is the name of the cluster. + ClusterName string `json:"clusterName"` + // ClusterID is the ID of the cluster. ClusterID string `json:"clusterID"`