Skip to content

Commit db4f5be

Browse files
Fix copy-paste stuff
Co-authored-by: Justin Santa Barbara <justinsb@google.com>
1 parent b76b810 commit db4f5be

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pkg/patterns/declarative/annotations.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
func AddAnnotations(annotations map[string]string) ObjectTransform {
1212
return func(ctx context.Context, o DeclarativeObject, manifest *manifest.Objects) error {
1313
log := log.Log
14-
// TODO: Add to selectors and labels in templates?
1514
for _, o := range manifest.Items {
1615
log.WithValues("object", o).WithValues("annotations", annotations).V(1).Info("add annotations to object")
1716
o.AddAnnotations(annotations)

pkg/patterns/declarative/pkg/manifest/objects_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ func Test_AddAnnotations(t *testing.T) {
286286
apiVersion: apps/v1
287287
kind: Deployment
288288
metadata:
289-
labels:
289+
annotations:
290290
app: test-app
291291
name: frontend
292292
spec:
@@ -333,7 +333,7 @@ spec:
333333
}
334334
for _, o := range objects.Items {
335335
o.AddAnnotations(tt.inputAnnotations)
336-
if len(tt.expectedAnnotations) != len(o.object.GetLabels()) {
336+
if len(tt.expectedAnnotations) != len(o.object.GetAnnotations()) {
337337
t.Errorf("Expected length of labels to be %v but is %v", len(tt.expectedAnnotations), len(o.object.GetAnnotations()))
338338
}
339339
if diff := cmp.Diff(tt.expectedAnnotations, o.object.GetAnnotations()); diff != "" {

0 commit comments

Comments
 (0)