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

ManagedIdentities: The api-version '2022-01-31-preview' is invalid. #630

Closed
pmdevers opened this issue Jan 17, 2024 · 3 comments
Closed

Comments

@pmdevers
Copy link

pmdevers commented Jan 17, 2024

What happened?

managedidentities.ManagedIdentitiesClient#UserAssignedIdentitiesGet:
Failure responding to request: StatusCode=400 -- Original Error:
autorest/azure: Service returned an error. Status=400
Code="InvalidApiVersionParameter" Message="The api-version
'2022-01-31-preview' is invalid. The supported versions are
'2023-07-01,2023-07-01-preview,2023-03-01-preview,2022-12-01,2022-11-01-preview,2022-09-01,2022-06-01,2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'."
checking for the presence of an existing User Assigned Identity

How can we reproduce it?

Used the following manifest

apiVersion: managedidentity.azure.upbound.io/v1beta1
kind: UserAssignedIdentity
metadata:
  name: aab-drt-neu-cluster-identity
spec:
  forProvider:
    location: North Europe
    name: aab-drt-neu-cluster-identity
  providerConfigRef:
    name: aab-drt-sub-01
  publishConnectionDetailsTo:
    name: aab-drt-neu-cluster-identity

What environment did it happen in?

  • Crossplane Version: 1.14.5
  • Provider Version: v0.41
  • Kubernetes Version: 1.28.3
  • Kubernetes Distribution: AKS
@pmdevers pmdevers added bug Something isn't working needs:triage labels Jan 17, 2024
@pmdevers pmdevers changed the title The api-version '2022-01-31-preview' is invalid. ManagedIdentities: The api-version '2022-01-31-preview' is invalid. Jan 17, 2024
@turkenf
Copy link
Collaborator

turkenf commented Jan 18, 2024

Hi @pmdevers,

The resourceGroupName is a required parameter, please try the following YAML file:

apiVersion: managedidentity.azure.upbound.io/v1beta1
kind: UserAssignedIdentity
metadata:
  name: aab-drt-neu-cluster-identity
spec:
  forProvider:
    location: North Europe
    name: aab-drt-neu-cluster-identity
    resourceGroupNameSelector:
      matchLabels:
        testing.upbound.io/example-name: managidentity-rg

---

apiVersion: azure.upbound.io/v1beta1
kind: ResourceGroup
metadata:
  annotations:
    meta.upbound.io/example-id: managedidentity/v1beta1/userassignedidentity
  labels:
    testing.upbound.io/example-name: managidentity-rg
  name: managidentity-rg
spec:
  forProvider:
    location: North Europe

@pmdevers
Copy link
Author

Thanks!!, that was it

@brovoca
Copy link

brovoca commented Feb 9, 2024

I've encountered the same issue during creation of a KubernetesCluster where resourceGroupNameSelector is used, and the RG definitely exists. The status is only reported for a brief amount of time and is very confusing.

apiVersion: containerservice.azure.upbound.io/v1beta1
kind: KubernetesCluster
spec:
  forProvider:
    resourceGroupNameSelector:
      matchControllerRef: true
      matchLabels:
        resource-group: cluster
status:
  atProvider: {}
  conditions:
  - lastTransitionTime: "2024-02-09T12:29:46Z"
    message: |-
      async create failed: failed to create the resource: [{0 checking for presence of existing Managed Cluster (Subscription: "d3793524-71ca-4aa2-ac73-19284641f6d0"
      Resource Group Name: ""
      Managed Cluster Name: "g5n-cl-dev-01-xx8fg-qd48t"): managedclusters.ManagedClustersClient#Get: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="InvalidApiVersionParameter" Message="The api-version '2023-02-02-preview' is invalid. The supported versions are '2023-07-01,2023-07-01-preview,2023-03-01-preview,2022-12-01,2022-11-01-preview,2022-09-01,2022-06-01,2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'."  []}]
    reason: AsyncCreateFailure
    status: "False"
    type: LastAsyncOperation

Only the relevant sections of the managed resource have been presented for brevity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants