cluster-api-provider-azure
cluster-api-provider-azure copied to clipboard
Migrate from "getting full resource to get tags" to "just getting tags at resource scope"
This is based on https://github.com/kubernetes-sigs/cluster-api-provider-azure/pull/1745#discussion_r741488690
For example, in this method
https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/1a16f42bc104b6a8f5931dcb36f7c5ca184ff4e3/azure/services/publicips/publicips.go#L142-L151
We need to replace GET public IP API call (s.Client.Get) with GET Tags At Scope API call with Public IP as scope to just get the tags as we want only tag data to check if Public IP is managed or not. A GET public IP API call is heavier with more data and hence unnecessary.
References -
GETpublic IP API call - https://docs.microsoft.com/en-us/rest/api/virtualnetwork/public-ip-addresses/getGETTags At Scope API call - https://docs.microsoft.com/en-us/rest/api/resources/tags/get-at-scope
cc @CecileRobertMichon
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale /help
@CecileRobertMichon: This request has been marked as needing help from a contributor.
Guidelines
Please ensure that the issue body includes answers to the following questions:
- Why are we solving this issue?
- To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
- Does this issue have zero to low barrier of entry?
- How can the assignee reach out to you for help?
For more details on the requirements of such an issue, please see here and ensure that they are met.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.
In response to this:
/remove-lifecycle stale /help
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.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
@Jont828 this might be a good one for you to pick up as a follow up from #1716 and #1716
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
Sorry I forgot about this, I can take a look and work on this soon.
/assign
@CecileRobertMichon @karuppiah7890 I'm currently taking a look at this and I had a couple things to clarify.
- Is the public IP scope in this case just the resource ID?
- Is the intended change to initialize the tags client and use that instead?
/remove-lifecycle rotten
- Yes, it should be
- Yes exactly. There is already a
GetAtScopefunction we can use.
Okay sounds good. I'll revisit #2210 as well and see if we can make some changes to the tags service to make it easier to use here.