mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 02:20:53 +00:00
Introduce dummy program to help with API releases.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// See /plugin/doc.go for an explanation.
|
||||
// A code generator. See /plugin/doc.go for an explanation.
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
|
||||
"sigs.k8s.io/kustomize/v3/pkg/pgmconfig"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/plugins"
|
||||
"sigs.k8s.io/kustomize/v3/provenance"
|
||||
)
|
||||
|
||||
//go:generate stringer -type=pluginType
|
||||
@@ -43,6 +44,10 @@ func main() {
|
||||
fmt.Sprintf(
|
||||
"// Code generated by pluginator on %s; DO NOT EDIT.",
|
||||
root))
|
||||
w.write(
|
||||
fmt.Sprintf(
|
||||
"// pluginator %+v\n", provenance.GetProvenance()))
|
||||
w.write("\n")
|
||||
w.write("package " + plugins.BuiltinPluginPackage)
|
||||
|
||||
pType := unknown
|
||||
@@ -83,6 +88,7 @@ func main() {
|
||||
func inputFileRoot() string {
|
||||
n := os.Getenv("GOFILE")
|
||||
if !strings.HasSuffix(n, ".go") {
|
||||
log.Printf("%+v\n", provenance.GetProvenance())
|
||||
log.Fatalf("expecting .go suffix on %s", n)
|
||||
}
|
||||
return n[:len(n)-len(".go")]
|
||||
|
||||
Reference in New Issue
Block a user