aporeto-inc / trireme-lib

Simple, scalable and secure application segmentation
https://trireme.io
Apache License 2.0
300 stars 51 forks source link

Making Resync a blocked operation for the PodMonitor #946

Closed mheese closed 4 years ago

mheese commented 4 years ago

This will make Resync() a blocked operation for the PodMonitor as discussed with @sibicramesh earlier today. It also calls Resync during Run() so that it is guaranteed to have run and reconciled every pod once first before returning.

This is required for the 3.13 enforcer which removes stale PUs on startup and would otherwise potentially delete and create them again on a restart.

aporeto-bot commented 4 years ago

/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0

[
  {
    "project": "wait-for-pods",
    "component": "enforcerd",
    "pr-id": "1545",
    "commit-sha": "0da65d24293ad2778aed1618679674aa05b95518",
    "pipeline": "master"
  },
  {
    "project": "wait-for-pods",
    "component": "trireme-lib",
    "pr-id": "946",
    "commit-sha": "cde245253ff13e6825de7cdda4ba313981257630",
    "pipeline": "master"
  }
]
codecov[bot] commented 4 years ago

Codecov Report

Merging #946 into release-3.13.0 will increase coverage by 0.11%. The diff coverage is 74.19%.

Impacted file tree graph

@@                Coverage Diff                 @@
##           release-3.13.0     #946      +/-   ##
==================================================
+ Coverage           56.45%   56.56%   +0.11%     
==================================================
  Files                 111      111              
  Lines               11179    11236      +57     
==================================================
+ Hits                 6311     6356      +45     
- Misses               4265     4275      +10     
- Partials              603      605       +2
Impacted Files Coverage Δ
monitor/internal/pod/monitor.go 0% <0%> (ø) :arrow_up:
monitor/internal/pod/controller.go 72.88% <66.66%> (+0.2%) :arrow_up:
monitor/internal/pod/resync.go 84.12% <84%> (-1.59%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 953f54d...cb60eab. Read the comment docs.

mheese commented 4 years ago

/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0

[
  {
    "project": "wait-for-pods",
    "component": "enforcerd",
    "pr-id": "1545",
    "commit-sha": "0da65d24293ad2778aed1618679674aa05b95518",
    "pipeline": "release-3.13.0"
  },
  {
    "project": "wait-for-pods",
    "component": "trireme-lib",
    "pr-id": "946",
    "commit-sha": "cde245253ff13e6825de7cdda4ba313981257630",
    "pipeline": "release-3.13.0"
  }
]
mheese commented 4 years ago

/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0

[
  {
    "project": "wait-for-pods",
    "component": "enforcerd",
    "pr-id": "1545",
    "commit-sha": "0da65d24293ad2778aed1618679674aa05b95518",
    "pipeline": "release-3.13.0"
  },
  {
    "project": "wait-for-pods",
    "component": "trireme-lib",
    "pr-id": "946",
    "commit-sha": "cde245253ff13e6825de7cdda4ba313981257630",
    "pipeline": "release-3.13.0"
  }
]
mheese commented 4 years ago

/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0

[
  {
    "project": "wait-for-pods",
    "component": "enforcerd",
    "pr-id": "1545",
    "commit-sha": "0da65d24293ad2778aed1618679674aa05b95518",
    "pipeline": "release-3.13.0"
  },
  {
    "project": "wait-for-pods",
    "component": "trireme-lib",
    "pr-id": "946",
    "commit-sha": "cde245253ff13e6825de7cdda4ba313981257630",
    "pipeline": "release-3.13.0"
  }
]
mheese commented 4 years ago

/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0

[
  {
    "project": "wait-for-pods",
    "component": "trireme-lib",
    "pr-id": "946",
    "commit-sha": "cb60eabb6031819c1f635bed2c632535fc7d84df",
    "pipeline": "release-3.13.0"
  },
  {
    "project": "wait-for-pods",
    "component": "enforcerd",
    "pr-id": "1545",
    "commit-sha": "0da65d24293ad2778aed1618679674aa05b95518",
    "pipeline": "release-3.13.0"
  }
]