Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Revert "Merge client side and server side configs when installing (#790
Browse files Browse the repository at this point in the history
…)"

This reverts commit 8ae67af.

Signed-off-by: Craig Jellick <craig@acorn.io>
  • Loading branch information
cjellick committed Nov 16, 2022
1 parent fb5940c commit 7bcf811
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
4 changes: 2 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func IsDockerDesktop(ctx context.Context, getter kclient.Reader) (bool, error) {
return false, nil
}

func Merge(oldConfig, newConfig *apiv1.Config) *apiv1.Config {
func merge(oldConfig, newConfig *apiv1.Config) *apiv1.Config {
var (
mergedConfig apiv1.Config
)
Expand Down Expand Up @@ -235,7 +235,7 @@ func AsConfigMap(cfg *apiv1.Config) (*corev1.ConfigMap, error) {
}

func asConfigMap(existing, cfg *apiv1.Config) (*corev1.ConfigMap, error) {
newConfig := Merge(existing, cfg)
newConfig := merge(existing, cfg)

configBytes, err := json.Marshal(newConfig)
if err != nil {
Expand Down
17 changes: 5 additions & 12 deletions pkg/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,6 @@ func Install(ctx context.Context, image string, opts *Options) error {
klogv2.SetOutput(io.Discard)
utilruntime.ErrorHandlers = nil

kclient, err := k8sclient.Default()
if err != nil {
return err
}

serverConf, err := config.Get(ctx, kclient)
if err != nil {
return err
}

opts.Config = *config.Merge(serverConf, &opts.Config)

// Require E-Mail address when using Let's Encrypt production
if opts.Config.LetsEncrypt != nil && *opts.Config.LetsEncrypt == "enabled" {
if opts.Config.LetsEncryptTOSAgree == nil || !*opts.Config.LetsEncryptTOSAgree {
Expand Down Expand Up @@ -175,6 +163,11 @@ func Install(ctx context.Context, image string, opts *Options) error {
}
}

kclient, err := k8sclient.Default()
if err != nil {
return err
}

var installIngressController bool
if ok, err := config.IsDockerDesktop(ctx, kclient); err != nil {
return err
Expand Down

0 comments on commit 7bcf811

Please sign in to comment.