Remove opsys comment from generated code.

This commit is contained in:
jregan
2019-11-11 08:32:35 -08:00
parent 519dacc10f
commit 382981fb43
23 changed files with 351 additions and 129 deletions

View File

@@ -1,7 +1,5 @@
// Code generated by pluginator on AnnotationsTransformer; DO NOT EDIT.
// pluginator {Version:unknown GitCommit:$Format:%H$ BuildDate:1970-01-01T00:00:00Z GoOs:linux GoArch:amd64}
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
@@ -18,7 +16,6 @@ type AnnotationsTransformerPlugin struct {
FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
}
func (p *AnnotationsTransformerPlugin) Config(
h *resmap.PluginHelpers, c []byte) (err error) {
p.Annotations = nil
@@ -38,5 +35,5 @@ func (p *AnnotationsTransformerPlugin) Transform(m resmap.ResMap) error {
}
func NewAnnotationsTransformerPlugin() resmap.TransformerPlugin {
return &AnnotationsTransformerPlugin{}
return &AnnotationsTransformerPlugin{}
}

View File

@@ -1,7 +1,5 @@
// Code generated by pluginator on ConfigMapGenerator; DO NOT EDIT.
// pluginator {Version:unknown GitCommit:$Format:%H$ BuildDate:1970-01-01T00:00:00Z GoOs:linux GoArch:amd64}
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
@@ -19,7 +17,6 @@ type ConfigMapGeneratorPlugin struct {
types.ConfigMapArgs
}
func (p *ConfigMapGeneratorPlugin) Config(
h *resmap.PluginHelpers, config []byte) (err error) {
p.GeneratorOptions = types.GeneratorOptions{}
@@ -42,5 +39,5 @@ func (p *ConfigMapGeneratorPlugin) Generate() (resmap.ResMap, error) {
}
func NewConfigMapGeneratorPlugin() resmap.GeneratorPlugin {
return &ConfigMapGeneratorPlugin{}
return &ConfigMapGeneratorPlugin{}
}

View File

@@ -1,7 +1,5 @@
// Code generated by pluginator on HashTransformer; DO NOT EDIT.
// pluginator {Version:unknown GitCommit:$Format:%H$ BuildDate:1970-01-01T00:00:00Z GoOs:linux GoArch:amd64}
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
@@ -16,7 +14,6 @@ type HashTransformerPlugin struct {
hasher ifc.KunstructuredHasher
}
func (p *HashTransformerPlugin) Config(
h *resmap.PluginHelpers, config []byte) (err error) {
p.hasher = h.ResmapFactory().RF().Hasher()
@@ -38,5 +35,5 @@ func (p *HashTransformerPlugin) Transform(m resmap.ResMap) error {
}
func NewHashTransformerPlugin() resmap.TransformerPlugin {
return &HashTransformerPlugin{}
return &HashTransformerPlugin{}
}

View File

@@ -1,7 +1,5 @@
// Code generated by pluginator on ImageTagTransformer; DO NOT EDIT.
// pluginator {Version:unknown GitCommit:$Format:%H$ BuildDate:1970-01-01T00:00:00Z GoOs:linux GoArch:amd64}
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
@@ -24,7 +22,6 @@ type ImageTagTransformerPlugin struct {
FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
}
func (p *ImageTagTransformerPlugin) Config(
h *resmap.PluginHelpers, c []byte) (err error) {
p.ImageTag = types.Image{}
@@ -184,5 +181,5 @@ func split(imageName string) (name string, tag string) {
}
func NewImageTagTransformerPlugin() resmap.TransformerPlugin {
return &ImageTagTransformerPlugin{}
return &ImageTagTransformerPlugin{}
}

View File

@@ -1,7 +1,5 @@
// Code generated by pluginator on InventoryTransformer; DO NOT EDIT.
// pluginator {Version:unknown GitCommit:$Format:%H$ BuildDate:1970-01-01T00:00:00Z GoOs:linux GoArch:amd64}
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
@@ -24,7 +22,6 @@ type InventoryTransformerPlugin struct {
Policy string `json:"policy,omitempty" yaml:"policy,omitempty"`
}
func (p *InventoryTransformerPlugin) Config(
h *resmap.PluginHelpers, c []byte) (err error) {
p.h = h
@@ -127,5 +124,5 @@ func computeRefs(
}
func NewInventoryTransformerPlugin() resmap.TransformerPlugin {
return &InventoryTransformerPlugin{}
return &InventoryTransformerPlugin{}
}

View File

@@ -1,7 +1,5 @@
// Code generated by pluginator on LabelTransformer; DO NOT EDIT.
// pluginator {Version:unknown GitCommit:$Format:%H$ BuildDate:1970-01-01T00:00:00Z GoOs:linux GoArch:amd64}
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
@@ -18,7 +16,6 @@ type LabelTransformerPlugin struct {
FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
}
func (p *LabelTransformerPlugin) Config(
h *resmap.PluginHelpers, c []byte) (err error) {
p.Labels = nil
@@ -38,5 +35,5 @@ func (p *LabelTransformerPlugin) Transform(m resmap.ResMap) error {
}
func NewLabelTransformerPlugin() resmap.TransformerPlugin {
return &LabelTransformerPlugin{}
return &LabelTransformerPlugin{}
}

View File

@@ -1,7 +1,5 @@
// Code generated by pluginator on LegacyOrderTransformer; DO NOT EDIT.
// pluginator {Version:unknown GitCommit:$Format:%H$ BuildDate:1970-01-01T00:00:00Z GoOs:linux GoArch:amd64}
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
@@ -20,7 +18,6 @@ import (
// (like ValidatingWebhookConfiguration) last.
type LegacyOrderTransformerPlugin struct{}
// Nothing needed for configuration.
func (p *LegacyOrderTransformerPlugin) Config(
h *resmap.PluginHelpers, c []byte) (err error) {
@@ -45,5 +42,5 @@ func (p *LegacyOrderTransformerPlugin) Transform(m resmap.ResMap) (err error) {
}
func NewLegacyOrderTransformerPlugin() resmap.TransformerPlugin {
return &LegacyOrderTransformerPlugin{}
return &LegacyOrderTransformerPlugin{}
}

View File

@@ -1,7 +1,5 @@
// Code generated by pluginator on NamespaceTransformer; DO NOT EDIT.
// pluginator {Version:unknown GitCommit:$Format:%H$ BuildDate:1970-01-01T00:00:00Z GoOs:linux GoArch:amd64}
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
@@ -23,7 +21,6 @@ type NamespaceTransformerPlugin struct {
FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
}
func (p *NamespaceTransformerPlugin) Config(
h *resmap.PluginHelpers, c []byte) (err error) {
p.Namespace = ""
@@ -130,5 +127,5 @@ func (p *NamespaceTransformerPlugin) changeNamespace(
}
func NewNamespaceTransformerPlugin() resmap.TransformerPlugin {
return &NamespaceTransformerPlugin{}
return &NamespaceTransformerPlugin{}
}

View File

@@ -1,14 +1,12 @@
// Code generated by pluginator on PatchJson6902Transformer; DO NOT EDIT.
// pluginator {Version:unknown GitCommit:$Format:%H$ BuildDate:1970-01-01T00:00:00Z GoOs:linux GoArch:amd64}
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
import (
"fmt"
"github.com/evanphx/json-patch"
jsonpatch "github.com/evanphx/json-patch"
"github.com/pkg/errors"
"sigs.k8s.io/kustomize/api/ifc"
"sigs.k8s.io/kustomize/api/resid"
@@ -25,7 +23,6 @@ type PatchJson6902TransformerPlugin struct {
JsonOp string `json:"jsonOp,omitempty" yaml:"jsonOp,omitempty"`
}
func (p *PatchJson6902TransformerPlugin) Config(
h *resmap.PluginHelpers, c []byte) (err error) {
p.ldr = h.Loader()
@@ -99,5 +96,5 @@ func (p *PatchJson6902TransformerPlugin) Transform(m resmap.ResMap) error {
}
func NewPatchJson6902TransformerPlugin() resmap.TransformerPlugin {
return &PatchJson6902TransformerPlugin{}
return &PatchJson6902TransformerPlugin{}
}

View File

@@ -1,7 +1,5 @@
// Code generated by pluginator on PatchStrategicMergeTransformer; DO NOT EDIT.
// pluginator {Version:unknown GitCommit:$Format:%H$ BuildDate:1970-01-01T00:00:00Z GoOs:linux GoArch:amd64}
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
@@ -21,7 +19,6 @@ type PatchStrategicMergeTransformerPlugin struct {
Patches string `json:"patches,omitempty" yaml:"patches,omitempty"`
}
func (p *PatchStrategicMergeTransformerPlugin) Config(
h *resmap.PluginHelpers, c []byte) (err error) {
p.h = h
@@ -89,5 +86,5 @@ func (p *PatchStrategicMergeTransformerPlugin) Transform(m resmap.ResMap) error
}
func NewPatchStrategicMergeTransformerPlugin() resmap.TransformerPlugin {
return &PatchStrategicMergeTransformerPlugin{}
return &PatchStrategicMergeTransformerPlugin{}
}

View File

@@ -1,14 +1,12 @@
// Code generated by pluginator on PatchTransformer; DO NOT EDIT.
// pluginator {Version:unknown GitCommit:$Format:%H$ BuildDate:1970-01-01T00:00:00Z GoOs:linux GoArch:amd64}
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
import (
"fmt"
"github.com/evanphx/json-patch"
jsonpatch "github.com/evanphx/json-patch"
"github.com/pkg/errors"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/resource"
@@ -24,7 +22,6 @@ type PatchTransformerPlugin struct {
Target *types.Selector `json:"target,omitempty" yaml:"target,omitempty"`
}
func (p *PatchTransformerPlugin) Config(
h *resmap.PluginHelpers, c []byte) (err error) {
err = yaml.Unmarshal(c, p)
@@ -144,5 +141,5 @@ func jsonPatchFromBytes(
}
func NewPatchTransformerPlugin() resmap.TransformerPlugin {
return &PatchTransformerPlugin{}
return &PatchTransformerPlugin{}
}

View File

@@ -1,7 +1,5 @@
// Code generated by pluginator on PrefixSuffixTransformer; DO NOT EDIT.
// pluginator {Version:unknown GitCommit:$Format:%H$ BuildDate:1970-01-01T00:00:00Z GoOs:linux GoArch:amd64}
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
@@ -24,7 +22,6 @@ type PrefixSuffixTransformerPlugin struct {
FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
}
// Not placed in a file yet due to lack of demand.
var prefixSuffixFieldSpecsToSkip = []types.FieldSpec{
{
@@ -122,5 +119,5 @@ func (p *PrefixSuffixTransformerPlugin) addPrefixSuffix(
}
func NewPrefixSuffixTransformerPlugin() resmap.TransformerPlugin {
return &PrefixSuffixTransformerPlugin{}
return &PrefixSuffixTransformerPlugin{}
}

View File

@@ -1,7 +1,5 @@
// Code generated by pluginator on ReplicaCountTransformer; DO NOT EDIT.
// pluginator {Version:unknown GitCommit:$Format:%H$ BuildDate:1970-01-01T00:00:00Z GoOs:linux GoArch:amd64}
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
@@ -23,7 +21,6 @@ type ReplicaCountTransformerPlugin struct {
FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
}
func (p *ReplicaCountTransformerPlugin) Config(
h *resmap.PluginHelpers, c []byte) (err error) {
@@ -88,5 +85,5 @@ func (p *ReplicaCountTransformerPlugin) addReplicas(in interface{}) (interface{}
}
func NewReplicaCountTransformerPlugin() resmap.TransformerPlugin {
return &ReplicaCountTransformerPlugin{}
return &ReplicaCountTransformerPlugin{}
}

View File

@@ -1,7 +1,5 @@
// Code generated by pluginator on SecretGenerator; DO NOT EDIT.
// pluginator {Version:unknown GitCommit:$Format:%H$ BuildDate:1970-01-01T00:00:00Z GoOs:linux GoArch:amd64}
// pluginator {unknown 1970-01-01T00:00:00Z }
package builtins
@@ -19,7 +17,6 @@ type SecretGeneratorPlugin struct {
types.SecretArgs
}
func (p *SecretGeneratorPlugin) Config(h *resmap.PluginHelpers, config []byte) (err error) {
p.GeneratorOptions = types.GeneratorOptions{}
p.SecretArgs = types.SecretArgs{}
@@ -41,5 +38,5 @@ func (p *SecretGeneratorPlugin) Generate() (resmap.ResMap, error) {
}
func NewSecretGeneratorPlugin() resmap.GeneratorPlugin {
return &SecretGeneratorPlugin{}
return &SecretGeneratorPlugin{}
}

View File

@@ -6,8 +6,6 @@ package main
import (
"fmt"
"os"
"sigs.k8s.io/kustomize/api/provenance"
)
@@ -17,5 +15,5 @@ func main() {
This 'main' exists only to make goreleaser create release notes for the API.
See https://github.com/goreleaser/goreleaser/issues/981
and https://github.com/kubernetes-sigs/kustomize/tree/master/releasing`)
provenance.GetProvenance().Print(os.Stdout, false)
fmt.Println(provenance.GetProvenance())
}

View File

@@ -5,7 +5,6 @@ package provenance
import (
"fmt"
"io"
"runtime"
)
@@ -22,15 +21,15 @@ var (
// Provenance holds information about the build of an executable.
type Provenance struct {
// Version of the kustomize binary.
Version string `json:"version"`
Version string `json:"version,omitempty"`
// GitCommit is a git commit
GitCommit string `json:"gitCommit"`
GitCommit string `json:"gitCommit,omitempty"`
// BuildDate is date of the build.
BuildDate string `json:"buildDate"`
BuildDate string `json:"buildDate,omitempty"`
// GoOs holds OS name.
GoOs string `json:"goOs"`
GoOs string `json:"goOs,omitempty"`
// GoArch holds architecture name.
GoArch string `json:"goArch"`
GoArch string `json:"goArch,omitempty"`
}
// GetProvenance returns an instance of Provenance.
@@ -44,11 +43,17 @@ func GetProvenance() Provenance {
}
}
// Print prints provenance info.
func (v Provenance) Print(w io.Writer, short bool) {
if short {
fmt.Fprintf(w, "%s\n", v.Version)
} else {
fmt.Fprintf(w, "Version: %+v\n", v)
}
// Full returns the full provenance stamp.
func (v Provenance) Full() string {
return fmt.Sprintf("%+v", v)
}
// Short returns the shortened provenance stamp.
func (v Provenance) Short() string {
return fmt.Sprintf(
"%v",
Provenance{
Version: v.Version,
BuildDate: v.BuildDate,
})
}