Skip to content

Replace autorest/to with k8s.io/utils/ptr#8723

Merged
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
mboersma:go-autorest-deprecated
Oct 31, 2025
Merged

Replace autorest/to with k8s.io/utils/ptr#8723
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
mboersma:go-autorest-deprecated

Conversation

@mboersma
Copy link
Contributor

What type of PR is this?

/kind cleanup
/kind deprecation

What this PR does / why we need it:

Replaces usages of the deprecated github.com/Azure/go-autorest/autorest/to package with k8s.io/utils/ptr.

Which issue(s) this PR fixes:

Refs #8145.

Special notes for your reviewer:

Does this PR introduce a user-facing change?

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. kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area labels Oct 31, 2025
@k8s-ci-robot k8s-ci-robot added area/cluster-autoscaler area/provider/azure Issues or PRs related to azure provider size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/needs-area labels Oct 31, 2025
github.com/Azure/go-autorest/autorest/adal v0.9.24
github.com/Azure/go-autorest/autorest/azure/auth v0.5.13
github.com/Azure/go-autorest/autorest/date v0.3.0
github.com/Azure/go-autorest/autorest/to v0.4.0
Copy link
Contributor

Choose a reason for hiding this comment

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

🥳

if vmPoolName == nil {
continue
if vmPoolName != nil {
instances[*vmPoolName] = append(instances[*vmPoolName], instance)
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

strings.EqualFold(ptr.Deref(manualProfile.Sizes[0], ""), vmSku) {
klog.V(5).Infof("Found matching manual profile for VM SKU: %s, updating count to: %d", vmSku, count)
manualProfile.Count = to.Int32Ptr(count)
manualProfile.Count = ptr.To(count)
Copy link
Contributor

Choose a reason for hiding this comment

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

fwiw reading over this is what made me think we don't need to to cast if the inputted variable already fulfills the type requirement (the output from ptr.To will match that same type)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the PR to remove the two optional casts to [int64].

Copy link
Contributor

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

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

left some nit feedback for a few items

@mboersma mboersma force-pushed the go-autorest-deprecated branch from 72753c2 to c6ecc43 Compare October 31, 2025 17:41
Copy link
Contributor

@jackfrancis jackfrancis 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 k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 31, 2025
@mboersma mboersma force-pushed the go-autorest-deprecated branch from c6ecc43 to 3c9e7b6 Compare October 31, 2025 20:39
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 31, 2025
@mboersma mboersma force-pushed the go-autorest-deprecated branch from 3c9e7b6 to f28ee6e Compare October 31, 2025 20:45
Copy link
Contributor

@jackfrancis jackfrancis 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 k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 31, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jackfrancis, mboersma

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 merged commit f7fc231 into kubernetes:master Oct 31, 2025
8 of 9 checks passed
@mboersma mboersma deleted the go-autorest-deprecated branch October 31, 2025 21:08
@jackfrancis
Copy link
Contributor

/cherry-pick cluster-autoscaler-release-1.34

@k8s-infra-cherrypick-robot

@jackfrancis: new pull request created: #8730

Details

In response to this:

/cherry-pick cluster-autoscaler-release-1.34

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-sigs/prow repository.

@jackfrancis
Copy link
Contributor

/cherry-pick cluster-autoscaler-release-1.33

@k8s-infra-cherrypick-robot

@jackfrancis: new pull request created: #8731

Details

In response to this:

/cherry-pick cluster-autoscaler-release-1.33

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-sigs/prow repository.

@jackfrancis
Copy link
Contributor

/cherry-pick cluster-autoscaler-release-1.32

@k8s-infra-cherrypick-robot

@jackfrancis: #8723 failed to apply on top of branch "cluster-autoscaler-release-1.32":

Applying: Replace autorest/to with k8s.io/utils/ptr
Using index info to reconstruct a base tree...
M	cluster-autoscaler/cloudprovider/azure/azure_vms_pool.go
M	cluster-autoscaler/go.mod
Falling back to patching base and 3-way merge...
Auto-merging cluster-autoscaler/go.mod
CONFLICT (content): Merge conflict in cluster-autoscaler/go.mod
Auto-merging cluster-autoscaler/cloudprovider/azure/azure_vms_pool.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Replace autorest/to with k8s.io/utils/ptr

Details

In response to this:

/cherry-pick cluster-autoscaler-release-1.32

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-sigs/prow repository.

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. area/cluster-autoscaler area/provider/azure Issues or PRs related to azure provider 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. kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. 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/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.

4 participants