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

Require tf users to specify a charm channel #242

Merged
merged 3 commits into from
Jan 16, 2025

Conversation

addyess
Copy link
Contributor

@addyess addyess commented Jan 10, 2025

Overview

Don't default the charm channels to 1.30/edge -- a channel which may be or is already closed.
Instead, require the tf user to specify a channel

Overview

  • removes the default channel from the tf modules

@addyess addyess requested a review from a team as a code owner January 10, 2025 20:52
Copy link
Contributor

@louiseschmidtgen louiseschmidtgen left a comment

Choose a reason for hiding this comment

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

Ideally we would have the default version be the latest stable (like Microk8s). I don't know whether that is possible with terraform?

@addyess
Copy link
Contributor Author

addyess commented Jan 14, 2025

Ideally we would have the default version be the latest stable (like Microk8s). I don't know whether that is possible with terraform?

The charms will never have a latest/stable. I propose that each branch (release-1.32, 1.33, 1.34) reference that branch's stable channel.

Copy link
Contributor

Test coverage for a609e65

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     286     29    90%
src/charm.py                              501    260    48%
src/cloud_integration.py                   80      3    96%
src/config/extra_args.py                   31      2    94%
src/containerd.py                         140     22    84%
src/cos_integration.py                     33     12    64%
src/events/update_status.py                68     24    65%
src/inspector.py                           41      4    90%
src/kube_control.py                        43     32    26%
src/literals.py                            25      0   100%
src/protocols.py                           28      5    82%
src/reschedule.py                          77      4    95%
src/snap.py                               193     29    85%
src/token_distributor.py                  181    109    40%
src/upgrade.py                            108     48    56%
-----------------------------------------------------------
TOTAL                                    1835    583    68%
coverage-report: OK (1.51=setup[1.24]+cmd[0.27] seconds)
congratulations :) (1.69 seconds)

Static code analysis report

Run started:2025-01-15 16:43:17.376478

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 3910
  Total lines skipped (#nosec): 3
  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):

Copy link
Contributor

@louiseschmidtgen louiseschmidtgen left a comment

Choose a reason for hiding this comment

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

Would it make sense for us to add a validation for the channel variable since we're dealing with user input here or does that create too much overhead?

Copy link
Contributor

@HomayoonAlimohammadi HomayoonAlimohammadi left a comment

Choose a reason for hiding this comment

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

Great stuff, thanks a lot @addyess! LGTM, just a minor question.

charms/worker/k8s/terraform/variables.tf Show resolved Hide resolved
Copy link
Contributor

@louiseschmidtgen louiseschmidtgen left a comment

Choose a reason for hiding this comment

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

Let's do this!

@addyess addyess merged commit 82de03e into main Jan 16, 2025
70 checks passed
@addyess addyess deleted the KU-2416/tf-force-users-to-choose-a-channel branch January 16, 2025 19:32
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.

3 participants