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

Use k8s utils/pointer instead of Azure autorest/to #3026

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

mboersma
Copy link
Contributor

@mboersma mboersma commented Jan 12, 2023

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Replaces usage of the github.com/Azure/go-autorest/autorest/to package with k8s.io/utils/pointer and a couple small helper funcs. This makes forward progress toward removing usage of Azure/go-autorest, which will soon be unsupported.

In general, the changes here consist of:

autorest/to utils/pointer
to.StringPtr pointer.String
to.Float64Ptr pointer.Float64
...etc
to.String pointer.StringDeref
to.Int32 pointer.Int32Deref
...etc
to.StringSlicePtr &
to.StringSlice (local) azure.StringSlice
to.StringMapPtr (local) azure.StringMapPtr

See kubernetes-sigs/cloud-provider-azure#2983 for comparison.

Which issue(s) this PR fixes:

Refs #2974

Special notes for your reviewer:

This changeset is huge; I'd be glad to break it up into multiple PRs if that helps with reviewing.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 12, 2023
@mboersma
Copy link
Contributor Author

/retest-required

@mboersma
Copy link
Contributor Author

/milestone v1.8

@k8s-ci-robot k8s-ci-robot added this to the v1.8 milestone Jan 12, 2023
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 14, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 17, 2023
@mboersma
Copy link
Contributor Author

/test pull-cluster-api-provider-azure-e2e-exp

AKS provisioning failure, unrelated to this code change.

@mboersma
Copy link
Contributor Author

/hold

Let's wait until #2959 merges first.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 17, 2023
@nawazkh
Copy link
Member

nawazkh commented Jan 17, 2023

Checked for to. usage in the codebase and I did not find any usage of to. for pointer conversions or vice versa.
Checked for autorest. usage in the codebase and I did not find any references to pointer conversion calls.

However, I do see one indirect reference to github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect in go.mod. Should we be concerned about it?

@CecileRobertMichon
Copy link
Contributor

/hold cancel
/retest

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 19, 2023
@CecileRobertMichon
Copy link
Contributor

/retest

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 19, 2023
@jackfrancis
Copy link
Contributor

@mboersma I owe you a 🍺

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 22, 2023
Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

@mboersma mboersma force-pushed the replace-to-ptr branch 2 times, most recently from 2b665e1 to 9a1f8de Compare January 25, 2023 21:25
@mboersma
Copy link
Contributor Author

Rebased after #3093 changed go.mod.

Copy link
Contributor

@willie-yao willie-yao left a comment

Choose a reason for hiding this comment

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

/lgtm

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

LGTM label has been added.

Git tree hash: f58be496c4eafc2d1769e8c702b098db24526d93

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 26, 2023
@mboersma
Copy link
Contributor Author

mboersma commented Jan 26, 2023

I had to rebase again for changes in main, and I replaced some pre-existing usages of pointer.Int32Ptr with pointer.Int32 (and so on).

@mboersma
Copy link
Contributor Author

/retest-required

1 similar comment
@mboersma
Copy link
Contributor Author

/retest-required

@mboersma
Copy link
Contributor Author

mboersma commented Jan 27, 2023

This PR is old enough now that prow may hold it hostage because the pull-cluster-api-provider-azure-e2e-exp job didn't pass (and it never will because it's the -aks job now). So it may have to be admin-merged.

@willie-yao
Copy link
Contributor

/lgtm

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

LGTM label has been added.

Git tree hash: 3a4ecc32070ec3adbfb24a69d8ccf0bdd0e68aac

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon

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 Jan 31, 2023
@mboersma
Copy link
Contributor Author

mboersma commented Feb 1, 2023

/retest-required

@k8s-ci-robot
Copy link
Contributor

@mboersma: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-azure-e2e-exp 195dfaa link false /test pull-cluster-api-provider-azure-e2e-exp
pull-cluster-api-provider-azure-e2e 608297d link true /test pull-cluster-api-provider-azure-e2e

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@mboersma
Copy link
Contributor Author

mboersma commented Feb 1, 2023

/retest

@k8s-ci-robot k8s-ci-robot merged commit 6d099b0 into kubernetes-sigs:main Feb 1, 2023
@mboersma mboersma deleted the replace-to-ptr branch February 1, 2023 16:09
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants