From f85d1741296813e70ddc57798431f80694060762 Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Fri, 18 Mar 2022 15:55:58 +0000 Subject: [PATCH] teach code generator about ugly fields Kubernetes-commit: 0710b6836c655f4a197cc0efbffc615b5d1d165e --- cmd/applyconfiguration-gen/generators/applyconfiguration.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/applyconfiguration-gen/generators/applyconfiguration.go b/cmd/applyconfiguration-gen/generators/applyconfiguration.go index ddd7c1fb..5ebadb47 100644 --- a/cmd/applyconfiguration-gen/generators/applyconfiguration.go +++ b/cmd/applyconfiguration-gen/generators/applyconfiguration.go @@ -18,6 +18,7 @@ package generators import ( "io" + "strings" "k8s.io/gengo/generator" "k8s.io/gengo/namer" @@ -131,6 +132,10 @@ func blocklisted(t *types.Type, member types.Member) bool { if objectMeta.Name == t.Name && member.Name == "SelfLink" { return true } + // Hide any fields which are en route to deletion. + if strings.HasPrefix(member.Name, "ZZZ_") { + return true + } return false }