Skip to content

[WIP] feat: decouple the kubeconfig#3722

Draft
gauron99 wants to merge 1 commit into
knative:mainfrom
gauron99:push-yyxxnyyvslkl
Draft

[WIP] feat: decouple the kubeconfig#3722
gauron99 wants to merge 1 commit into
knative:mainfrom
gauron99:push-yyxxnyyvslkl

Conversation

@gauron99
Copy link
Copy Markdown
Contributor

@gauron99 gauron99 commented May 14, 2026

Current scope

  • one identity per-cluster - f.Local.Auth is a list but we do linear search for both Setting and Getting so the other input would be "dead code"
  • support 3 methods of authentication - token; cert + key (inline); exec plugin
  • --cluster= can be used to "clear" the stored cluster url and re-used the active context from kubeconfig

Flow

  • the flow for deploy is unchanged functionally -> func deploy first time see that no cluster is set, uses active kubeconfig context (just as now in main) and tries that as fallback method. Extra addition is on successful deploy this url + creds will be stored in-house .func/local.yaml file to be re-used on further deployments if untouched therefore you can freely switch contexts around and your function will still point to that initially deployed cluster with creds (now you dont even need kubeconfig at all)

Changes

  • 🎁 Add --cluster and --cluster-token flags to deploy, describe, and delete commands for direct
    cluster access without kubeconfig
  • 🎁 Auto-extract and persist cluster credentials from kubeconfig on first deploy to
    .func/local.yaml — subsequent deploys work without kubeconfig
  • 🎁 Support FUNC_CLUSTER and FUNC_CLUSTER_TOKEN environment variables for CI/CD workflows
  • 🎁 Add cluster field to global config (~/.config/func/config.yaml) for user-wide cluster default
  • 🎁 Synthesize RawConfig() on direct cluster override to support OpenShift internal registry
    credential resolution

/kind enhancement

Release Note

Added --cluster and --cluster-token flags to deploy, describe, and delete commands. Functions can now
connect to clusters directly without kubeconfig. Automatically save cluster credentials when none are set or given (usually first deploy). Supports FUNC_CLUSTER and FUNC_CLUSTER_TOKEN environment variables for CI/CD.

@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 14, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@knative-prow knative-prow Bot added the do-not-merge/work-in-progress 🤖 PR should not merge because it is a work in progress. label May 14, 2026
@knative-prow knative-prow Bot requested review from dsimansk and jrangelramos May 14, 2026 05:13
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 14, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gauron99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow Bot added approved 🤖 PR has been approved by an approver from all required OWNERS files. size/XXL 🤖 PR changes 1000+ lines, ignoring generated files. labels May 14, 2026
@gauron99 gauron99 force-pushed the push-yyxxnyyvslkl branch 2 times, most recently from 4697ec7 to f0c7baf Compare May 14, 2026 05:23
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

❌ Patch coverage is 67.44966% with 97 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.06%. Comparing base (cea1c1d) to head (5aba827).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
cmd/deploy.go 40.00% 15 Missing and 3 partials ⚠️
cmd/cluster_override.go 0.00% 16 Missing ⚠️
cmd/delete.go 60.00% 11 Missing and 3 partials ⚠️
cmd/describe.go 61.29% 10 Missing and 2 partials ⚠️
pkg/functions/function.go 33.33% 11 Missing and 1 partial ⚠️
cmd/environment.go 11.11% 8 Missing ⚠️
pkg/k8s/client.go 93.81% 4 Missing and 2 partials ⚠️
cmd/errors.go 0.00% 5 Missing ⚠️
pkg/config/config.go 50.00% 2 Missing and 1 partial ⚠️
pkg/k8s/extract.go 94.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3722      +/-   ##
==========================================
- Coverage   56.92%   56.06%   -0.87%     
==========================================
  Files         181      183       +2     
  Lines       20933    21379     +446     
==========================================
+ Hits        11916    11986      +70     
- Misses       7809     8168     +359     
- Partials     1208     1225      +17     
Flag Coverage Δ
e2e 22.35% <20.13%> (-13.80%) ⬇️
e2e go 32.23% <19.60%> (-0.54%) ⬇️
e2e node 28.06% <19.60%> (-0.42%) ⬇️
e2e python 32.60% <19.60%> (-0.52%) ⬇️
e2e quarkus 28.20% <19.60%> (-0.40%) ⬇️
e2e rust 27.62% <19.60%> (-0.39%) ⬇️
e2e springboot 26.16% <19.60%> (-0.37%) ⬇️
e2e typescript 28.17% <19.60%> (-0.44%) ⬇️
e2e-config-ci 17.53% <8.00%> (-0.36%) ⬇️
integration 17.05% <1.60%> (-0.38%) ⬇️
unit macos-14 45.28% <64.40%> (+0.29%) ⬆️
unit macos-latest 45.28% <64.40%> (+0.29%) ⬆️
unit ubuntu-24.04-arm 45.53% <64.09%> (+0.36%) ⬆️
unit ubuntu-latest 46.22% <64.40%> (+0.38%) ⬆️
unit windows-latest 45.32% <64.40%> (+0.35%) ⬆️

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gauron99 gauron99 changed the title feat: decouple the kubeconfig [WIP] feat: decouple the kubeconfig May 14, 2026
@gauron99 gauron99 force-pushed the push-yyxxnyyvslkl branch from f0c7baf to 325154a Compare May 14, 2026 21:16
@gauron99 gauron99 force-pushed the push-yyxxnyyvslkl branch from 325154a to 5aba827 Compare May 15, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress 🤖 PR should not merge because it is a work in progress. size/XXL 🤖 PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant