acrlabs / simkube

Record-and-replay Kubernetes simulator based on KWOK
https://simkube.dev
MIT License
290 stars 13 forks source link

adding initial hooks implementation #112

Closed drmorr0 closed 5 months ago

drmorr0 commented 6 months ago

Description

Testing done

drmorr0 commented 6 months ago

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

subgraph test
  direction LR
  simkube/test-depl[<b>Deployment</b><br>test-depl]
%% DELETED OBJECTS START
%% DELETED OBJECTS END
end

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

%% STYLE DEFINITIONS START
  style simkube/sk-tracer-svc fill:#6ce
  style simkube/sk-tracer-depl fill:#cb4
  style simkube/sk-ctrl-depl fill:#cb4
  style simkube/test-depl fill:#cb4
%% STYLE DEFINITIONS END

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

Detailed Diff

#### simkube/sk-ctrl-depl: ChangedWithPodRecreate ``` root['metadata']['labels']['app.kubernetes.io/name']: not present --> "sk-ctrl" ``` ``` root['spec']['selector']['matchLabels']['app.kubernetes.io/name']: not present --> "sk-ctrl" ``` ``` root['spec']['template']['metadata']['labels']['app.kubernetes.io/name']: not present --> "sk-ctrl" ``` ``` root['spec']['template']['spec']['containers'][0]['args'][1]: "--driver-image" --> not present ``` ``` root['spec']['template']['spec']['containers'][0]['args'][2]: "PLACEHOLDER" --> not present ``` ``` root['metadata']['labels']['fireconfig.io/app']: "sk-ctrl" --> not present ``` ``` root['spec']['selector']['matchLabels']['fireconfig.io/app']: "sk-ctrl" --> not present ``` ``` root['spec']['template']['metadata']['labels']['fireconfig.io/app']: "sk-ctrl" --> not present ```
#### simkube/sk-tracer-depl: ChangedWithPodRecreate ``` root['metadata']['labels']['app.kubernetes.io/name']: not present --> "sk-tracer" ``` ``` root['spec']['selector']['matchLabels']['app.kubernetes.io/name']: not present --> "sk-tracer" ``` ``` root['spec']['template']['metadata']['labels']['app.kubernetes.io/name']: not present --> "sk-tracer" ``` ``` root['metadata']['labels']['fireconfig.io/app']: "sk-tracer" --> not present ``` ``` root['spec']['selector']['matchLabels']['fireconfig.io/app']: "sk-tracer" --> not present ``` ``` root['spec']['template']['metadata']['labels']['fireconfig.io/app']: "sk-tracer" --> not present ```
#### simkube/sk-tracer-svc: Changed ``` root['spec']['selector']['app.kubernetes.io/name']: not present --> "sk-tracer" ``` ``` root['spec']['selector']['fireconfig.io/app']: "sk-tracer" --> not present ```
#### simkube/test-depl: ChangedWithPodRecreate ``` root['metadata']['labels']['app.kubernetes.io/name']: not present --> "test" ``` ``` root['spec']['selector']['matchLabels']['app.kubernetes.io/name']: not present --> "test" ``` ``` root['spec']['template']['metadata']['labels']['app.kubernetes.io/name']: not present --> "test" ``` ``` root['metadata']['labels']['fireconfig.io/app']: "test" --> not present ``` ``` root['spec']['selector']['matchLabels']['fireconfig.io/app']: "test" --> not present ``` ``` root['spec']['template']['metadata']['labels']['fireconfig.io/app']: "test" --> not present ```
codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 64.15094% with 38 lines in your changes missing coverage. Please review.

Project coverage is 72.71%. Comparing base (f17d4cb) to head (4f3cbd4).

Files Patch % Lines
cli/run.rs 0.00% 15 Missing :warning:
ctrl/cert_manager.rs 0.00% 8 Missing :warning:
lib/sim/hooks.rs 79.41% 7 Missing :warning:
ctrl/objects.rs 80.95% 4 Missing :warning:
ctrl/controller.rs 88.88% 2 Missing :warning:
lib/sim/mod.rs 80.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #112 +/- ## ========================================== - Coverage 72.96% 72.71% -0.25% ========================================== Files 37 39 +2 Lines 2049 2111 +62 ========================================== + Hits 1495 1535 +40 - Misses 554 576 +22 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.