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

Support a charm resource to override the installed snap #149

Merged
merged 20 commits into from
Nov 21, 2024

Conversation

addyess
Copy link
Contributor

@addyess addyess commented Sep 20, 2024

Overview

Create support to override the snap, while warning users they are using the charm in an override mode

Rationale

In order to test that new builds of the k8s snap will operate on the current stable k8s charm, we should be able to verify the snap before releasing it. To do so, we need a way to insert the snap into the charmed environment. This provides the ability to do so.

@addyess addyess requested a review from a team as a code owner September 20, 2024 02:05
@addyess addyess marked this pull request as draft September 20, 2024 02:23
@addyess

This comment was marked as outdated.

@addyess addyess force-pushed the KU-1464/support-snap-version-overrides branch 2 times, most recently from d5eced6 to beca4c6 Compare September 20, 2024 19:18
@addyess addyess force-pushed the KU-1464/support-snap-version-overrides branch from 3f91d5b to 36046d3 Compare November 13, 2024 20:13
@addyess addyess force-pushed the KU-1464/support-snap-version-overrides branch from 36046d3 to ce5ed08 Compare November 13, 2024 20:17
@addyess addyess marked this pull request as ready for review November 20, 2024 14:30
@addyess addyess force-pushed the KU-1464/support-snap-version-overrides branch 2 times, most recently from 9576d15 to 79f3d97 Compare November 20, 2024 14:33
@addyess addyess force-pushed the KU-1464/support-snap-version-overrides branch from 79f3d97 to b4c47fd Compare November 20, 2024 14:36
@addyess addyess force-pushed the KU-1464/support-snap-version-overrides branch from feeeae8 to ac5a691 Compare November 20, 2024 16:17
charms/worker/k8s/src/charm.py Outdated Show resolved Hide resolved
charms/worker/k8s/src/snap.py Outdated Show resolved Hide resolved
charms/worker/k8s/src/snap.py Outdated Show resolved Hide resolved
charms/worker/k8s/src/snap.py Show resolved Hide resolved
Copy link
Member

@mateoflorido mateoflorido left a comment

Choose a reason for hiding this comment

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

LGTM! :shipit:

@addyess addyess force-pushed the KU-1464/support-snap-version-overrides branch from 9860d25 to e317fe3 Compare November 21, 2024 15:42
Copy link
Contributor

Test coverage for e317fe3

coverage-report: install_deps /home/runner/work/k8s-operator/k8s-operator/charms/worker/k8s> python -I -m pip install 'coverage[toml]'
coverage-report: commands[0] /home/runner/work/k8s-operator/k8s-operator/charms/worker/k8s> coverage report
Name                                    Stmts   Miss  Cover
-----------------------------------------------------------
lib/charms/k8s/v0/k8sd_api_manager.py     270     29    89%
src/charm.py                              461    247    46%
src/cloud_integration.py                   80      3    96%
src/containerd.py                         140     16    89%
src/cos_integration.py                     33     12    64%
src/events/update_status.py                48     10    79%
src/inspector.py                           40      3    92%
src/kube_control.py                        39     31    21%
src/literals.py                             1      0   100%
src/protocols.py                           16      3    81%
src/reschedule.py                          77      4    95%
src/snap.py                               165     10    94%
src/token_distributor.py                  174    103    41%
src/upgrade.py                             31      1    97%
-----------------------------------------------------------
TOTAL                                    1575    472    70%
coverage-report: OK (1.19=setup[0.99]+cmd[0.20] seconds)
congratulations :) (1.24 seconds)

Static code analysis report

Run started:2024-11-21 15:44:16.467696

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 3380
  Total lines skipped (#nosec): 13
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

@addyess addyess merged commit 46d79b8 into main Nov 21, 2024
60 checks passed
@addyess addyess deleted the KU-1464/support-snap-version-overrides branch November 21, 2024 17:00
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.

2 participants