2 Commits

Author SHA1 Message Date
6bf1f8a314 fix(cmd): adapt error message
All checks were successful
Lint Golang files / Run golang CI linter (stable, ubuntu-latest-amd64) (push) Successful in 46s
Run Golang tests / Run unit tests (stable, ubuntu-latest-amd64) (push) Successful in 19s
Lint Markdown files / Run markdown linter (push) Successful in 5s
Lint Golang files / Run golang CI linter (stable, ubuntu-latest-arm64) (push) Successful in 1m47s
Run Golang tests / Run unit tests (stable, ubuntu-latest-arm64) (push) Successful in 58s
2025-12-23 00:10:17 +01:00
8c52e19275 fix(domain): mergeExistingWin: Services and Volumes
Merge existing win of services and volumes correctly
2025-12-23 00:08:04 +01:00
2 changed files with 4 additions and 4 deletions

View File

@@ -55,7 +55,7 @@ dcmerge docker-compose.yml https://git.example.local/user/repo/docker-compose.ym
func run(cmd *cobra.Command, args []string) error {
mergeExisting, err := cmd.Flags().GetBool("existing-win")
if err != nil {
return fmt.Errorf("failed to parse flag last-win: %s", err)
return fmt.Errorf("failed to parse flag existing-win: %s", err)
}
mergeLastWin, err := cmd.Flags().GetBool("last-win")
@@ -78,7 +78,7 @@ func run(cmd *cobra.Command, args []string) error {
for _, config := range dockerComposeConfigs {
switch {
case mergeExisting && mergeLastWin:
return fmt.Errorf("neither --first-win or --last-win can be specified - not booth")
return fmt.Errorf("neither --existing-win or --last-win can be specified - not booth")
case mergeExisting && !mergeLastWin:
dockerComposeConfig.MergeExistingWin(config)
case !mergeExisting && mergeLastWin:

View File

@@ -182,7 +182,7 @@ func (c *Config) mergeExistingWinSecrets(secrets map[string]*Secret) {
continue
}
if c.ExistsNetwork(secretName) {
if c.ExistsSecret(secretName) {
c.Secrets[secretName].MergeExistingWin(secret)
} else {
c.Secrets[secretName] = secret
@@ -210,7 +210,7 @@ func (c *Config) mergeExistingWinVolumes(volumes map[string]*Volume) {
continue
}
if c.ExistsNetwork(volumeName) {
if c.ExistsVolume(volumeName) {
c.Volumes[volumeName].MergeExistingWin(volume)
} else {
c.Volumes[volumeName] = volume