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: New istio config format #1249

Merged

Conversation

pastequo
Copy link
Contributor

Changes

  • Introduce new configuration format

/kind enhancement

Fixes #1247

Release Note

A new configuration format has been introduced. Old format is still supported. See https://docs.google.com/document/d/12X1-9nhjAhpf-Wlt3RbdoMbvx31zFBva/edit for more details

Docs


@knative-prow knative-prow bot added kind/enhancement size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 25, 2024
Copy link

knative-prow bot commented Jan 25, 2024

Hi @pastequo. Thanks for your PR.

I'm waiting for a knative-extensions member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow knative-prow bot requested review from KauzClay and nak3 January 25, 2024 10:46
@pastequo pastequo force-pushed the feat/new-configuration-format branch from 30722ac to 22c45ce Compare January 25, 2024 11:27
Copy link

codecov bot commented Jan 25, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (9a51ff3) 81.54% compared to head (c29c707) 82.10%.
Report is 3 commits behind head on main.

❗ Current head c29c707 differs from pull request most recent head 5ead169. Consider uploading reports for the commit 5ead169 to get more accurate results

Files Patch % Lines
pkg/reconciler/ingress/config/istio.go 96.77% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1249      +/-   ##
==========================================
+ Coverage   81.54%   82.10%   +0.56%     
==========================================
  Files          19       19              
  Lines        1669     1738      +69     
==========================================
+ Hits         1361     1427      +66     
- Misses        220      222       +2     
- Partials       88       89       +1     

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

@dprotaso
Copy link
Contributor

dprotaso commented Feb 1, 2024

/ok-to-test

@knative-prow knative-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 1, 2024
@dprotaso
Copy link
Contributor

dprotaso commented Feb 1, 2024

/retest

pkg/reconciler/ingress/config/istio.go Outdated Show resolved Hide resolved
pkg/reconciler/ingress/config/istio_test.go Outdated Show resolved Hide resolved
pkg/reconciler/ingress/config/istio.go Outdated Show resolved Hide resolved
pkg/reconciler/ingress/config/istio.go Outdated Show resolved Hide resolved
Comment on lines 161 to 164
// New format is partially defined
if (!hasGateway && hasLocalGateway) || (hasGateway && !hasLocalGateway) {
return nil, fmt.Errorf("config is not fully defined")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically just specifying external-gateways is a valid config and we would default the local gateway to what's defined here:

func defaultLocalGateways() []Gateway {
return []Gateway{{
Namespace: system.Namespace(),
Name: KnativeLocalGateway,
ServiceURL: network.GetServiceHostname(KnativeLocalGateway, IstioNamespace),
}}
}

Same applies to vice-versa where the user defines only the local-gateways key

I think it would be simpler to just look at the presence of the new keys in NewIstioFromConfigMap and if they're present assume it's the new config map format. Otherwise fallback onto the older parsing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I implemented the following

  • If both format are defined (even partially), the code will error
  • default values are used either by the new or old format

I let you resolve the thread if this new version is ok for you

pkg/reconciler/ingress/config/istio.go Outdated Show resolved Hide resolved
pkg/reconciler/ingress/config/istio.go Outdated Show resolved Hide resolved
pkg/reconciler/ingress/config/istio.go Outdated Show resolved Hide resolved
@pastequo pastequo force-pushed the feat/new-configuration-format branch from c29c707 to fc6e93f Compare February 5, 2024 10:34
@pastequo
Copy link
Contributor Author

pastequo commented Feb 5, 2024

/retest

@pastequo pastequo force-pushed the feat/new-configuration-format branch from fc6e93f to 5ead169 Compare February 6, 2024 13:01
@pastequo
Copy link
Contributor Author

pastequo commented Feb 6, 2024

/retest

@dprotaso
Copy link
Contributor

dprotaso commented Feb 6, 2024

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Feb 6, 2024
Copy link

knative-prow bot commented Feb 6, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, pastequo

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 Feb 6, 2024
@knative-prow knative-prow bot merged commit 708e6d3 into knative-extensions:main Feb 6, 2024
47 checks passed
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New configuration format
2 participants