Skip to content

update go modules #381

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

Merged
merged 3 commits into from
Sep 2, 2022
Merged

Conversation

ipochi
Copy link
Contributor

@ipochi ipochi commented Aug 8, 2022

Updates the builder image version to 1.18.5 and updates the go modules
to mitigate CVEs. The list of vulnerabilities found in the binaries are
listed in comment.

Signed-off-by: Imran Pochi imranpochi@microsoft.com

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 8, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @ipochi. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 8, 2022
@ipochi
Copy link
Contributor Author

ipochi commented Aug 8, 2022

/cc @tallclair @cheftako @jveski

@k8s-ci-robot k8s-ci-robot requested a review from tallclair August 8, 2022 13:42
@k8s-ci-robot
Copy link
Contributor

@ipochi: GitHub didn't allow me to request PR reviews from the following users: jveski.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @tallclair @cheftako @jveski

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.

@k8s-ci-robot k8s-ci-robot requested a review from cheftako August 8, 2022 13:42
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.0
golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48
google.golang.org/grpc v1.48.0
google.golang.org/protobuf v1.28.1
Copy link
Contributor

Choose a reason for hiding this comment

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

I realize protobug moved. Need to check that there are no additional steps needed when we switch package.

@cheftako
Copy link
Contributor

cheftako commented Aug 9, 2022

/ok-to-test

@k8s-ci-robot k8s-ci-robot 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 Aug 9, 2022
@ipochi ipochi force-pushed the imran/go-mod-update branch from 23505fb to db7f800 Compare August 13, 2022 07:24
@ipochi
Copy link
Contributor Author

ipochi commented Aug 13, 2022

/test pull-apiserver-network-proxy-test
/test pull-apiserver-network-proxy-make-lint

@ipochi
Copy link
Contributor Author

ipochi commented Aug 13, 2022

/ok-to-test

@ipochi ipochi force-pushed the imran/go-mod-update branch 2 times, most recently from bf41994 to 1849963 Compare August 26, 2022 13:42
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 26, 2022
@ipochi ipochi force-pushed the imran/go-mod-update branch from 1849963 to b1a6d99 Compare August 26, 2022 13:58
@ipochi
Copy link
Contributor Author

ipochi commented Aug 26, 2022

/test pull-apiserver-network-proxy-make-lint
/test pull-apiserver-network-proxy-test

@ipochi ipochi force-pushed the imran/go-mod-update branch from b1a6d99 to ef352a2 Compare August 26, 2022 21:05
@ipochi
Copy link
Contributor Author

ipochi commented Aug 26, 2022

/test pull-apiserver-network-proxy-test

@ipochi
Copy link
Contributor Author

ipochi commented Aug 26, 2022

/test pull-apiserver-network-proxy-make-lint

@ipochi ipochi force-pushed the imran/go-mod-update branch 2 times, most recently from 29e7193 to f00900c Compare August 26, 2022 21:29
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 29, 2022
Updates the builder image version to 1.18.5 and updates the go modules
to mitigate CVEs. The list of vulnerabilities found in the binaries are
listed in [comment](kubernetes-sigs#372 (comment)).

Signed-off-by: Imran Pochi <imranpochi@microsoft.com>
Signed-off-by: Imran Pochi <imranpochi@microsoft.com>
G112: Potential Slowloris Attack because ReadHeaderTimeout is not
configured in the http.Server (gosec)

Configuring with a sensible default of 60s. Nginx uses the same default
value (http://nginx.org/en/docs/http/ngx_http_core_module.html#client_header_timeout)

Signed-off-by: Imran Pochi <imranpochi@microsoft.com>
@ipochi ipochi force-pushed the imran/go-mod-update branch from 900a202 to 93d1da1 Compare September 1, 2022 09:57
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 1, 2022
@ipochi ipochi force-pushed the imran/go-mod-update branch from 93d1da1 to 04595aa Compare September 1, 2022 17:13
@ipochi
Copy link
Contributor Author

ipochi commented Sep 2, 2022

/test pull-apiserver-network-proxy-make-lint

@ipochi
Copy link
Contributor Author

ipochi commented Sep 2, 2022

/test pull-apiserver-network-proxy-test

@ipochi
Copy link
Contributor Author

ipochi commented Sep 2, 2022

/test pull-apiserver-network-proxy-make-lint

@ipochi
Copy link
Contributor Author

ipochi commented Sep 2, 2022

/test pull-apiserver-network-proxy-test

@ipochi
Copy link
Contributor Author

ipochi commented Sep 2, 2022

@tallclair @cheftako

Finally the lint job succeeds. moved all the components to go v1.18.5. Please review :)

@cheftako
Copy link
Contributor

cheftako commented Sep 2, 2022

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 2, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheftako, ipochi

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 2, 2022
@k8s-ci-robot k8s-ci-robot merged commit 85e1558 into kubernetes-sigs:master Sep 2, 2022
@ipochi ipochi deleted the imran/go-mod-update branch September 3, 2022 00:14
k8s.io/apimachinery v0.24.3
k8s.io/client-go v0.24.3
k8s.io/component-base v0.24.3
k8s.io/klog/v2 v2.70.1
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.0
)

require (
Copy link
Contributor

Choose a reason for hiding this comment

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

this added a lot of new dependencies, many of which we explicitly don't want to depend on transitively in Kubernetes:

Also, this only updated the root go.mod file, not the client konnectivity-client/go.mod file, so now this repo has two disparate dependency trees. If the client go.mod file was updated the same way this was, we would be unable to pull new versions into kubernetes.

How were the versions of these updated modules selected?

Copy link
Contributor

Choose a reason for hiding this comment

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

The two that you mentioned are both transitive dependencies through client-go. I don't know how that specific client-go version was selected, but since this PR sat open for a long time I'm guessing it was the latest version when this PR was opened.

We haven't been keeping the konnectivity-client go.mod in sync with this since we're tracking the module versions from the oldest version of k8s we support in the client. We should maybe consider adding a presubmit to ensure that konnectivity-client doesn't take any dependencies on kubernetes staging repos, but hopefully our PR review process would catch that.

https://github.com/kubernetes/client-go/blob/v0.24.3/go.mod#L26

openapi

Copy link
Contributor

Choose a reason for hiding this comment

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

oops, I misread the go-openapi additions, these are the ones we want to avoid:

      "github.com/go-openapi/analysis": "use k8s.io/kube-openapi/pkg/validation/spec",
      "github.com/go-openapi/spec": "use k8s.io/kube-openapi/pkg/validation/spec instead",
      "github.com/go-openapi/strfmt": "use k8s.io/kube-openapi/pkg/validation/strfmt instead",
      "github.com/go-openapi/validate": "use k8s.io/kube-openapi/pkg/validation/validate instead",

the github.com/imdario/mergo one is a known dependency but the version selected here is known to be problematic (see the linked issue above)

@@ -350,7 +354,7 @@ func (p *Proxy) runAdminServer(o *options.ProxyRunOptions, server *server.ProxyS
}
}
adminServer := &http.Server{
Addr: net.JoinHostPort(o.AdminBindAddress, strconv.Itoa(o.AdminPort)),
Addr: fmt.Sprintf("127.0.0.1:%d", o.AdminPort),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this changed? Looks like maybe a bad rebase?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1. However this was merged Sept 2, over 3 months ago.

jkh52 added a commit to jkh52/apiserver-network-proxy that referenced this pull request Dec 7, 2022
See discussion at
kubernetes-sigs#381

What I did:

- match requirements with k/k release-1.24 branch
- for k8s.io/api and friends, take latest 1.24 tag (v0.24.8)
- go mod tidy
jkh52 added a commit to jkh52/apiserver-network-proxy that referenced this pull request Dec 7, 2022
See discussion at
kubernetes-sigs#381

What I did:

- match requirements with k/k release-1.24 branch
- for k8s.io/api and friends, take latest 1.24 tag (v0.24.8)
- delete indirect require section (to generate from scratch)
- go mod tidy
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants