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

Gateway api #1042

Merged
merged 7 commits into from
Aug 4, 2023
Merged

Gateway api #1042

merged 7 commits into from
Aug 4, 2023

Conversation

localvar
Copy link
Collaborator

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Jul 19, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.06% 🎉

Comparison is base (fca5077) 81.02% compared to head (fe9e9dd) 81.09%.
Report is 2 commits behind head on main.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1042      +/-   ##
==========================================
+ Coverage   81.02%   81.09%   +0.06%     
==========================================
  Files         136      136              
  Lines       15405    15407       +2     
==========================================
+ Hits        12482    12494      +12     
+ Misses       2336     2327       -9     
+ Partials      587      586       -1     

see 6 files with indirect coverage changes

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

@localvar localvar marked this pull request as ready for review July 20, 2023 01:21

// DefaultSpec returns the default spec of GatewayController.
func (gc *GatewayController) DefaultSpec() interface{} {
return &Spec{}
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, ~/.kube/config could be the default value. And I think the GatewayController could support ClientSetInCluster mode[1].

[1] https://github.com/kubernetes/client-go/blob/master/examples/in-cluster-client-configuration/main.go

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the default is in cluster mode(when both KubeConfig and MasterURL are empty) as it will be deployed in a k8s cluster at most of the time. And ClientSetInCluster mode is used, please check L161 in k8s.go.

func (b *pipelineSpecBuilder) addBackend(addr string, weight int) {
if b.proxy == nil {
b.proxy = &httpproxy.Spec{}
b.proxy.Pools = append(b.proxy.Pools, &httpproxy.ServerPoolSpec{ServerMaxBodySize: -1})
Copy link
Contributor

Choose a reason for hiding this comment

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

A side question, why not make the default value 0 for unlimited body?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To support unlimited body, we have to enable the stream mode, but in this mode, some of the new features of v2.0 becomes unavailable. so the meaning of "set ServerMaxBodySize to zero" is a balance of different things, and we think using -1 for unlimited body is better for more cases.

return true
}

if oldObj.(metav1.Object).GetResourceVersion() == newObj.(metav1.Object).GetResourceVersion() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wonder why *apicorev1.Endpoints is not Object.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

apicorev1.Endpoints is Object, but this line is only for other objects, for endpoints, we will do additional checks below.

however, just found some of the conditions and return values of this function is wrong, will fix them.

return false
}

func isSubsetsChanged(a, b apicorev1.EndpointSubset) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why reflect.DeepEqual can not cover this function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

DeepEqual can be used here.
But for performance consideration, explicit comparsion is used.

@localvar localvar requested a review from xxx7xxxx August 2, 2023 01:58

if minor < 19 {
// Ingress version v1 has been added after kubernetes 1.19
panic(fmt.Errorf("kubernetes version [%v] is too low, GatewayController requires kubernetes v1.19+", info.GitVersion))
Copy link
Contributor

Choose a reason for hiding this comment

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

In doc, the require of k8s is v1.18+, but here is v1.19...

@suchen-sci suchen-sci added this pull request to the merge queue Aug 4, 2023
Merged via the queue into easegress-io:main with commit 31d6188 Aug 4, 2023
7 checks passed
@localvar localvar deleted the gateway-api branch August 4, 2023 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants