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

Update k8s.io/client-go to v0.29.5 #93

Merged

Conversation

andrzej-stencel
Copy link
Contributor

@andrzej-stencel andrzej-stencel commented May 24, 2024

This is a proposal to update the client-go dependency to a more recent version.

This is a breaking change, as it removes support for PodSecurityPolicy, which has been removed since Kubernetes v1.25.

I have upgraded to v0.29 as this is the latest version that supports Go 1.21 - client-go@v0.30 requires Go 1.22.

We can also upgrade to a version lower than v0.29 if that is needed by any of the downstream libraries depending on this package.

@cmacknz
Copy link
Member

cmacknz commented May 24, 2024

The two places that would use this are elastic-agent and beats, neither of which have any direct uses of PodSecurityPolicy in .go files. You should be good to proceed.

~/go/src/github.com/elastic/beats main
❯ rg 'PodSecurityPolicy' -l
metricbeat/module/kubernetes/apiserver/_meta/test/metrics.2.0
metricbeat/module/kubernetes/apiserver/_meta/test/metrics.2.0.expected
metricbeat/module/kubernetes/apiserver/_meta/testdata/docs.plain
metricbeat/module/kubernetes/apiserver/_meta/testdata/docs.plain-expected.json
~/go/src/github.com/elastic/elastic-agent main
❯ rg 'PodSecurityPolicy' -l
~/go/src/github.com/elastic/elastic-agent main

@ycombinator ycombinator requested review from rdner and blakerouse May 24, 2024 15:33
@cmacknz
Copy link
Member

cmacknz commented May 24, 2024

Actually doing a broader search directly in GitHub shows me that Cloudbeat is using kubernetes.PodSecurityPolicy directly so this update will create some work for them.

https://github.com/search?q=repo%3Aelastic%2Fcloudbeat%20PodSecurityPolicy&type=code

The two references are:
https://github.com/elastic/cloudbeat/blob/b6a55ec36074dd37802bb2f316d0f65d07d32ee6/internal/resources/fetching/fetchers/k8s/kube_provider.go#L138-L139

https://github.com/elastic/cloudbeat/blob/b6a55ec36074dd37802bb2f316d0f65d07d32ee6/internal/resources/fetching/fetchers/k8s/kube_fetcher.go#L64-L66

Given it is deprecated upstream I don't think they have a choice but to remove the references eventually but I'm not sure if this breaks anything for them now.

FYI @oren-zohar

@ycombinator ycombinator added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels May 24, 2024
@andrzej-stencel
Copy link
Contributor Author

Thank you @cmacknz for finding these references. It looks like the Cloud beat indeed is referencing the PodSecurityPolicy type. I cannot find the information on which Kubernetes versions the Cloud beat supports. I don't think this is a blocker for this change in elastic-agent-autodiscover. The Cloud beat can keep using the 0.6.14 version of the elastic-agent-autodiscover for now, until it removes the references to PodSecurityPolicy.

@ycombinator ycombinator requested review from michalpristas and removed request for blakerouse May 28, 2024 20:32
@andrzej-stencel andrzej-stencel marked this pull request as ready for review June 3, 2024 08:00
@andrzej-stencel andrzej-stencel requested a review from a team as a code owner June 3, 2024 08:00
@andrzej-stencel andrzej-stencel requested a review from leehinman June 3, 2024 08:00
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@andrzej-stencel andrzej-stencel merged commit e6e2778 into elastic:main Jun 3, 2024
3 checks passed
@andrzej-stencel andrzej-stencel deleted the update-client-go-to-v0.29 branch June 3, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants