mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 02:20:53 +00:00
Fix go lint error and add golint checks to a pre-commit hook
This commit is contained in:
@@ -67,7 +67,7 @@ type Kustomization struct {
|
||||
Vars []Var `json:"vars,omitempty" yaml:"vars,omitempty"`
|
||||
}
|
||||
|
||||
// ConfigMapArg contains the metadata of how to generate a configmap.
|
||||
// ConfigMapArgs contains the metadata of how to generate a configmap.
|
||||
type ConfigMapArgs struct {
|
||||
// Name of the configmap.
|
||||
// The full name should be Kustomization.NamePrefix + Configmap.Name +
|
||||
@@ -84,7 +84,7 @@ type ConfigMapArgs struct {
|
||||
DataSources `json:",inline,omitempty" yaml:",inline,omitempty"`
|
||||
}
|
||||
|
||||
// SecretGenerator contains the metadata of how to generate a secret.
|
||||
// SecretArgs contains the metadata of how to generate a secret.
|
||||
type SecretArgs struct {
|
||||
// Name of the secret.
|
||||
// The full name should be Kustomization.NamePrefix + SecretGenerator.Name +
|
||||
|
||||
@@ -40,6 +40,7 @@ type Var struct {
|
||||
FieldRef corev1.ObjectFieldSelector `json:"fieldref,omitempty" yaml:"objref,omitempty"`
|
||||
}
|
||||
|
||||
// Defaulting sets reference to field used by default.
|
||||
func (v *Var) Defaulting() {
|
||||
if (corev1.ObjectFieldSelector{}) == v.FieldRef {
|
||||
v.FieldRef = corev1.ObjectFieldSelector{FieldPath: "metadata.name"}
|
||||
|
||||
Reference in New Issue
Block a user