crossplane-contrib / provider-upjet-azure

Official Azure Provider for Crossplane by Upbound.
Apache License 2.0
60 stars 75 forks source link

[Bug]: MariaDB Server - skuName, version and sslEnforcementEnabled are required fields, but not documented as such #749

Closed bipe closed 1 week ago

bipe commented 4 months ago

Is there an existing issue for this?

Affected Resource(s)

Resource MRs required to reproduce the bug

For skuName field error:

apiVersion: dbformariadb.azure.upbound.io/v1beta1
kind: Server
metadata:
  labels:
    testing.upbound.io/example-name: example
  name: example-upbound-gp
spec:
  forProvider:
    administratorLogin: acctestun
    administratorLoginPasswordSecretRef:
      key: example-key
      name: example-secret
      namespace: namespace-test
    location: West Europe
    resourceGroupNameSelector:
      matchLabels:
        testing.upbound.io/example-name: example-dbformariadb
    sslEnforcementEnabled: true
    storageMb: 51200
    version: "10.2"

For version field error:

apiVersion: dbformariadb.azure.upbound.io/v1beta1
kind: Server
metadata:
  labels:
    testing.upbound.io/example-name: example
  name: example-upbound-gp
spec:
  forProvider:
    administratorLogin: acctestun
    administratorLoginPasswordSecretRef:
      key: example-key
      name: example-secret
      namespace: namespace-test
    location: West Europe
    resourceGroupNameSelector:
      matchLabels:
        testing.upbound.io/example-name: example-dbformariadb
    skuName: GP_Gen5_2
    sslEnforcementEnabled: true
    storageMb: 51200

For sslEnforcementEnabled field error:

apiVersion: dbformariadb.azure.upbound.io/v1beta1
kind: Server
metadata:
  labels:
    testing.upbound.io/example-name: example
  name: example-upbound-gp
spec:
  forProvider:
    administratorLogin: acctestun
    administratorLoginPasswordSecretRef:
      key: example-key
      name: example-secret
      namespace: namespace-test
    location: West Europe
    resourceGroupNameSelector:
      matchLabels:
        testing.upbound.io/example-name: example-dbformariadb
    skuName: GP_Gen5_2
    storageMb: 51200

Steps to Reproduce

Create a MariaDB Server using any of the provided manifests (or any manifest without the skuName, version or sslEnforcementEnabled fields). Note that you will need a secret to reference on spec.forProvider.administratorLoginPasswordSecretRef

What happened?

Required fields not listed as required in the documentation

The documentation on version 1.0.1 doesn't show the fields spec.forProvider.skuName, spec.forProvider.version and spec.forProvider.sslEnforcementEnabled as a required field, altough they're required. This is just a documentation bug.

skuName is required error on status

image

version is required error on status

image

sslEnforcementEnabled is required error on status

image

Upbound doc link: https://marketplace.upbound.io/providers/upbound/provider-azure-dbformariadb/v1.0.1/resources/dbformariadb.azure.upbound.io/Server/v1beta1 image

I'm already working on it. Will attach the PR soon.

Relevant Error Output Snippet

status:
  conditions:
    - lastTransitionTime: '2024-05-20T13:11:16Z'
      message: >-
        cannot compose resources: cannot apply composed resource "mdbserver":
        Server.dbformariadb.azure.upbound.io
        "nbra-dv-sysdemo-usea-mdb-9bwx4-jcwrx" is invalid: spec: Invalid value:
        "object": spec.forProvider.skuName is a required parameter
      reason: ReconcileError
      status: 'False'
      type: Synced
    - lastTransitionTime: '2024-05-20T12:39:16Z'
      message: 'Unready resources: customsecret'
      reason: Creating
      status: 'False'
      type: Ready
  connectionDetails:
    lastPublishedTime: '2024-05-20T12:39:16Z'
status:
  conditions:
    - lastTransitionTime: '2024-05-20T16:09:51Z'
      message: >-
        cannot compose resources: cannot apply composed resource "mdbserver":
        Server.dbformariadb.azure.upbound.io
        "nbra-dv-sysdemo-usea-mdb-v6n86-4f9qs" is invalid: spec: Invalid value:
        "object": spec.forProvider.version is a required parameter
      reason: ReconcileError
      status: 'False'
      type: Synced
    - lastTransitionTime: '2024-05-20T16:09:28Z'
      message: 'Unready resources: customsecret'
      reason: Creating
      status: 'False'
      type: Ready
  connectionDetails:
    lastPublishedTime: '2024-05-20T16:09:28Z'
status:
  conditions:
    - lastTransitionTime: '2024-05-20T16:13:12Z'
      message: >-
        cannot compose resources: cannot apply composed resource "mdbserver":
        Server.dbformariadb.azure.upbound.io
        "nbra-dv-sysdemo-usea-mdb-xq5jr-rtg4n" is invalid: spec: Invalid value:
        "object": spec.forProvider.sslEnforcementEnabled is a required parameter
      reason: ReconcileError
      status: 'False'
      type: Synced
  connectionDetails:
    lastPublishedTime: '2024-05-20T16:12:53Z'

Crossplane Version

1.45.5

Provider Version

1.0.1

Kubernetes Version

1.27

Kubernetes Distribution

AKS

Additional Info

No response

bipe commented 4 months ago

Added PR #750 . Please let me know if I can help with anything else.

turkenf commented 4 months ago

Hi @bipe,

Thank you for raising this issue. The reason why these fields do not appear required in the marketplace is that we can pass these fields in both spec.forProvider and spec.initProvider.

There are CEL rules in the CRD file regarding the conditions under which these fields are required and we have an internal issue to enable the showing of these kinds of fields in the marketplace.

turkenf commented 4 months ago

Blocked by the internal issue.

bipe commented 3 months ago

Oh I see. Thank you @turkenf . Should I leave this one open until the internal issue resolves?

turkenf commented 3 months ago

Should I leave this one open until the internal issue resolves?

Yes, it would be better to keep it open so it can be followed.

github-actions[bot] commented 3 weeks ago

This provider repo does not have enough maintainers to address every issue. Since there has been no activity in the last 90 days it is now marked as stale. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

github-actions[bot] commented 1 week ago

This issue is being closed since there has been no activity for 14 days since marking it as stale. If you still need help, feel free to comment or reopen the issue!