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

Refactor some elemental package methods to be used as stand alone functions #1883

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

davidcassany
Copy link
Contributor

@davidcassany davidcassany commented Dec 13, 2023

This PR refactors some methods in elemental package. Basically it turns some of the methods in to static functions not tied to any object.

This is to allow reusing them without the need of an Elemental object. In fact I am also wondering of running a follow up PR completely removing the Elemental object from

type Elemental struct {
config *v1.Config
}

as this is a useless object. In only keeps the configuration which is anyway already available in all places where the elemental package is in use. So in a follow up PR I would even consider dropping the object entirely and simply pass the configuration struct as a parameter.

Part of #1874

@davidcassany davidcassany requested a review from a team as a code owner December 13, 2023 13:46
@codecov-commenter
Copy link

Codecov Report

Attention: 20 lines in your changes are missing coverage. Please review.

Comparison is base (a7b7f2e) 72.53% compared to head (9b47490) 72.49%.

Files Patch % Lines
pkg/elemental/elemental.go 80.61% 14 Missing and 5 partials ⚠️
pkg/action/install.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1883      +/-   ##
==========================================
- Coverage   72.53%   72.49%   -0.04%     
==========================================
  Files          69       69              
  Lines        7286     7283       -3     
==========================================
- Hits         5285     5280       -5     
- Misses       1622     1625       +3     
+ Partials      379      378       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@frelon frelon left a comment

Choose a reason for hiding this comment

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

LGTM

@davidcassany davidcassany enabled auto-merge (rebase) December 13, 2023 14:10
@davidcassany davidcassany merged commit 3043afd into rancher:main Dec 13, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants