Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pkg/api/config/v1alpha1/platform_config_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,3 +505,18 @@ func (g ClusterGit) validate(path *field.Path) field.ErrorList {

return errs
}

func (cfg *PlatformConfig) Migrate() {
for _, c := range cfg.Clusters {
if c.Git.URL != "" {
cfg.Client.Git.Auths = append(cfg.Client.Git.Auths, GitAuth{
URL: c.Git.URL,
Credentials: c.Git.Credentials,
})
}
if cfg.Client.Git.Author.Name == "" {
cfg.Client.Git.Author.Name = c.Git.Author.Name
cfg.Client.Git.Author.Email = c.Git.Author.Email
}
}
}
2 changes: 2 additions & 0 deletions pkg/service/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ func (b *serviceBuilder) build() (*service, error) {
if err != nil {
return nil, fmt.Errorf("could not merge env config: %w", err)
}
b.pCFG.Migrate()

b.oCFG.Default()

return &service{oCFG: b.oCFG, pCFG: b.pCFG}, nil
Expand Down