From 1bc13c1953ba94dfb8d969797aa5593cfec9b124 Mon Sep 17 00:00:00 2001 From: Manuel Dewald Date: Mon, 19 Jan 2026 12:53:26 +0100 Subject: [PATCH 1/3] fix(bootstrap-gcp): Registry updates * When loading an existing registry, updates are not kept --- cli/cmd/build_images_test.go | 12 +++---- internal/installer/config.go | 2 +- internal/installer/config_manager.go | 7 +++-- internal/installer/config_manager_profile.go | 1 + internal/installer/files/config_yaml.go | 10 +++++- internal/installer/files/config_yaml_test.go | 4 +-- internal/installer/secrets_test.go | 33 ++++++++++---------- 7 files changed, 39 insertions(+), 30 deletions(-) diff --git a/cli/cmd/build_images_test.go b/cli/cmd/build_images_test.go index 1b76fecb..d5afe9ad 100644 --- a/cli/cmd/build_images_test.go +++ b/cli/cmd/build_images_test.go @@ -138,7 +138,7 @@ var _ = Describe("BuildImagesCmd", func() { c.Opts.Config = "config-without-registry.yaml" configWithoutRegistry := files.RootConfig{ - Registry: files.RegistryConfig{ + Registry: &files.RegistryConfig{ // Empty server }, Codesphere: files.CodesphereConfig{ @@ -174,7 +174,7 @@ var _ = Describe("BuildImagesCmd", func() { c.Opts.Config = "config-without-dockerfile.yaml" configWithoutDockerfile := files.RootConfig{ - Registry: files.RegistryConfig{ + Registry: &files.RegistryConfig{ Server: "registry.example.com", }, Codesphere: files.CodesphereConfig{ @@ -211,7 +211,7 @@ var _ = Describe("BuildImagesCmd", func() { c.Opts.Config = "config-with-dockerfile.yaml" configWithDockerfile := files.RootConfig{ - Registry: files.RegistryConfig{ + Registry: &files.RegistryConfig{ Server: "registry.example.com", }, Codesphere: files.CodesphereConfig{ @@ -250,7 +250,7 @@ var _ = Describe("BuildImagesCmd", func() { c.Opts.Config = "config-with-dockerfile.yaml" configWithDockerfile := files.RootConfig{ - Registry: files.RegistryConfig{ + Registry: &files.RegistryConfig{ Server: "registry.example.com", }, Codesphere: files.CodesphereConfig{ @@ -290,7 +290,7 @@ var _ = Describe("BuildImagesCmd", func() { c.Opts.Config = "config-with-dockerfile.yaml" configWithDockerfile := files.RootConfig{ - Registry: files.RegistryConfig{ + Registry: &files.RegistryConfig{ Server: "registry.example.com", }, Codesphere: files.CodesphereConfig{ @@ -329,7 +329,7 @@ var _ = Describe("BuildImagesCmd", func() { c.Opts.Config = "config-with-multiple-images.yaml" configWithMultipleImages := files.RootConfig{ - Registry: files.RegistryConfig{ + Registry: &files.RegistryConfig{ Server: "registry.example.com", }, Codesphere: files.CodesphereConfig{ diff --git a/internal/installer/config.go b/internal/installer/config.go index f7bcc14c..29e8f5a8 100644 --- a/internal/installer/config.go +++ b/internal/installer/config.go @@ -27,7 +27,7 @@ func NewConfig() *Config { // ParseConfigYaml reads and parses the configuration YAML file at the given path. func (c *Config) ParseConfigYaml(configPath string) (files.RootConfig, error) { - var rootConfig files.RootConfig + rootConfig := files.NewRootConfig() file, err := c.FileIO.Open(configPath) if err != nil { diff --git a/internal/installer/config_manager.go b/internal/installer/config_manager.go index 7d2a4ed5..7c11c810 100644 --- a/internal/installer/config_manager.go +++ b/internal/installer/config_manager.go @@ -41,9 +41,10 @@ type InstallConfig struct { } func NewInstallConfigManager() InstallConfigManager { + config := files.NewRootConfig() return &InstallConfig{ fileIO: &util.FilesystemWriter{}, - Config: &files.RootConfig{}, + Config: &config, Vault: &files.InstallVault{}, } } @@ -60,12 +61,12 @@ func (g *InstallConfig) LoadInstallConfigFromFile(configPath string) error { return fmt.Errorf("failed to read %s: %w", configPath, err) } - config := &files.RootConfig{} + config := files.NewRootConfig() if err := config.Unmarshal(data); err != nil { return fmt.Errorf("failed to unmarshal %s: %w", configPath, err) } - g.Config = config + g.Config = &config return nil } diff --git a/internal/installer/config_manager_profile.go b/internal/installer/config_manager_profile.go index d2f9d1a2..cbf85184 100644 --- a/internal/installer/config_manager_profile.go +++ b/internal/installer/config_manager_profile.go @@ -58,6 +58,7 @@ func (g *InstallConfig) ApplyProfile(profile string) error { Enabled: false, Pools: []files.MetalLBPoolDef{}, } + g.Config.Registry = &files.RegistryConfig{} g.Config.Codesphere.Experiments = []string{} g.Config.Codesphere.WorkspaceImages = &files.WorkspaceImagesConfig{ Agent: &files.ImageRef{ diff --git a/internal/installer/files/config_yaml.go b/internal/installer/files/config_yaml.go index 0eccefa5..d5ecbc4f 100644 --- a/internal/installer/files/config_yaml.go +++ b/internal/installer/files/config_yaml.go @@ -42,7 +42,7 @@ type SecretFields struct { type RootConfig struct { Datacenter DatacenterConfig `yaml:"dataCenter"` Secrets SecretsConfig `yaml:"secrets"` - Registry RegistryConfig `yaml:"registry,omitempty"` + Registry *RegistryConfig `yaml:"registry,omitempty"` Postgres PostgresConfig `yaml:"postgres"` Ceph CephConfig `yaml:"ceph"` Kubernetes KubernetesConfig `yaml:"kubernetes"` @@ -400,6 +400,14 @@ func (c *RootConfig) Unmarshal(data []byte) error { return yaml.Unmarshal(data, c) } +func NewRootConfig() RootConfig { + return RootConfig{ + Registry: &RegistryConfig{}, + MetalLB: &MetalLBConfig{}, + ManagedServiceBackends: &ManagedServiceBackendsConfig{}, + } +} + func (c *RootConfig) ExtractBomRefs() []string { var bomRefs []string for _, imageConfig := range c.Codesphere.DeployConfig.Images { diff --git a/internal/installer/files/config_yaml_test.go b/internal/installer/files/config_yaml_test.go index 11620754..3f34a063 100644 --- a/internal/installer/files/config_yaml_test.go +++ b/internal/installer/files/config_yaml_test.go @@ -15,14 +15,14 @@ import ( var _ = Describe("ConfigYaml", func() { var ( - rootConfig *files.RootConfig + rootConfig files.RootConfig tempDir string configFile string sampleYaml string ) BeforeEach(func() { - rootConfig = &files.RootConfig{} + rootConfig = files.NewRootConfig() var err error tempDir, err = os.MkdirTemp("", "config_yaml_test") diff --git a/internal/installer/secrets_test.go b/internal/installer/secrets_test.go index f057ea9c..b99fec1c 100644 --- a/internal/installer/secrets_test.go +++ b/internal/installer/secrets_test.go @@ -53,6 +53,7 @@ var _ = Describe("ExtractVault", func() { Kubernetes: files.KubernetesConfig{ NeedsKubeConfig: true, }, + Registry: &files.RegistryConfig{}, } vault := config.ExtractVault() @@ -118,14 +119,13 @@ var _ = Describe("ExtractVault", func() { }) It("does not include kubeconfig for managed k8s", func() { - config := &files.RootConfig{ - Kubernetes: files.KubernetesConfig{ - NeedsKubeConfig: false, - }, - Codesphere: files.CodesphereConfig{ - DomainAuthPrivateKey: "test-key", - DomainAuthPublicKey: "test-pub", - }, + config := files.NewRootConfig() + config.Kubernetes = files.KubernetesConfig{ + NeedsKubeConfig: false, + } + config.Codesphere = files.CodesphereConfig{ + DomainAuthPrivateKey: "test-key", + DomainAuthPublicKey: "test-pub", } vault := config.ExtractVault() @@ -146,15 +146,14 @@ var _ = Describe("ExtractVault", func() { userPasswords[service] = service + "-pass" } - config := &files.RootConfig{ - Postgres: files.PostgresConfig{ - Primary: &files.PostgresPrimaryConfig{}, - UserPasswords: userPasswords, - }, - Codesphere: files.CodesphereConfig{ - DomainAuthPrivateKey: "test", - DomainAuthPublicKey: "test", - }, + config := files.NewRootConfig() + config.Postgres = files.PostgresConfig{ + Primary: &files.PostgresPrimaryConfig{}, + UserPasswords: userPasswords, + } + config.Codesphere = files.CodesphereConfig{ + DomainAuthPrivateKey: "test", + DomainAuthPublicKey: "test", } vault := config.ExtractVault() From 961409517834d69acc09e9e440245f0e5b434d81 Mon Sep 17 00:00:00 2001 From: NautiluX <2600004+NautiluX@users.noreply.github.com> Date: Mon, 19 Jan 2026 13:21:46 +0000 Subject: [PATCH 2/3] chore(docs): Auto-update docs and licenses Signed-off-by: NautiluX <2600004+NautiluX@users.noreply.github.com> --- NOTICE | 6 ------ 1 file changed, 6 deletions(-) diff --git a/NOTICE b/NOTICE index c40568e8..df833f38 100644 --- a/NOTICE +++ b/NOTICE @@ -267,12 +267,6 @@ Version: v0.5.15 License: BSD-3-Clause License URL: https://github.com/ulikunitz/xz/blob/v0.5.15/LICENSE ----------- -Module: github.com/yaml/go-yaml -Version: v2.1.0 -License: Apache-2.0 -License URL: https://github.com/yaml/go-yaml/blob/v2.1.0/LICENSE - ---------- Module: go.opentelemetry.io/auto/sdk Version: v1.2.1 From 42d0e06420a39ae83fd4ac9b8a914bd02b38df54 Mon Sep 17 00:00:00 2001 From: NautiluX <2600004+NautiluX@users.noreply.github.com> Date: Mon, 19 Jan 2026 13:22:28 +0000 Subject: [PATCH 3/3] chore(docs): Auto-update docs and licenses Signed-off-by: NautiluX <2600004+NautiluX@users.noreply.github.com> --- internal/tmpl/NOTICE | 6 ------ 1 file changed, 6 deletions(-) diff --git a/internal/tmpl/NOTICE b/internal/tmpl/NOTICE index c40568e8..df833f38 100644 --- a/internal/tmpl/NOTICE +++ b/internal/tmpl/NOTICE @@ -267,12 +267,6 @@ Version: v0.5.15 License: BSD-3-Clause License URL: https://github.com/ulikunitz/xz/blob/v0.5.15/LICENSE ----------- -Module: github.com/yaml/go-yaml -Version: v2.1.0 -License: Apache-2.0 -License URL: https://github.com/yaml/go-yaml/blob/v2.1.0/LICENSE - ---------- Module: go.opentelemetry.io/auto/sdk Version: v1.2.1