Skip to content

Commit

Permalink
🐛 Allow Helm execution
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinemartin committed Feb 2, 2023
1 parent f39ac6a commit b92a634
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/plugins/factories.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,8 @@ func NewPluginHelpers() (*resmap.PluginHelpers, error) {
return nil, err
}

return resmap.NewPluginHelpers(ldr, depProvider.GetFieldValidator(), resmapFactory, types.DisabledPluginConfig()), nil
config := types.DisabledPluginConfig()
config.HelmConfig.Enabled = true
config.HelmConfig.Command = "helm"
return resmap.NewPluginHelpers(ldr, depProvider.GetFieldValidator(), resmapFactory, config), nil
}
4 changes: 4 additions & 0 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ func TransferAnnotations(list []*yaml.RNode, config *yaml.RNode) (err error) {
annotations[FunctionAnnotationLocalConfig] = "true"
}
if path != "" {
//lint:ignore SA1019 used by kustomize
annotations[kioutil.LegacyPathAnnotation] = path
annotations[kioutil.PathAnnotation] = path

curIndex := strconv.Itoa(startIndex + index)
//lint:ignore SA1019 used by kustomize
annotations[kioutil.LegacyIndexAnnotation] = curIndex
annotations[kioutil.IndexAnnotation] = curIndex
}
Expand All @@ -85,11 +87,13 @@ func unLocal(list []*yaml.RNode) ([]*yaml.RNode, error) {
// For the remaining resources, if a path and/or index was specified
// we copy it.
if path, ok := annotations[FunctionAnnotationPath]; ok {
//lint:ignore SA1019 used by kustomize
annotations[kioutil.LegacyPathAnnotation] = path
annotations[kioutil.PathAnnotation] = path
delete(annotations, FunctionAnnotationPath)
}
if index, ok := annotations[FunctionAnnotationIndex]; ok {
//lint:ignore SA1019 used by kustomize
annotations[kioutil.LegacyIndexAnnotation] = index
annotations[kioutil.IndexAnnotation] = index
delete(annotations, FunctionAnnotationIndex)
Expand Down

0 comments on commit b92a634

Please sign in to comment.