Skip to content

feat: fail on invalid annotations or labels#614

Merged
drey merged 5 commits into
2from
feat/drop-invalid-annotations
May 13, 2026
Merged

feat: fail on invalid annotations or labels#614
drey merged 5 commits into
2from
feat/drop-invalid-annotations

Conversation

@drey
Copy link
Copy Markdown
Contributor

@drey drey commented May 7, 2026

No description provided.

Signed-off-by: Ilya Drey <ilya.drey@flant.com>
@drey drey force-pushed the feat/drop-invalid-annotations branch from 30bec30 to 4525d31 Compare May 7, 2026 14:26
Signed-off-by: Ilya Drey <ilya.drey@flant.com>

Signed-off-by: Ilya Drey <ilya.drey@flant.com>
@drey drey force-pushed the feat/drop-invalid-annotations branch from ae34a06 to 353303a Compare May 7, 2026 14:50
Signed-off-by: Ilya Drey <ilya.drey@flant.com>
@drey drey requested a review from ilya-lesikov May 12, 2026 14:17
Comment thread pkg/resource/spec/resource_spec.go Outdated
return NewResourceSpec(obj.(*unstructured.Unstructured), releaseNamespace, opts), nil
unstruct := obj.(*unstructured.Unstructured)

if !opts.DropInvalidAnnotationsAndLabels {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: if opts.DropInvalidAnnotationsAndLabels would be easier to understand, otherwise the else clause is effectively a double negation

Comment thread pkg/resource/spec/util.go Outdated
func stripInvalidEntries(filePath string, obj map[string]interface{}, fields ...string) map[string]string {
result := make(map[string]string)

ctx := logboek.NewContext(context.Background(), logboek.DefaultLogger())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just pass ctx everywhere, it's fine, we'll need it sooner or later anyways

drey and others added 2 commits May 13, 2026 16:12
Signed-off-by: Ilya Drey <ilya.drey@flant.com>
Signed-off-by: Ilya Drey <ilya.drey@flant.com>
@drey drey force-pushed the feat/drop-invalid-annotations branch from c13fd59 to 61ac280 Compare May 13, 2026 13:29
@drey drey merged commit a8c983f into 2 May 13, 2026
8 checks passed
@drey drey deleted the feat/drop-invalid-annotations branch May 13, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants