Skip to content

Commit

Permalink
fix(projects.pipelineschedule): Remove redundant mapping in notSaved(…
Browse files Browse the repository at this point in the history
…) and notDeleted()

Signed-off-by: Vitalijs <[email protected]>
  • Loading branch information
Vitalijs committed Aug 10, 2023
1 parent 0cb5331 commit dadcf70
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions pkg/controller/projects/pipelineschedules/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,32 +368,17 @@ func isVariablesUpToDate(crv []v1alpha1.PipelineVariable, inv []*gitlab.Pipeline
}

func notDeleted(inv *gitlab.PipelineVariable, crvArr []v1alpha1.PipelineVariable) bool {
victim := v1alpha1.PipelineVariable{
Key: inv.Key,
Value: inv.Value,
VariableType: &inv.Value,
}

for _, v := range crvArr {
if victim.Key == v.Key {
if inv.Key == v.Key {
return false
}
}
return true
}

func notSaved(crv v1alpha1.PipelineVariable, invArr []*gitlab.PipelineVariable) bool {
victim := gitlab.PipelineVariable{
Key: crv.Key,
Value: crv.Value,
}

if crv.VariableType != nil {
victim.VariableType = *crv.VariableType
}

for _, v := range invArr {
if victim.Key == v.Key {
if crv.Key == v.Key {
return false
}
}
Expand Down

0 comments on commit dadcf70

Please sign in to comment.