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: func domain route #1690

Merged
merged 2 commits into from
May 4, 2023
Merged

Conversation

lkingland
Copy link
Member

@lkingland lkingland commented Apr 25, 2023

  • 🎁 func --domain to choose routes

Adds the --domain flag which, when provided sets the value of the func.domain label on the deployed knative service. The cluster can then use this to choose which route to create for multi-route clusters. Optional.

Note that this will have no effect unless the cluster is configured to apply routes based on a domain mapping in the config-domain config map. This feature is functional in dev and a future PR will add this configuration both to the cluster created via CI/CD.

Documenting this feature is still an open question, but here us an example of a cluster configuration which by default exposes functions internally only as function.namespace.cluster.local, and allows for functions to be selectively exposed using the --domain flag for boson-project.org or boson-project.net:

  cluster.local: ""
  boson-project.org: |
    selector:
      func.domain: "boson-project.org"
  boson-project.net |
    selector:
      func.domain: "boson-project.net"

/kind enhancement

@knative-prow knative-prow bot added kind/enhancement do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Apr 25, 2023
@knative-prow
Copy link

knative-prow bot commented Apr 25, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lkingland

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

The pull request process is described here

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 25, 2023
@knative-prow knative-prow bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 25, 2023
@codecov
Copy link

codecov bot commented Apr 25, 2023

Codecov Report

Patch coverage: 91.17% and project coverage change: +1.69 🎉

Comparison is base (1ba7015) 61.26% compared to head (8c74121) 62.95%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1690      +/-   ##
==========================================
+ Coverage   61.26%   62.95%   +1.69%     
==========================================
  Files          93       93              
  Lines       12049    12189     +140     
==========================================
+ Hits         7382     7674     +292     
+ Misses       4004     3818     -186     
- Partials      663      697      +34     
Flag Coverage Δ
e2e-test 39.04% <91.17%> (-0.17%) ⬇️
e2e-test-oncluster 34.41% <91.17%> (?)
e2e-test-oncluster-runtime 29.56% <91.17%> (?)
e2e-test-runtime-go 28.15% <91.17%> (?)
e2e-test-runtime-node 29.26% <91.17%> (?)
e2e-test-runtime-python 29.26% <91.17%> (?)
e2e-test-runtime-quarkus 29.40% <91.17%> (?)
e2e-test-runtime-springboot 28.30% <91.17%> (?)
e2e-test-runtime-typescript 29.40% <91.17%> (?)
integration-tests 49.98% <91.17%> (-0.24%) ⬇️
unit-tests-macos-latest 48.72% <91.17%> (-0.35%) ⬇️
unit-tests-ubuntu-latest 49.62% <91.17%> (-0.36%) ⬇️
unit-tests-windows-latest 48.77% <91.17%> (-0.35%) ⬇️

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

Impacted Files Coverage Δ
pkg/functions/function.go 79.34% <ø> (+1.42%) ⬆️
pkg/knative/deployer.go 64.20% <0.00%> (-4.35%) ⬇️
cmd/deploy.go 76.09% <100.00%> (+0.98%) ⬆️

... and 14 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@lkingland lkingland force-pushed the scaffolding-domain branch 2 times, most recently from 8e04b97 to a1366bd Compare April 25, 2023 01:52
@lkingland
Copy link
Member Author

Note, related to #1666, it would be best if we had a way to inspect the state of the current platform upon which the function will be deployed, and issue a warning if this flag will not work as intended, and ideally have a tab-completion UX for choosing the domain for the function's route when more than one are configured.

@lkingland lkingland marked this pull request as ready for review April 25, 2023 06:40
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 25, 2023
@knative-prow knative-prow bot requested review from dsimansk and nainaz April 25, 2023 06:40
@lkingland lkingland mentioned this pull request Apr 25, 2023
14 tasks
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 30, 2023
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 2, 2023
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 3, 2023
@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 3, 2023
Adds the --domain flag which, when provided sets the value of the
func.domain label on the deployed knative service.  The cluster can then
use this to choose which route to create for multi-route clusters.
Optional.
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 3, 2023
Copy link
Member

@lance lance left a comment

Choose a reason for hiding this comment

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

/lgtm

This is a nice addition which will also be useful in clusters that have staging and/or test domains.

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label May 4, 2023
@knative-prow knative-prow bot merged commit 3c371f7 into knative:main May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/enhancement lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants