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

feat(lifecycle-operator): introduce functions for SchedulingGates functionality #2140

Merged
merged 15 commits into from
Sep 26, 2023
Merged

feat(lifecycle-operator): introduce functions for SchedulingGates functionality #2140

merged 15 commits into from
Sep 26, 2023

Conversation

odubajDT
Copy link
Contributor

@odubajDT odubajDT commented Sep 20, 2023

Changes

  • introduce functions which support scheduling gates usage
  • unit tests
  • renamed KLT leftover constants

Follow-up

  • introduce integration tests
  • adapt helm charts

Part of #1458

Integration tests are green here #2149

Follow-up issue #2153

@netlify
Copy link

netlify bot commented Sep 20, 2023

Deploy Preview for keptn-lifecycle-toolkit ready!

Name Link
🔨 Latest commit 681fbc5
🔍 Latest deploy log https://app.netlify.com/sites/keptn-lifecycle-toolkit/deploys/650c104b9aac17000a53878c
😎 Deploy Preview https://deploy-preview-2140--keptn-lifecycle-toolkit.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@odubajDT odubajDT changed the title feat(lifecycle-operator): introduce function for ReadinessGates functionality feat(lifecycle-operator): introduce functions for ReadinessGates functionality Sep 21, 2023
@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Merging #2140 (783e182) into main (47b756c) will increase coverage by 0.07%.
Report is 11 commits behind head on main.
The diff coverage is 87.50%.

❗ Current head 783e182 differs from pull request most recent head c0670fd. Consider uploading reports for the commit c0670fd to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2140      +/-   ##
==========================================
+ Coverage   84.46%   84.54%   +0.07%     
==========================================
  Files         151      152       +1     
  Lines        9723     9804      +81     
==========================================
+ Hits         8213     8289      +76     
- Misses       1224     1229       +5     
  Partials      286      286              
Files Coverage Δ
...-operator/apis/lifecycle/v1alpha3/common/common.go 100.00% <100.00%> (ø)
...operator/apis/lifecycle/v1alpha3/keptnapp_types.go 93.33% <100.00%> (ø)
...tor/apis/lifecycle/v1alpha3/keptnworkload_types.go 93.93% <100.00%> (ø)
...rator/controllers/lifecycle/keptnapp/controller.go 63.15% <100.00%> (ø)
...ecycle/keptnappversion/reconcile_workloadsstate.go 93.75% <100.00%> (ø)
...lers/lifecycle/keptnworkloadinstance/controller.go 79.09% <100.00%> (+1.98%) ⬆️
...rator/webhooks/pod_mutator/pod_mutating_webhook.go 76.32% <100.00%> (+0.78%) ⬆️
...rator/controllers/common/schedulinggateshandler.go 81.03% <81.03%> (ø)

... and 6 files with indirect coverage changes

Flag Coverage Δ
certificate-operator 65.91% <ø> (ø)
component-tests 58.24% <0.00%> (-0.11%) ⬇️
lifecycle-operator 85.02% <87.50%> (+0.08%) ⬆️
metrics-operator 87.40% <ø> (ø)
scheduler 32.12% <ø> (ø)

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

…ionality

Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
@odubajDT odubajDT marked this pull request as ready for review September 21, 2023 09:57
@odubajDT odubajDT requested a review from a team as a code owner September 21, 2023 09:57
@odubajDT odubajDT changed the title feat(lifecycle-operator): introduce functions for ReadinessGates functionality feat(lifecycle-operator): introduce functions for SchedulingGates functionality Sep 21, 2023
@RealAnna
Copy link
Contributor

I think we agreed that the gating should be done by a separate webhook that only checs creation and not update to avoid the ping pong issue, I do no thik this implementation follows the ticket #1458

@bacherfl
Copy link
Member

I think we agreed that the gating should be done by a separate webhook that only checs creation and not update to avoid the ping pong issue, I do no thik this implementation follows the ticket #1458

What I like about this current implementation is that the approach using the annotation that indicates that the scheduling gate has been removed makes it more explicit that the pod was actually handled by the lifecycle controller. So if this approach does not make the current webhook overly complex I would be fine with this solution as well

Co-authored-by: Florian Bacher <florian.bacher@dynatrace.com>
Signed-off-by: odubajDT <93584209+odubajDT@users.noreply.github.com>
Signed-off-by: odubajDT <93584209+odubajDT@users.noreply.github.com>
Signed-off-by: odubajDT <93584209+odubajDT@users.noreply.github.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
…est.go

Co-authored-by: RealAnna <89971034+RealAnna@users.noreply.github.com>
Signed-off-by: odubajDT <93584209+odubajDT@users.noreply.github.com>
RealAnna
RealAnna previously approved these changes Sep 22, 2023
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
bacherfl
bacherfl previously approved these changes Sep 25, 2023
@odubajDT odubajDT added the on hold Do not merge yet label Sep 26, 2023
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
@thisthat thisthat removed the on hold Do not merge yet label Sep 26, 2023
odubajDT and others added 2 commits September 26, 2023 11:09
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
Signed-off-by: odubajDT <93584209+odubajDT@users.noreply.github.com>
@sonarcloud
Copy link

sonarcloud bot commented Sep 26, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@odubajDT odubajDT merged commit b40503e into keptn:main Sep 26, 2023
38 checks passed
RealAnna added a commit that referenced this pull request Sep 27, 2023
…ctionality (#2140)

Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <93584209+odubajDT@users.noreply.github.com>
Co-authored-by: Florian Bacher <florian.bacher@dynatrace.com>
Co-authored-by: RealAnna <89971034+RealAnna@users.noreply.github.com>
Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants