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

feat: additionalIgnoredNamespaces at runtime through helm #1641

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

Conversation

cmwylie19
Copy link
Collaborator

@cmwylie19 cmwylie19 commented Jan 8, 2025

Description

This feature:

  • Adds additionalIgnoredNamespaces to values.yaml
  • Sets additionalIgnoredNamespaces in controller container envs as PEPR_ADDITIONAL_IGNORED_NAMESPACES
  • reads PEPR_ADDITIONAL_IGNORED_NAMESPACES env and adds namespaces to ignoredNamespaces
  • Does not document PEPR_ADDITIONAL_IGNORED_NAMESPACES as feature is meant to be set through helm chart and not by hand, By hand you should set them in package.json

In action:
package.json

    "alwaysIgnore": {
      "namespaces": ["something"]
    },

values.yaml

additionalIgnoredNamespaces: 
  - 'kube-system'
  - 'kube-public'
  - 'kube-node-lease'
  - 'default'
  - 'pepr'
  - 'pepr-system'
  - 'pepr-test-module'

> helm template .

controllers

            - name: PEPR__ADDITIONAL_IGNORED_NAMESPACES
              value: "kube-system, kube-public, kube-node-lease, default, pepr, pepr-system, pepr-test-module"

webhook configs

    namespaceSelector:
      matchExpressions:
        - key: kubernetes.io/metadata.name
          operator: NotIn
          values:
            - kube-system
            - pepr-system
            - kube-system
            - kube-public
            - kube-node-lease
            - default
            - pepr
            - pepr-system
            - pepr-test-module
            - something

Related Issue

Fixes #1610 #1617

Relates to #

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

src/lib/assets/index.ts Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.

Project coverage is 80.12%. Comparing base (9662a58) to head (2e28cf6).

Files with missing lines Patch % Lines
src/lib/assets/webhooks.ts 90.00% 1 Missing ⚠️
src/lib/core/module.ts 50.00% 1 Missing ⚠️
src/lib/processors/validate-processor.ts 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1641      +/-   ##
==========================================
- Coverage   81.40%   80.12%   -1.28%     
==========================================
  Files          43       45       +2     
  Lines        1979     2048      +69     
  Branches      411      456      +45     
==========================================
+ Hits         1611     1641      +30     
- Misses        366      377      +11     
- Partials        2       30      +28     
Files with missing lines Coverage Δ
src/lib/assets/helm.ts 92.30% <ø> (ø)
src/lib/assets/index.ts 76.47% <100.00%> (ø)
src/lib/processors/mutate-processor.ts 63.04% <100.00%> (+0.40%) ⬆️
src/lib/assets/webhooks.ts 28.57% <90.00%> (ø)
src/lib/core/module.ts 81.81% <50.00%> (+0.56%) ⬆️
src/lib/processors/validate-processor.ts 55.81% <50.00%> (+1.05%) ⬆️

... and 5 files with indirect coverage changes

src/lib/assets/webhooks.ts Outdated Show resolved Hide resolved
Signed-off-by: Case Wylie <[email protected]>
@cmwylie19 cmwylie19 marked this pull request as ready for review January 8, 2025 18:22
@cmwylie19 cmwylie19 requested a review from a team as a code owner January 8, 2025 18:22
@cmwylie19 cmwylie19 added the uds Tracked by UDS project. Adds to UDS Inbox when applied. label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
uds Tracked by UDS project. Adds to UDS Inbox when applied.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Allow deploy-time configurable alwaysIgnore.namespaces
1 participant