File tree Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import (
11
11
func AddAnnotations (annotations map [string ]string ) ObjectTransform {
12
12
return func (ctx context.Context , o DeclarativeObject , manifest * manifest.Objects ) error {
13
13
log := log .Log
14
- // TODO: Add to selectors and labels in templates?
15
14
for _ , o := range manifest .Items {
16
15
log .WithValues ("object" , o ).WithValues ("annotations" , annotations ).V (1 ).Info ("add annotations to object" )
17
16
o .AddAnnotations (annotations )
Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ func Test_AddAnnotations(t *testing.T) {
286
286
apiVersion: apps/v1
287
287
kind: Deployment
288
288
metadata:
289
- labels :
289
+ annotations :
290
290
app: test-app
291
291
name: frontend
292
292
spec:
@@ -333,7 +333,7 @@ spec:
333
333
}
334
334
for _ , o := range objects .Items {
335
335
o .AddAnnotations (tt .inputAnnotations )
336
- if len (tt .expectedAnnotations ) != len (o .object .GetLabels ()) {
336
+ if len (tt .expectedAnnotations ) != len (o .object .GetAnnotations ()) {
337
337
t .Errorf ("Expected length of labels to be %v but is %v" , len (tt .expectedAnnotations ), len (o .object .GetAnnotations ()))
338
338
}
339
339
if diff := cmp .Diff (tt .expectedAnnotations , o .object .GetAnnotations ()); diff != "" {
You can’t perform that action at this time.
0 commit comments