Fix pluginator incompatibility with nolint lines

This commit is contained in:
Katrina Verey
2022-11-28 19:11:09 -05:00
parent 832b552076
commit a612cd2b7e
27 changed files with 54 additions and 87 deletions

View File

@@ -19,8 +19,7 @@ import (
"sigs.k8s.io/yaml" "sigs.k8s.io/yaml"
) )
// HelmChartInflationGeneratorPlugin is a plugin to generate resources // Generate resources from a remote or local helm chart.
// from a remote or local helm chart.
type HelmChartInflationGeneratorPlugin struct { type HelmChartInflationGeneratorPlugin struct {
h *resmap.PluginHelpers h *resmap.PluginHelpers
types.HelmGlobals types.HelmGlobals
@@ -28,8 +27,6 @@ type HelmChartInflationGeneratorPlugin struct {
tmpDir string tmpDir string
} }
var KustomizePlugin HelmChartInflationGeneratorPlugin
const ( const (
valuesMergeOptionMerge = "merge" valuesMergeOptionMerge = "merge"
valuesMergeOptionOverride = "override" valuesMergeOptionOverride = "override"

View File

@@ -72,10 +72,7 @@ func ConvertToBuiltInPlugin() (retErr error) {
if strings.HasPrefix(l, "//go:generate") { if strings.HasPrefix(l, "//go:generate") {
continue continue
} }
if strings.HasPrefix(l, "//noinspection") { if strings.HasPrefix(l, "var "+konfig.PluginSymbol+" plugin") {
continue
}
if l == "var "+konfig.PluginSymbol+" plugin" {
continue continue
} }
if strings.Contains(l, " Transform(") { if strings.Contains(l, " Transform(") {
@@ -136,9 +133,12 @@ func newWriter(r string) (*writer, error) {
} }
// Assume that this command is running with a $PWD of // Assume that this command is running with a $PWD of
// $HOME/kustomize/plugin/builtin/secretGenerator //
// $HOME/kustomize/plugin/builtin/secretGenerator
//
// (for example). Then we want to write to // (for example). Then we want to write to
// $HOME/kustomize/api/builtins //
// $HOME/kustomize/api/builtins
func makeOutputFileName(root string) string { func makeOutputFileName(root string) string {
return filepath.Join( return filepath.Join(
"..", "..", "..", "api/internal", packageForGeneratedCode, root+".go") "..", "..", "..", "api/internal", packageForGeneratedCode, root+".go")

View File

@@ -34,8 +34,7 @@ type plugin struct{
FieldSpecs []types.FieldSpec ` + "`json:\"fieldSpecs,omitempty\" yaml:\"fieldSpecs,omitempty\"`" + ` FieldSpecs []types.FieldSpec ` + "`json:\"fieldSpecs,omitempty\" yaml:\"fieldSpecs,omitempty\"`" + `
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
func (p *plugin) Config( func (p *plugin) Config(
_ *resmap.PluginHelpers, config []byte) (err error) { _ *resmap.PluginHelpers, config []byte) (err error) {
@@ -171,8 +170,7 @@ type plugin struct {
types.ConfigMapArgs types.ConfigMapArgs
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
func (p *plugin) Config(h *resmap.PluginHelpers, config []byte) (err error) { func (p *plugin) Config(h *resmap.PluginHelpers, config []byte) (err error) {
p.ConfigMapArgs = types.ConfigMapArgs{} p.ConfigMapArgs = types.ConfigMapArgs{}

View File

@@ -9,8 +9,7 @@ import (
type plugin struct{} type plugin struct{}
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
func (p *plugin) Config( func (p *plugin) Config(
_ *resmap.PluginHelpers, _ []byte) (err error) { _ *resmap.PluginHelpers, _ []byte) (err error) {

View File

@@ -17,8 +17,7 @@ type plugin struct {
FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"` FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
func (p *plugin) Config( func (p *plugin) Config(
_ *resmap.PluginHelpers, c []byte) (err error) { _ *resmap.PluginHelpers, c []byte) (err error) {

View File

@@ -17,8 +17,7 @@ type plugin struct {
types.ConfigMapArgs types.ConfigMapArgs
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
func (p *plugin) Config(h *resmap.PluginHelpers, config []byte) (err error) { func (p *plugin) Config(h *resmap.PluginHelpers, config []byte) (err error) {
p.ConfigMapArgs = types.ConfigMapArgs{} p.ConfigMapArgs = types.ConfigMapArgs{}

View File

@@ -15,8 +15,7 @@ type plugin struct {
hasher ifc.KustHasher hasher ifc.KustHasher
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
func (p *plugin) Config( func (p *plugin) Config(
h *resmap.PluginHelpers, _ []byte) (err error) { h *resmap.PluginHelpers, _ []byte) (err error) {

View File

@@ -23,17 +23,15 @@ import (
"sigs.k8s.io/yaml" "sigs.k8s.io/yaml"
) )
// HelmChartInflationGeneratorPlugin is a plugin to generate resources // Generate resources from a remote or local helm chart.
// from a remote or local helm chart. type plugin struct {
type HelmChartInflationGeneratorPlugin struct {
h *resmap.PluginHelpers h *resmap.PluginHelpers
types.HelmGlobals types.HelmGlobals
types.HelmChart types.HelmChart
tmpDir string tmpDir string
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin HelmChartInflationGeneratorPlugin
const ( const (
valuesMergeOptionMerge = "merge" valuesMergeOptionMerge = "merge"
@@ -49,7 +47,7 @@ var legalMergeOptions = []string{
// Config uses the input plugin configurations `config` to setup the generator // Config uses the input plugin configurations `config` to setup the generator
// options // options
func (p *HelmChartInflationGeneratorPlugin) Config( func (p *plugin) Config(
h *resmap.PluginHelpers, config []byte) (err error) { h *resmap.PluginHelpers, config []byte) (err error) {
if h.GeneralConfig() == nil { if h.GeneralConfig() == nil {
return fmt.Errorf("unable to access general config") return fmt.Errorf("unable to access general config")
@@ -72,7 +70,7 @@ func (p *HelmChartInflationGeneratorPlugin) Config(
// filesystem since we allow the user to use previously // filesystem since we allow the user to use previously
// downloaded charts. This is safe since this plugin is // downloaded charts. This is safe since this plugin is
// owned by kustomize. // owned by kustomize.
func (p *HelmChartInflationGeneratorPlugin) establishTmpDir() (err error) { func (p *plugin) establishTmpDir() (err error) {
if p.tmpDir != "" { if p.tmpDir != "" {
// already done. // already done.
return nil return nil
@@ -81,7 +79,7 @@ func (p *HelmChartInflationGeneratorPlugin) establishTmpDir() (err error) {
return err return err
} }
func (p *HelmChartInflationGeneratorPlugin) validateArgs() (err error) { func (p *plugin) validateArgs() (err error) {
if p.Name == "" { if p.Name == "" {
return fmt.Errorf("chart name cannot be empty") return fmt.Errorf("chart name cannot be empty")
} }
@@ -116,7 +114,7 @@ func (p *HelmChartInflationGeneratorPlugin) validateArgs() (err error) {
return nil return nil
} }
func (p *HelmChartInflationGeneratorPlugin) errIfIllegalValuesMerge() error { func (p *plugin) errIfIllegalValuesMerge() error {
if p.ValuesMerge == "" { if p.ValuesMerge == "" {
// Use the default. // Use the default.
p.ValuesMerge = valuesMergeOptionOverride p.ValuesMerge = valuesMergeOptionOverride
@@ -130,14 +128,14 @@ func (p *HelmChartInflationGeneratorPlugin) errIfIllegalValuesMerge() error {
return fmt.Errorf("valuesMerge must be one of %v", legalMergeOptions) return fmt.Errorf("valuesMerge must be one of %v", legalMergeOptions)
} }
func (p *HelmChartInflationGeneratorPlugin) absChartHome() string { func (p *plugin) absChartHome() string {
if filepath.IsAbs(p.ChartHome) { if filepath.IsAbs(p.ChartHome) {
return p.ChartHome return p.ChartHome
} }
return filepath.Join(p.h.Loader().Root(), p.ChartHome) return filepath.Join(p.h.Loader().Root(), p.ChartHome)
} }
func (p *HelmChartInflationGeneratorPlugin) runHelmCommand( func (p *plugin) runHelmCommand(
args []string) ([]byte, error) { args []string) ([]byte, error) {
stdout := new(bytes.Buffer) stdout := new(bytes.Buffer)
stderr := new(bytes.Buffer) stderr := new(bytes.Buffer)
@@ -163,7 +161,7 @@ func (p *HelmChartInflationGeneratorPlugin) runHelmCommand(
} }
// createNewMergedValuesFile replaces/merges original values file with ValuesInline. // createNewMergedValuesFile replaces/merges original values file with ValuesInline.
func (p *HelmChartInflationGeneratorPlugin) createNewMergedValuesFile() ( func (p *plugin) createNewMergedValuesFile() (
path string, err error) { path string, err error) {
if p.ValuesMerge == valuesMergeOptionMerge || if p.ValuesMerge == valuesMergeOptionMerge ||
p.ValuesMerge == valuesMergeOptionOverride { p.ValuesMerge == valuesMergeOptionOverride {
@@ -179,7 +177,7 @@ func (p *HelmChartInflationGeneratorPlugin) createNewMergedValuesFile() (
return p.writeValuesBytes(b) return p.writeValuesBytes(b)
} }
func (p *HelmChartInflationGeneratorPlugin) replaceValuesInline() error { func (p *plugin) replaceValuesInline() error {
pValues, err := p.h.Loader().Load(p.ValuesFile) pValues, err := p.h.Loader().Load(p.ValuesFile)
if err != nil { if err != nil {
return err return err
@@ -200,7 +198,7 @@ func (p *HelmChartInflationGeneratorPlugin) replaceValuesInline() error {
} }
// copyValuesFile to avoid branching. TODO: get rid of this. // copyValuesFile to avoid branching. TODO: get rid of this.
func (p *HelmChartInflationGeneratorPlugin) copyValuesFile() (string, error) { func (p *plugin) copyValuesFile() (string, error) {
b, err := p.h.Loader().Load(p.ValuesFile) b, err := p.h.Loader().Load(p.ValuesFile)
if err != nil { if err != nil {
return "", err return "", err
@@ -209,7 +207,7 @@ func (p *HelmChartInflationGeneratorPlugin) copyValuesFile() (string, error) {
} }
// Write a absolute path file in the tmp file system. // Write a absolute path file in the tmp file system.
func (p *HelmChartInflationGeneratorPlugin) writeValuesBytes( func (p *plugin) writeValuesBytes(
b []byte) (string, error) { b []byte) (string, error) {
if err := p.establishTmpDir(); err != nil { if err := p.establishTmpDir(); err != nil {
return "", fmt.Errorf("cannot create tmp dir to write helm values") return "", fmt.Errorf("cannot create tmp dir to write helm values")
@@ -218,14 +216,14 @@ func (p *HelmChartInflationGeneratorPlugin) writeValuesBytes(
return path, errors.Wrap(os.WriteFile(path, b, 0644), "failed to write values file") return path, errors.Wrap(os.WriteFile(path, b, 0644), "failed to write values file")
} }
func (p *HelmChartInflationGeneratorPlugin) cleanup() { func (p *plugin) cleanup() {
if p.tmpDir != "" { if p.tmpDir != "" {
os.RemoveAll(p.tmpDir) os.RemoveAll(p.tmpDir)
} }
} }
// Generate implements generator // Generate implements generator
func (p *HelmChartInflationGeneratorPlugin) Generate() (rm resmap.ResMap, err error) { func (p *plugin) Generate() (rm resmap.ResMap, err error) {
defer p.cleanup() defer p.cleanup()
if err = p.checkHelmVersion(); err != nil { if err = p.checkHelmVersion(); err != nil {
return nil, err return nil, err
@@ -266,7 +264,7 @@ func (p *HelmChartInflationGeneratorPlugin) Generate() (rm resmap.ResMap, err er
return nil, err return nil, err
} }
func (p *HelmChartInflationGeneratorPlugin) templateCommand() []string { func (p *plugin) templateCommand() []string {
args := []string{"template"} args := []string{"template"}
if p.ReleaseName != "" { if p.ReleaseName != "" {
args = append(args, p.ReleaseName) args = append(args, p.ReleaseName)
@@ -293,7 +291,7 @@ func (p *HelmChartInflationGeneratorPlugin) templateCommand() []string {
return args return args
} }
func (p *HelmChartInflationGeneratorPlugin) pullCommand() []string { func (p *plugin) pullCommand() []string {
args := []string{ args := []string{
"pull", "pull",
"--untar", "--untar",
@@ -308,7 +306,7 @@ func (p *HelmChartInflationGeneratorPlugin) pullCommand() []string {
// chartExistsLocally will return true if the chart does exist in // chartExistsLocally will return true if the chart does exist in
// local chart home. // local chart home.
func (p *HelmChartInflationGeneratorPlugin) chartExistsLocally() (string, bool) { func (p *plugin) chartExistsLocally() (string, bool) {
path := filepath.Join(p.absChartHome(), p.Name) path := filepath.Join(p.absChartHome(), p.Name)
s, err := os.Stat(path) s, err := os.Stat(path)
if err != nil { if err != nil {
@@ -318,7 +316,7 @@ func (p *HelmChartInflationGeneratorPlugin) chartExistsLocally() (string, bool)
} }
// checkHelmVersion will return an error if the helm version is not V3 // checkHelmVersion will return an error if the helm version is not V3
func (p *HelmChartInflationGeneratorPlugin) checkHelmVersion() error { func (p *plugin) checkHelmVersion() error {
stdout, err := p.runHelmCommand([]string{"version", "-c", "--short"}) stdout, err := p.runHelmCommand([]string{"version", "-c", "--short"})
if err != nil { if err != nil {
return err return err

View File

@@ -15,8 +15,7 @@ type plugin struct {
types.IAMPolicyGeneratorArgs types.IAMPolicyGeneratorArgs
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
func (p *plugin) Config(h *resmap.PluginHelpers, config []byte) (err error) { func (p *plugin) Config(h *resmap.PluginHelpers, config []byte) (err error) {
p.IAMPolicyGeneratorArgs = types.IAMPolicyGeneratorArgs{} p.IAMPolicyGeneratorArgs = types.IAMPolicyGeneratorArgs{}

View File

@@ -18,8 +18,7 @@ type plugin struct {
FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"` FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
func (p *plugin) Config( func (p *plugin) Config(
_ *resmap.PluginHelpers, c []byte) (err error) { _ *resmap.PluginHelpers, c []byte) (err error) {

View File

@@ -17,8 +17,7 @@ type plugin struct {
FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"` FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
func (p *plugin) Config( func (p *plugin) Config(
_ *resmap.PluginHelpers, c []byte) (err error) { _ *resmap.PluginHelpers, c []byte) (err error) {

View File

@@ -19,8 +19,7 @@ import (
// (like ValidatingWebhookConfiguration) last. // (like ValidatingWebhookConfiguration) last.
type plugin struct{} type plugin struct{}
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
// Nothing needed for configuration. // Nothing needed for configuration.
func (p *plugin) Config( func (p *plugin) Config(

View File

@@ -22,8 +22,7 @@ type plugin struct {
SetRoleBindingSubjects namespace.RoleBindingSubjectMode `json:"setRoleBindingSubjects" yaml:"setRoleBindingSubjects"` SetRoleBindingSubjects namespace.RoleBindingSubjectMode `json:"setRoleBindingSubjects" yaml:"setRoleBindingSubjects"`
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
func (p *plugin) Config( func (p *plugin) Config(
_ *resmap.PluginHelpers, c []byte) (err error) { _ *resmap.PluginHelpers, c []byte) (err error) {

View File

@@ -25,8 +25,7 @@ type plugin struct {
JsonOp string `json:"jsonOp,omitempty" yaml:"jsonOp,omitempty"` JsonOp string `json:"jsonOp,omitempty" yaml:"jsonOp,omitempty"`
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
func (p *plugin) Config( func (p *plugin) Config(
h *resmap.PluginHelpers, c []byte) (err error) { h *resmap.PluginHelpers, c []byte) (err error) {

View File

@@ -19,8 +19,7 @@ type plugin struct {
Patches string `json:"patches,omitempty" yaml:"patches,omitempty"` Patches string `json:"patches,omitempty" yaml:"patches,omitempty"`
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
func (p *plugin) Config( func (p *plugin) Config(
h *resmap.PluginHelpers, c []byte) (err error) { h *resmap.PluginHelpers, c []byte) (err error) {

View File

@@ -26,8 +26,7 @@ type plugin struct {
Options map[string]bool `json:"options,omitempty" yaml:"options,omitempty"` Options map[string]bool `json:"options,omitempty" yaml:"options,omitempty"`
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
func (p *plugin) Config( func (p *plugin) Config(
h *resmap.PluginHelpers, c []byte) error { h *resmap.PluginHelpers, c []byte) error {

View File

@@ -20,8 +20,7 @@ type plugin struct {
FieldSpecs types.FsSlice `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"` FieldSpecs types.FsSlice `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
// TODO: Make this gvk skip list part of the config. // TODO: Make this gvk skip list part of the config.
var prefixFieldSpecsToSkip = types.FsSlice{ var prefixFieldSpecsToSkip = types.FsSlice{

View File

@@ -20,8 +20,7 @@ type plugin struct {
Replacements []types.Replacement `json:"omitempty" yaml:"omitempty"` Replacements []types.Replacement `json:"omitempty" yaml:"omitempty"`
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
func (p *plugin) Config( func (p *plugin) Config(
h *resmap.PluginHelpers, c []byte) (err error) { h *resmap.PluginHelpers, c []byte) (err error) {

View File

@@ -21,8 +21,7 @@ type plugin struct {
FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"` FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
func (p *plugin) Config( func (p *plugin) Config(
_ *resmap.PluginHelpers, c []byte) (err error) { _ *resmap.PluginHelpers, c []byte) (err error) {

View File

@@ -17,8 +17,7 @@ type plugin struct {
types.SecretArgs types.SecretArgs
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
func (p *plugin) Config(h *resmap.PluginHelpers, config []byte) (err error) { func (p *plugin) Config(h *resmap.PluginHelpers, config []byte) (err error) {
p.SecretArgs = types.SecretArgs{} p.SecretArgs = types.SecretArgs{}

View File

@@ -20,8 +20,7 @@ type plugin struct {
FieldSpecs types.FsSlice `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"` FieldSpecs types.FsSlice `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
// TODO: Make this gvk skip list part of the config. // TODO: Make this gvk skip list part of the config.
var suffixFieldSpecsToSkip = types.FsSlice{ var suffixFieldSpecsToSkip = types.FsSlice{

View File

@@ -49,8 +49,7 @@ type Target struct {
FilePathPosition int `json:"filePathPosition,omitempty" yaml:"filePathPosition,omitempty"` FilePathPosition int `json:"filePathPosition,omitempty" yaml:"filePathPosition,omitempty"`
} }
//noinspection GoUnusedGlobalVariable var KustomizePlugin plugin //nolint:gochecknoglobals
var KustomizePlugin plugin
func (p *plugin) Config(h *resmap.PluginHelpers, c []byte) error { func (p *plugin) Config(h *resmap.PluginHelpers, c []byte) error {
err := yaml.Unmarshal(c, p) err := yaml.Unmarshal(c, p)

View File

@@ -22,9 +22,7 @@ type plugin struct {
Count int `json:"count,omitempty" yaml:"count,omitempty"` Count int `json:"count,omitempty" yaml:"count,omitempty"`
} }
//nolint: golint var KustomizePlugin plugin //nolint:gochecknoglobals
//noinspection GoUnusedGlobalVariable
var KustomizePlugin plugin
func (p *plugin) Config(_ *resmap.PluginHelpers, c []byte) error { func (p *plugin) Config(_ *resmap.PluginHelpers, c []byte) error {
return yaml.Unmarshal(c, p) return yaml.Unmarshal(c, p)

View File

@@ -21,9 +21,7 @@ type plugin struct {
t resmap.Transformer t resmap.Transformer
} }
//nolint: golint var KustomizePlugin plugin //nolint:gochecknoglobals
//noinspection GoUnusedGlobalVariable
var KustomizePlugin plugin
func (p *plugin) makePrefixPluginConfig() ([]byte, error) { func (p *plugin) makePrefixPluginConfig() ([]byte, error) {
var s struct { var s struct {
@@ -55,7 +53,9 @@ func (p *plugin) Config(h *resmap.PluginHelpers, _ []byte) error {
} }
// Returns a constant, rather than // Returns a constant, rather than
// time.Now().Format("2006-01-02") //
// time.Now().Format("2006-01-02")
//
// to make tests happy. // to make tests happy.
// This is just an example. // This is just an example.
func getDate() string { func getDate() string {

View File

@@ -19,9 +19,7 @@ type plugin struct {
Keys []string `json:"keys,omitempty" yaml:"keys,omitempty"` Keys []string `json:"keys,omitempty" yaml:"keys,omitempty"`
} }
//nolint: golint var KustomizePlugin plugin //nolint:gochecknoglobals
//noinspection GoUnusedGlobalVariable
var KustomizePlugin plugin
var database = map[string]string{ var database = map[string]string{
"TREE": "oak", "TREE": "oak",

View File

@@ -19,9 +19,7 @@ type plugin struct {
Port string `json:"port,omitempty" yaml:"port,omitempty"` Port string `json:"port,omitempty" yaml:"port,omitempty"`
} }
//nolint: golint var KustomizePlugin plugin //nolint:gochecknoglobals
//noinspection GoUnusedGlobalVariable
var KustomizePlugin plugin
const tmpl = ` const tmpl = `
apiVersion: v1 apiVersion: v1

View File

@@ -22,9 +22,7 @@ type plugin struct {
t resmap.Transformer t resmap.Transformer
} }
//nolint: golint var KustomizePlugin plugin //nolint:gochecknoglobals
//noinspection GoUnusedGlobalVariable
var KustomizePlugin plugin
func (p *plugin) makePrefixPluginConfig(n string) ([]byte, error) { func (p *plugin) makePrefixPluginConfig(n string) ([]byte, error) {
var s struct { var s struct {