Skip to content

Commit

Permalink
Merge pull request #5585 from crossplane/backport-5570-to-release-1.15
Browse files Browse the repository at this point in the history
[Backport release-1.15] Adding support for Functions in crank validate (fixes #5491)
  • Loading branch information
phisco committed Apr 17, 2024
2 parents 432e163 + c7ad6a9 commit 8d09f30
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 @@ -192,13 +192,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 8d09f30

Please sign in to comment.