Skip to content

Commit

Permalink
pr review
Browse files Browse the repository at this point in the history
Signed-off-by: odubajDT <[email protected]>
  • Loading branch information
odubajDT committed Jan 17, 2023
1 parent 5f63537 commit 5d54616
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 1 addition & 3 deletions operator/controllers/common/helperfunctions.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ func setAnnotations(reconcileObject client.Object, phase apicommon.KeptnPhaseTyp
}

annotationsObject := reconcileObject.GetAnnotations()
if val, ok := annotationsObject["traceparent"]; ok {
annotations["traceparent"] = val
}
annotations["traceparent"] = annotationsObject["traceparent"]

return annotations
}
13 changes: 10 additions & 3 deletions operator/controllers/common/helperfunctions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@ func Test_setAnnotations(t *testing.T) {
},
},
want: map[string]string{
"namespace": "namespace",
"name": "def",
"phase": "AppDeploy",
"namespace": "namespace",
"name": "def",
"phase": "AppDeploy",
"traceparent": "",
},
},
{
Expand Down Expand Up @@ -262,6 +263,7 @@ func Test_setAnnotations(t *testing.T) {
"appName": "app",
"appVersion": "1.0.0",
"appRevision": "1",
"traceparent": "",
},
},
{
Expand All @@ -285,6 +287,7 @@ func Test_setAnnotations(t *testing.T) {
"appName": "app",
"appVersion": "1.0.0",
"appVersionName": "appVersion",
"traceparent": "",
},
},
{
Expand All @@ -306,6 +309,7 @@ func Test_setAnnotations(t *testing.T) {
"appName": "app",
"workloadVersion": "1.0.0",
"workloadName": "workload",
"traceparent": "",
},
},
{
Expand All @@ -331,6 +335,7 @@ func Test_setAnnotations(t *testing.T) {
"workloadVersion": "1.0.0",
"workloadName": "workload",
"workloadInstanceName": "workloadInstance",
"traceparent": "",
},
},
{
Expand Down Expand Up @@ -358,6 +363,7 @@ func Test_setAnnotations(t *testing.T) {
"workloadVersion": "2.0.0",
"taskDefinitionName": "def",
"taskName": "task",
"traceparent": "",
},
},
{
Expand Down Expand Up @@ -385,6 +391,7 @@ func Test_setAnnotations(t *testing.T) {
"workloadVersion": "2.0.0",
"evaluationDefinitionName": "def",
"evaluationName": "eval",
"traceparent": "",
},
},
}
Expand Down

0 comments on commit 5d54616

Please sign in to comment.