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

chore(operator): refactor KeptnTask controller logic #1536

Merged
merged 10 commits into from
Jun 15, 2023
Merged

chore(operator): refactor KeptnTask controller logic #1536

merged 10 commits into from
Jun 15, 2023

Conversation

odubajDT
Copy link
Contributor

@odubajDT odubajDT commented Jun 7, 2023

Fixes: #1500

Changes:

  • split JobRunner interface function CreateContainerWithVolumes to two separate ones retrieving containers and volumes separately
  • remove unneeded k8s API calls from KeptnTask reconcile loop
  • refactored job-utils to use the newly adapted interface
  • set TaskType as part of TaskContext
  • refactored ContainerBuilder to use the updated JobRunner interface
  • renamed DunctionBuilder to RuntimeBuilder
  • refactored RuntimeBuilder to implement the updated JobRunner interface

@netlify
Copy link

netlify bot commented Jun 7, 2023

Deploy Preview for keptn-lifecycle-toolkit ready!

Name Link
🔨 Latest commit 136d72e
🔍 Latest deploy log https://app.netlify.com/sites/keptn-lifecycle-toolkit/deploys/64872287d414e20008547c6c
😎 Deploy Preview https://deploy-preview-1536--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 settings.

@codecov
Copy link

codecov bot commented Jun 7, 2023

Codecov Report

Merging #1536 (c9f62b9) into main (908b03d) will decrease coverage by 0.07%.
The diff coverage is 79.36%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1536      +/-   ##
==========================================
- Coverage   63.22%   63.15%   -0.07%     
==========================================
  Files         142      142              
  Lines       10794    10787       -7     
==========================================
- Hits         6824     6813      -11     
- Misses       3715     3716       +1     
- Partials      255      258       +3     
Impacted Files Coverage Δ
...ator/controllers/lifecycle/keptntask/controller.go 56.33% <50.00%> (+3.63%) ⬆️
...rator/controllers/lifecycle/keptntask/job_utils.go 74.16% <64.28%> (+5.66%) ⬆️
...controllers/lifecycle/keptntask/runtime_builder.go 70.44% <78.12%> (ø)
...ntrollers/lifecycle/keptntask/container_builder.go 100.00% <100.00%> (ø)
...trollers/lifecycle/keptntask/job_runner_builder.go 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

Flag Coverage Δ
certificate-operator 68.55% <ø> (ø)
component-tests 58.49% <68.25%> (-0.33%) ⬇️
lifecycle-operator 84.43% <77.77%> (+0.04%) ⬆️
metrics-operator 81.66% <ø> (ø)
scheduler 30.45% <ø> (ø)

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

@odubajDT odubajDT marked this pull request as ready for review June 12, 2023 14:18
@odubajDT odubajDT requested a review from a team as a code owner June 12, 2023 14:18
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>
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>
bacherfl
bacherfl previously approved these changes Jun 14, 2023
Copy link
Member

@bacherfl bacherfl left a comment

Choose a reason for hiding this comment

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

lgtm

Co-authored-by: Florian Bacher <florian.bacher@dynatrace.com>
Signed-off-by: odubajDT <93584209+odubajDT@users.noreply.github.com>
@sonarcloud
Copy link

sonarcloud bot commented Jun 14, 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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@odubajDT odubajDT merged commit ed85fc9 into keptn:main Jun 15, 2023
@keptn-bot keptn-bot mentioned this pull request Jun 15, 2023
StackScribe pushed a commit to StackScribe/lifecycle-toolkit that referenced this pull request Jun 19, 2023
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>
StackScribe pushed a commit to StackScribe/lifecycle-toolkit that referenced this pull request Jun 22, 2023
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>
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.

chore: refactor reconciliation of KeptnTask and KeptnTaskDefinition
3 participants