mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Add KustomizationDocument.Copy method
This commit is contained in:
@@ -167,7 +167,7 @@ func main() {
|
|||||||
it := idx.IterateQuery(query, 10000, 60*time.Second)
|
it := idx.IterateQuery(query, 10000, 60*time.Second)
|
||||||
for it.Next() {
|
for it.Next() {
|
||||||
for _, hit := range it.Value().Hits.Hits {
|
for _, hit := range it.Value().Hits.Hits {
|
||||||
seedDocs = append(seedDocs, hit.Document.Copy())
|
seedDocs = append(seedDocs, hit.Document.Document.Copy())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := it.Err(); err != nil {
|
if err := it.Err(); err != nil {
|
||||||
|
|||||||
@@ -46,6 +46,15 @@ type KustomizationDocument struct {
|
|||||||
|
|
||||||
type set map[string]struct{}
|
type set map[string]struct{}
|
||||||
|
|
||||||
|
func (doc *KustomizationDocument) Copy() *KustomizationDocument {
|
||||||
|
return &KustomizationDocument{
|
||||||
|
Document: *(doc.Document.Copy()),
|
||||||
|
Kinds: doc.Kinds,
|
||||||
|
Identifiers: doc.Identifiers,
|
||||||
|
Values: doc.Values,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (doc *KustomizationDocument) String() string {
|
func (doc *KustomizationDocument) String() string {
|
||||||
return fmt.Sprintf("%s %s %s %v %v %v len(identifiers):%v len(values):%v",
|
return fmt.Sprintf("%s %s %s %v %v %v len(identifiers):%v len(values):%v",
|
||||||
doc.RepositoryURL, doc.FilePath, doc.DefaultBranch, doc.CreationTime,
|
doc.RepositoryURL, doc.FilePath, doc.DefaultBranch, doc.CreationTime,
|
||||||
|
|||||||
Reference in New Issue
Block a user