mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Drop regeneration directives from copied code.
This commit is contained in:
@@ -57,7 +57,6 @@ var (
|
||||
|
||||
// int64Amount represents a fixed precision numerator and arbitrary scale exponent. It is faster
|
||||
// than operations on inf.Dec for values that can be represented as int64.
|
||||
// +k8s:openapi-gen=true
|
||||
type int64Amount struct {
|
||||
value int64
|
||||
scale Scale
|
||||
|
||||
@@ -86,8 +86,6 @@ import (
|
||||
// +protobuf.embed=string
|
||||
// +protobuf.options.marshal=false
|
||||
// +protobuf.options.(gogoproto.goproto_stringer)=false
|
||||
// +k8s:deepcopy-gen=true
|
||||
// +k8s:openapi-gen=true
|
||||
type Quantity struct {
|
||||
// i is the quantity in int64 scaled form, if d.Dec == nil
|
||||
i int64Amount
|
||||
|
||||
@@ -92,10 +92,11 @@ func (c Copier) CopyFile(dir, name string) error {
|
||||
for scanner.Scan() {
|
||||
l := scanner.Text()
|
||||
// Disallow recursive generation.
|
||||
if strings.HasPrefix(l, "//go:generate") {
|
||||
if strings.HasPrefix(l, "//go:generate") ||
|
||||
strings.HasPrefix(l, "// +k8s:") {
|
||||
continue
|
||||
}
|
||||
// Don't want it to appear double generated.
|
||||
// When copying generated code, drop the old 'generated' message.
|
||||
if strings.HasPrefix(l, "// Code generated") {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user