Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extra quotes in tracing tags #172

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

adam-cattermole
Copy link
Member

@adam-cattermole adam-cattermole commented Feb 15, 2024

Tested with new image built from this (quay.io/acatterm/authorino-operator:fix-tracing-tags):

Authorino CR spec:

spec:
  clusterWide: true
  healthz: {}
  listener:
    ports: {}
    tls:
      enabled: false
  metrics: {}
  oidcServer:
    tls:
      enabled: false
  supersedingHostSubsets: true
  tracing:
    endpoint: rpc://jaeger-collector.istio-system.svc.cluster.local:4317
    insecure: true
    tags:
      random-key: random-value
      test-key: test-value
  volumes: {}

image

Resolves #171

@adam-cattermole adam-cattermole self-assigned this Feb 15, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b0796bc) 61.78% compared to head (638fbdc) 61.78%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #172   +/-   ##
=======================================
  Coverage   61.78%   61.78%           
=======================================
  Files           2        2           
  Lines         785      785           
=======================================
  Hits          485      485           
  Misses        249      249           
  Partials       51       51           
Flag Coverage Δ
unit 61.78% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -384,7 +384,7 @@ func (r *AuthorinoReconciler) buildAuthorinoArgs(authorino *api.Authorino) []str
if tracingServiceEndpoint := authorino.Spec.Tracing.Endpoint; tracingServiceEndpoint != "" {
args = append(args, fmt.Sprintf("--%s=%s", flagTracingServiceEndpoint, tracingServiceEndpoint))
for key, value := range authorino.Spec.Tracing.Tags {
args = append(args, fmt.Sprintf(`--%s="%s=%s"`, flagTracingServiceTag, key, value))
args = append(args, fmt.Sprintf(`--%s=%s=%s`, flagTracingServiceTag, key, value))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Have you tested with tag values containing white spaces?

spec:
  tracing:
    tags:
      tag-with-white-space: value with spaces

Maybe also a key containing white spaces:

spec:
  tracing:
    tags:
      "tag key with spaces": some-value

I wonder if it could break the deployment.

Copy link
Member Author

@adam-cattermole adam-cattermole Feb 15, 2024

Choose a reason for hiding this comment

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

Yep tested now:

tracing:
  endpoint: rpc://jaeger-collector.istio-system.svc.cluster.local:4317
  insecure: true
  tags:
    key with spaces: value with spaces
    test-key: test-value
spec:
  containers:
  - args:
    - --allow-superseding-host-subsets
    - --tracing-service-endpoint=rpc://jaeger-collector.istio-system.svc.cluster.local:4317
    - --tracing-service-insecure
    - --tracing-service-tag=key with spaces=value with spaces
    - --tracing-service-tag=test-key=test-value

image

@guicassolato
Copy link
Collaborator

I see no reason now for keeping the usage of trim functions in the tests:

kv := strings.Split(strings.TrimPrefix(strings.TrimSuffix(value, `"`), `"`), "=")

WDYT?

@adam-cattermole
Copy link
Member Author

Agreed, removed in commit 00db9df

Copy link
Collaborator

@guicassolato guicassolato left a comment

Choose a reason for hiding this comment

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

Thanks! 😍

@adam-cattermole adam-cattermole merged commit 03b4263 into Kuadrant:main Feb 15, 2024
8 checks passed
@adam-cattermole adam-cattermole deleted the fix-tracing-tags branch February 15, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Extra quotes in the custom tracing tags
3 participants