mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
* Allow importing kustomize API's without relying on `plugins` Introduce `kustomize_disable_go_plugin_support` go build tag to decouple the kustomize API from the `plugins` package dependency. This is advantageous for applications embedding the kusstomize API without the need for dynamic Go plugins, mitigating an increase in binary size associated with the inclusion of the plugins dependency and the population of ELF sections like `.dynsym` and `.dynstr`. The flag provides applications with the flexibility to exclude the import, catering to scenarios where dynamic Go plugin support is unnecessary. Signed-off-by: Tiago Silva <tiago.silva@goteleport.com> * fix golint by disabling some lint checks * handle code review suggestions --------- Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
25 lines
951 B
Go
25 lines
951 B
Go
// Copyright 2024 The Kubernetes Authors.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// The build tag "kustomize_disable_go_plugin_support" is used to deactivate the
|
|
// kustomize API's dependency on the "plugins" package. This is beneficial for
|
|
// applications that need to embed it but do not have requirements for dynamic
|
|
// Go plugins.
|
|
// Including plugins as a dependency can lead to an increase in binary size due
|
|
// to the population of ELF's sections such as .dynsym and .dynstr.
|
|
// By utilizing this flag, applications have the flexibility to exclude the
|
|
// import if they do not require support for dynamic Go plugins.
|
|
//go:build kustomize_disable_go_plugin_support
|
|
|
|
package loader
|
|
|
|
import (
|
|
"sigs.k8s.io/kustomize/api/resmap"
|
|
"sigs.k8s.io/kustomize/kyaml/errors"
|
|
"sigs.k8s.io/kustomize/kyaml/resid"
|
|
)
|
|
|
|
func (l *Loader) loadGoPlugin(_ resid.ResId, _ string) (resmap.Configurable, error) {
|
|
return nil, errors.New("plugin load is disabled")
|
|
}
|