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

[Bug]: Crossplane does not detect drift in IP rules of storage account #881

Open
1 task done
deggja opened this issue Nov 28, 2024 · 1 comment
Open
1 task done
Labels
bug Something isn't working needs:triage

Comments

@deggja
Copy link

deggja commented Nov 28, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Affected Resource(s)

storage.azure.upbound.io/v1beta2

Resource MRs required to reproduce the bug

apiVersion: storage.azure.upbound.io/v1beta2
kind: Account
metadata:
  name: storage-account
spec:
  managementPolicies: ["Create", "Observe", "Update"]
  forProvider:
    accountKind: StorageV2
    accountReplicationType: ZRS
    accountTier: Standard
    publicNetworkAccessEnabled: false
    allowNestedItemsToBePublic: false
    sharedAccessKeyEnabled: false
    defaultToOauthAuthentication: true
    isHnsEnabled: false
    networkRules:
      ipRules: []
    blobProperties:
      containerDeleteRetentionPolicy:
        days: 7
      deleteRetentionPolicy:
        days: 7
    location: "my_region"
    resourceGroupNameRef:
      name: "resource_group"
  providerConfigRef:
    name: workload-identity-provider-config

Steps to Reproduce

Create a storage account managed resource with an empty ipRules list.

What happened?

The entire ipRules parameter is removed from the spec, and I believe this means reconciliation will not check for drift for this config. When setting an empty list you want the list to be empty, however, resource drift will not be caught as the controller never sees this drift because the empty list is not in the desired state.

Relevant Error Output Snippet

no error message, just unwanted resource drift in Azure.

Crossplane Version

1.18

Provider Version

1.9.0

Kubernetes Version

1.30.5

Kubernetes Distribution

AKS

Additional Info

No response

@deggja deggja added bug Something isn't working needs:triage labels Nov 28, 2024
@deggja
Copy link
Author

deggja commented Nov 29, 2024

I see this, which I suppose means that the list will not be included if empty.

IPRules []*string `json:"ipRules,omitempty" tf:"ip_rules,omitempty"`

EDIT:

I would be happy to make a PR and contribute to resolving this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs:triage
Projects
None yet
Development

No branches or pull requests

1 participant