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: add typing to templates.ts #1602

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

chore: add typing to templates.ts #1602

wants to merge 6 commits into from

Conversation

samayer12
Copy link
Collaborator

Description

Adds typing to templates.ts

End to End Test:
(See Pepr Excellent Examples)

Related Issue

Relates to #1364

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

@samayer12 samayer12 requested a review from a team as a code owner December 18, 2024 15:48
@samayer12 samayer12 self-assigned this Dec 18, 2024
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 81.31%. Comparing base (a7fa6a4) to head (3162754).

Files with missing lines Patch % Lines
src/lib/processors/mutate-processor.ts 75.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1602      +/-   ##
==========================================
+ Coverage   81.24%   81.31%   +0.07%     
==========================================
  Files          42       43       +1     
  Lines        1962     1970       +8     
  Branches      406      426      +20     
==========================================
+ Hits         1594     1602       +8     
+ Misses        366      340      -26     
- Partials        2       28      +26     
Files with missing lines Coverage Δ
src/cli/init/enums.ts 100.00% <100.00%> (ø)
src/cli/init/templates.ts 71.42% <100.00%> (+0.84%) ⬆️
src/cli/init/walkthrough.ts 88.00% <100.00%> (ø)
src/lib/errors.ts 100.00% <100.00%> (ø)
src/lib/processors/mutate-processor.ts 62.63% <75.00%> (ø)

... and 6 files with indirect coverage changes

src/cli/init/enums.ts Outdated Show resolved Hide resolved
@@ -52,6 +80,8 @@ export function genPkgJSON(opts: InitOptions, pgkVerOverride?: string) {
},
includedFiles: [],
env: pgkVerOverride ? testEnv : {},
rbac: [],
rbacMode: RbacMode.SCOPED,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I lack context here, but it seems like rbacMode is the equivalent to setting a default value here. In that case, I'm assuming we ought to default to the use of scoped instead of admin.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah sorry, I missed this.

So, in short, in prod, without a doubt you are right, no reason for anyone to use cluster-admin, no way someone is going to need to control every single object in a cluster.

There is a more philosophical conversation to be had around starting a project (and Pepr's origin), figuring out how to do the Kubernetes calls that you need, then adding the appropriate RBAC after you figure everything out.

The intent of the project is that anyone can build an operator or controller. We increase the barrier of entry if we expect them to know RBAC at the beginning.

Currently, after initializing a new Pepr Module, the ServiceAccount is bound to a ClusterRole that has cluster-admin privs.

If we were going to change a default behavior there would need to be a longer convo, and warnings to potential users.

Copy link
Collaborator

@cmwylie19 cmwylie19 left a comment

Choose a reason for hiding this comment

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

nice job!

@cmwylie19 cmwylie19 enabled auto-merge December 20, 2024 18:41
@cmwylie19 cmwylie19 disabled auto-merge December 20, 2024 19:18
@cmwylie19 cmwylie19 self-requested a review December 20, 2024 19:18
Copy link
Collaborator

@cmwylie19 cmwylie19 left a comment

Choose a reason for hiding this comment

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

For now lets keep RBAC mode wide open since this would be a major change. Other than that it is all good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

2 participants