Skip to content

Conversation

@sgettys
Copy link
Collaborator

@sgettys sgettys commented May 27, 2022

Added controller for parameter set resource

Steven Gettys and others added 4 commits May 27, 2022 15:02
@sgettys sgettys requested a review from carolynvs May 27, 2022 22:03
@codecov
Copy link

codecov bot commented May 27, 2022

Codecov Report

Merging #101 (7712105) into main (337a3f9) will decrease coverage by 0.19%.
The diff coverage is 76.92%.

@@            Coverage Diff             @@
##             main     #101      +/-   ##
==========================================
- Coverage   78.27%   78.07%   -0.20%     
==========================================
  Files          10       12       +2     
  Lines         833      976     +143     
==========================================
+ Hits          652      762     +110     
- Misses        115      136      +21     
- Partials       66       78      +12     
Flag Coverage Δ
unit-tests 78.07% <76.92%> (-0.20%) ⬇️

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

Impacted Files Coverage Δ
api/v1/parameterset_types.go 66.66% <66.66%> (ø)
controllers/parameterset_controller.go 77.61% <77.61%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 337a3f9...7712105. Read the comment docs.

@carolynvs carolynvs self-assigned this Jun 2, 2022
Copy link
Member

@carolynvs carolynvs left a comment

Choose a reason for hiding this comment

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

This is looking good! I've mostly just flagged some tech debt that we are increasing and want to say that going forward I can't accept more PRs that don't also fix these problems.

//+kubebuilder:rbac:groups=porter.sh,resources=parametersets,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=porter.sh,resources=parametersets/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=porter.sh,resources=parametersets/finalizers,verbs=update
//+kubebuilder:rbac:groups=porter.sh,resources=agentconfigs,verbs=get;list;watch;create;update;patch;delete
Copy link
Member

Choose a reason for hiding this comment

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

Heads up that I don't think we need to repeat rbac comments from other controllers. I am pretty sure that you could remove everything here but the new rbac lines for parametersets and it wouldn't change any of the generated fields.

Here's the open issue to track cleaning this up but in the meantime we don't need to keep adding new code that has the same problem. 😀 #100

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will address with next PR that cleans up all this tech debt!

},
Spec: porterv1.ParameterSetSpec{
//TODO: get schema version from porter version
// https://github.com/getporter/porter/pull/2052
Copy link
Member

Choose a reason for hiding this comment

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

Heads up that this PR is merged, if you'd like to do a follow up PR to address the TODO in these tests. We could bump the version of Porter that we are referencing at the same time.

}
}

func waitForParamSetDeleted(ctx context.Context, ps *porterv1.ParameterSet) error {
Copy link
Member

Choose a reason for hiding this comment

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

The amount of copy/paste that is in these test files is really starting to concern me. We are just piling up on code that we know we don't want to maintain like this.

I've created #102 to tack consolidating these test helpers so that 80% of the test files aren't duplicate test helpers.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Next on the list, will be starting immediately

@sgettys sgettys force-pushed the parameter_set_controller branch from 7a944f5 to 5a42613 Compare June 2, 2022 22:51
Copy link
Member

@carolynvs carolynvs left a comment

Choose a reason for hiding this comment

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

Just two small fixes and we are good to go 👍

The ParameterSet spec is the same schema as the ParameterSet resource in Porter.
You can copy/paste the output of the `porter parameters show NAME -o yaml` command into the ParameterSet resource spec (removing the status section).

In addition to the normal fields available on a [Porter Parameter Set document](/reference/file-formats/), the following fields are supported:
Copy link
Member

Choose a reason for hiding this comment

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

Can you update the link to go directly to the correct section on the page?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Whoops copy paste error :)

The CredentialSet spec is the same schema as the CredentialSet resource in Porter.
You can copy/paste the output of the `porter credentials show NAME -o yaml` command into the CredentialSet resource spec (removing the status section).

In addition to the normal fields available on a [Porter Credential Set document](/reference/file-formats/), the following fields are supported:
Copy link
Member

Choose a reason for hiding this comment

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

Can you update the link to go directly to the correct section on the page?

Signed-off-by: Steven Gettys <[email protected]>
Copy link
Member

@carolynvs carolynvs left a comment

Choose a reason for hiding this comment

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

This is great, thank you for implementing parameter and credential sets! 🙇‍♀️

@carolynvs carolynvs merged commit 38f717f into getporter:main Jun 3, 2022
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