Skip to content

Commit

Permalink
Revert "Add UpsertCommand for Upsercontainer func (#580)"
Browse files Browse the repository at this point in the history
This reverts commit 1a60d17.
  • Loading branch information
tamalsaha committed Feb 27, 2024
1 parent 1a60d17 commit f74a71f
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions core/v1/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func UpsertContainer(containers []core.Container, upsert core.Container) []core.
}

func MergeContainer(container core.Container, containerTemplate core.Container) core.Container {
container.Command = UpsertCommand(container.Command, containerTemplate.Command)
container.Command = containerTemplate.Command
container.Args = meta.UpsertArgumentList(container.Args, containerTemplate.Args)
container.WorkingDir = containerTemplate.WorkingDir
container.EnvFrom = containerTemplate.EnvFrom
Expand Down Expand Up @@ -352,22 +352,6 @@ func EnsureEnvVarDeleted(vars []core.EnvVar, name string) []core.EnvVar {
return vars
}

func UpsertCommand(commands []string, nc []string) []string {
upsert := func(newCommand string) {
for _, c := range commands {
if c == newCommand {
return
}
}
commands = append(commands, newCommand)
}

for _, command := range nc {
upsert(command)
}
return commands
}

func MergeLocalObjectReferences(l1, l2 []core.LocalObjectReference) []core.LocalObjectReference {
result := make([]core.LocalObjectReference, 0, len(l1)+len(l2))
m := make(map[string]core.LocalObjectReference)
Expand Down

0 comments on commit f74a71f

Please sign in to comment.