Skip to content

fix: allow multiple podSpecTemplatePaths to be specified#185

Merged
drmorr0 merged 1 commit intomasterfrom
drmorr/sk-23-specify-a-list-of-pod-template-specs-in-tracer-config
Apr 27, 2025
Merged

fix: allow multiple podSpecTemplatePaths to be specified#185
drmorr0 merged 1 commit intomasterfrom
drmorr/sk-23-specify-a-list-of-pod-template-specs-in-tracer-config

Conversation

@drmorr0
Copy link
Contributor

@drmorr0 drmorr0 commented Apr 26, 2025

  • I certify that this PR does not contain any code that has been generated with GitHub Copilot or any other AI-based code generation tool, in accordance with this project's policies.

Description

Some custom resources let you specify multiple podSpecTemplates that aren't necessarily in an "array" format; so this lets you just define multiple podSpecTemplatePaths as a list in the tracer config.

The old field is officially deprecated, but we can't just delete it because it will break parsing of old trace files, and I don't really want to release SKv3 over this change, so we just do a fairly straightforward migration when we load the config.

Testing done

  • make test; add new tests for the deprecated fields
  • test that skctl xray still reads old trace files (with a warning)

Additional info

Also updated docs and example trace files

@drmorr0
Copy link
Contributor Author

drmorr0 commented Apr 26, 2025

Kubernetes Object DAG

%%{init: {'themeVariables': {'mainBkg': '#ddd'}}}%%
graph LR

classDef default color:#000
subgraph global
  direction LR
  global/simkube[<b>Namespace</b><br>simkube]
%% DELETED OBJECTS START
%% DELETED OBJECTS END
end

subgraph sk-tracer
  direction LR
  simkube/sk-tracer-svc[<b>Service</b><br>sk-tracer-svc]
  simkube/sk-tracer-depl[<b>Deployment</b><br>sk-tracer-depl]
  simkube/sk-tracer-sa[<b>ServiceAccount</b><br>sk-tracer-sa]
  sk-tracer/sk-tracer-crb[<b>ClusterRoleBinding</b><br>sk-tracer-crb]
  simkube/sk-tracer-tracer-config[<b>ConfigMap</b><br>sk-tracer-tracer-config]
  simkube/sk-tracer-sa--->simkube/sk-tracer-depl
  sk-tracer/sk-tracer-crb--->simkube/sk-tracer-depl
  simkube/sk-tracer-tracer-config--->simkube/sk-tracer-depl
%% DELETED OBJECTS START
%% DELETED OBJECTS END
end

subgraph sk-ctrl
  direction LR
  simkube/sk-ctrl-depl[<b>Deployment</b><br>sk-ctrl-depl]
  simkube/sk-ctrl-sa[<b>ServiceAccount</b><br>sk-ctrl-sa]
  sk-ctrl/sk-ctrl-crb[<b>ClusterRoleBinding</b><br>sk-ctrl-crb]
  simkube/sk-ctrl-sa--->simkube/sk-ctrl-depl
  sk-ctrl/sk-ctrl-crb--->simkube/sk-ctrl-depl
%% DELETED OBJECTS START
%% DELETED OBJECTS END
end

global--->sk-tracer
global--->sk-ctrl

%% STYLE DEFINITIONS START
  style simkube/sk-tracer-tracer-config fill:#6ce
%% STYLE DEFINITIONS END
Loading

New object
Deleted object
Updated object
Updated object (causes pod recreation)

Detailed Diff

simkube/sk-tracer-tracer-config: Changed

root['data']['tracer-config.yml']:
"---\ntrackedObjects:\n  apps/v1.Deployment:\n    podSpecTemplatePath: /spec/template\n  apps/v1.StatefulSet:\n    podSpecTemplatePath: /spec/template\n  batch/v1.CronJob:\n    podSpecTemplatePath: /spec/jobTemplate/spec/template\n    trackLifecycle: true\n" --> "---\ntrackedObjects:\n  apps/v1.Deployment:\n    podSpecTemplatePaths:\n      - /spec/template\n  apps/v1.StatefulSet:\n    podSpecTemplatePaths:\n      - /spec/template\n  batch/v1.CronJob:\n    podSpecTemplatePaths:\n      - /spec/jobTemplate/spec/template\n    trackLifecycle: true\n"

@codecov
Copy link

codecov bot commented Apr 26, 2025

Codecov Report

Attention: Patch coverage is 72.97297% with 20 lines in your changes missing coverage. Please review.

Project coverage is 70.38%. Comparing base (7519226) to head (5ecf76d).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
sk-core/src/logging.rs 0.00% 8 Missing ⚠️
sk-store/src/config.rs 70.83% 5 Missing and 2 partials ⚠️
sk-driver/src/runner.rs 82.35% 2 Missing and 1 partial ⚠️
sk-cli/src/main.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #185      +/-   ##
==========================================
- Coverage   70.49%   70.38%   -0.11%     
==========================================
  Files          57       57              
  Lines        3274     3313      +39     
  Branches     3274     3313      +39     
==========================================
+ Hits         2308     2332      +24     
- Misses        794      810      +16     
+ Partials      172      171       -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@drmorr0 drmorr0 force-pushed the drmorr/sk-23-specify-a-list-of-pod-template-specs-in-tracer-config branch from 88230ed to 867b102 Compare April 27, 2025 04:30
@drmorr0 drmorr0 force-pushed the drmorr/sk-23-specify-a-list-of-pod-template-specs-in-tracer-config branch from 867b102 to 5ecf76d Compare April 27, 2025 06:06
@drmorr0 drmorr0 merged commit 3b01023 into master Apr 27, 2025
9 checks passed
@drmorr0 drmorr0 deleted the drmorr/sk-23-specify-a-list-of-pod-template-specs-in-tracer-config branch April 27, 2025 06:11
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.

1 participant

Comments