From c0d28cc755d9be5379825bae3726c4503cf438a7 Mon Sep 17 00:00:00 2001 From: Vincent Behar Date: Wed, 31 Oct 2018 17:12:30 +0100 Subject: [PATCH] fix: broken tls in jx preview fixes #2196 - the `omitempty` json tag was missing from the ExposeControllerConfig struct, which resulted in empty values being present in the extraValues.yaml file - thus overriding valid values from the values.yaml file - the cmdline flags passed through `jx preview` for the ExposeControllerConfig struct were not used to generate the extraValues.yaml file --- pkg/config/helm_values.go | 8 ++++---- pkg/jx/cmd/preview.go | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/config/helm_values.go b/pkg/config/helm_values.go index 8ee6a7c43f..f6b9c20606 100644 --- a/pkg/config/helm_values.go +++ b/pkg/config/helm_values.go @@ -9,10 +9,10 @@ import ( type ExposeControllerConfig struct { Domain string `yaml:"domain,omitempty"` - Exposer string `yaml:"exposer"` - HTTP string `yaml:"http"` - TLSAcme string `yaml:"tlsacme"` - PathMode string `yaml:"pathMode"` + Exposer string `yaml:"exposer,omitempty"` + HTTP string `yaml:"http,omitempty"` + TLSAcme string `yaml:"tlsacme,omitempty"` + PathMode string `yaml:"pathMode,omitempty"` } type ExposeController struct { Config ExposeControllerConfig `yaml:"config,omitempty"` diff --git a/pkg/jx/cmd/preview.go b/pkg/jx/cmd/preview.go index b5b18af4ae..52fd32601e 100644 --- a/pkg/jx/cmd/preview.go +++ b/pkg/jx/cmd/preview.go @@ -435,12 +435,12 @@ func (o *PreviewOptions) Run() error { return err } + if o.HelmValuesConfig.ExposeController == nil { + o.HelmValuesConfig.ExposeController = &config.ExposeController{} + } + o.HelmValuesConfig.ExposeController.Config.Domain = domain values := config.PreviewValuesConfig{ - ExposeController: &config.ExposeController{ - Config: config.ExposeControllerConfig{ - Domain: domain, - }, - }, + ExposeController: o.HelmValuesConfig.ExposeController, Preview: &config.Preview{ Image: &config.Image{ Repository: repository,