Skip to content

Commit

Permalink
Adding support for Functions in crank validate (fixes #5491)
Browse files Browse the repository at this point in the history
Signed-off-by: Jiri Tyr <jiri.tyr@gmail.com>
  • Loading branch information
jtyr committed Apr 11, 2024
1 parent 87d6699 commit 068648f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmd/crank/beta/validate/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,17 @@ func (m *Manager) addDependencies() error {
deps := cfg.Spec.MetaSpec.DependsOn
for _, dep := range deps {
image := ""
if dep.Configuration != nil {
if dep.Configuration != nil { //nolint:gocritic // switch is not suitable here
image = *dep.Configuration
} else if dep.Provider != nil {
image = *dep.Provider
} else if dep.Function != nil {
image = *dep.Function
}
if len(image) > 0 {
image = fmt.Sprintf(imageFmt, image, dep.Version)
m.deps[image] = true
}
image = fmt.Sprintf(imageFmt, image, dep.Version)
m.deps[image] = true
}
}

Expand Down

0 comments on commit 068648f

Please sign in to comment.