crossplane-contrib / provider-alibaba

Crossplane provider for Alibaba Cloud
Apache License 2.0
50 stars 18 forks source link

Alibaba: PostgreSQLInstance.database.crossplane.io "app-postgresql" is invalid: spec.engineVersion: Unsupported value: "10.0": supported values: "9.6", "11" #23

Closed zzxwill closed 3 years ago

zzxwill commented 4 years ago

What happened?

Followed provider-alibaba README to make demo for the PoC, I hit an issue.

➜  /Users/zhouzhengxi/Programming/golang/src/github.com/zzxwill/provider-alibaba git:(oss) k describe applicationconfiguration service-tracker-managed
Name:         service-tracker-managed
Namespace:    default
Labels:       <none>
Annotations:  API Version:  core.oam.dev/v1alpha2
Kind:         ApplicationConfiguration
Metadata:
  Creation Timestamp:  2020-05-27T08:30:52Z
  Generation:          1
  Managed Fields:
    API Version:  core.oam.dev/v1alpha2
    Fields Type:  FieldsV1
    fieldsV1:
      f:status:
        .:
        f:conditions:
    Manager:      crossplane
    Operation:    Update
    Time:         2020-05-27T08:30:52Z
    API Version:  core.oam.dev/v1alpha2
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .:
          f:kubectl.kubernetes.io/last-applied-configuration:
      f:spec:
        .:
        f:components:
    Manager:         kubectl
    Operation:       Update
    Time:            2020-05-27T08:30:52Z
  Resource Version:  8006
  Self Link:         /apis/core.oam.dev/v1alpha2/namespaces/default/applicationconfigurations/service-tracker-managed
  UID:               3e275c18-0148-4a69-b674-db40bf321a82
Spec:
  Components:
    Component Name:  tracker-managed-postgres-db
    Parameter Values:
      Name:          dbconn
      Value:         trackerdbconn
    Component Name:  data-api
    Parameter Values:
      Name:          dbsecret
      Value:         trackerdbconn
      Name:          dbname
      Value:         postgres
      Name:          dbport
      Value:         3433
      Name:          dbdriver
      Value:         postgres
      Name:          dboptions
      Value:
    Component Name:  flights-api
    Parameter Values:
      Name:   dataUri
      Value:  http://data-api.default.svc.cluster.local:3009/
    Traits:
      Trait:
        API Version:  core.oam.dev/v1alpha2
        Kind:         ManualScalerTrait
        Metadata:
          Name:  flights-api
        Spec:
          Replica Count:  2
    Component Name:       quakes-api
    Parameter Values:
      Name:   dataUri
      Value:  http://data-api.default.svc.cluster.local:3009/
    Traits:
      Trait:
        API Version:  core.oam.dev/v1alpha2
        Kind:         ManualScalerTrait
        Metadata:
          Name:  quakes-api
        Spec:
          Replica Count:  2
    Component Name:       weather-api
    Parameter Values:
      Name:   dataUri
      Value:  http://data-api.default.svc.cluster.local:3009/
    Traits:
      Trait:
        API Version:  core.oam.dev/v1alpha2
        Kind:         ManualScalerTrait
        Metadata:
          Name:  weather-api
        Spec:
          Replica Count:  2
    Component Name:       service-tracker-ui
    Parameter Values:
      Name:   flightsUri
      Value:  http://flights-api.default.svc.cluster.local:3003/
      Name:   weatherUri
      Value:  http://weather-api.default.svc.cluster.local:3015/
      Name:   quakesUri
      Value:  http://quakes-api.default.svc.cluster.local:3012/
Status:
  Conditions:
    Last Transition Time:  2020-05-27T08:30:52Z
    Message:               cannot apply components: cannot apply workload "app-postgresql": cannot create object: PostgreSQLInstance.database.crossplane.io "app-postgresql" is invalid: spec.engineVersion: Unsupported value: "10.0": supported values: "9.6", "11"
    Reason:                Encountered an error during resource reconciliation
    Status:                False
    Type:                  Synced
Events:
  Type     Reason                 Age                From                                       Message
  ----     ------                 ----               ----                                       -------
  Normal   RenderedComponents     7s (x6 over 2m7s)  oam/applicationconfiguration.core.oam.dev  Successfully rendered components
  Warning  CannotApplyComponents  7s (x6 over 2m7s)  oam/applicationconfiguration.core.oam.dev  cannot apply workload "app-postgresql": cannot create object: PostgreSQLInstance.database.crossplane.io "app-postgresql" is invalid: spec.engineVersion: Unsupported value: "10.0": supported values: "9.6", "11"

How can we reproduce it?

Followed provider-alibaba README

hasheddan commented 4 years ago

@zzxwill I am going to move this over to the provider-alibaba repo :+1:

zzxwill commented 4 years ago

By editing CustomResourceDefinition postgresqlinstances.database.crossplane.io and adding engineversion 9.4, I could deployed a PostgreSqlinstance successfully.

              engineVersion:
                description: 'EngineVersion specifies the desired PostgreSQL engine
                  version. Allowed Versions: 9.6 and 11.'
                enum:
                - "9.6"
                - "11"
                - "9.4"
                type: string

The RDS doc said The database engine and engine version that the RDS instance is running. Select PostgreSQL. Supported PostgreSQL versions are 9.4, 10, 11, and 12. So I plan to modify the lines near https://github.com/crossplane/crossplane/blob/master/cluster/charts/crossplane-types/crds/database.crossplane.io_postgresqlinstances.yaml#L147 by creating an PR.

zzxwill commented 4 years ago

@zzxwill I am going to move this over to the provider-alibaba repo 👍

Okay, thanks. I am hesitated to decide which repo should I open this issue, crossplane or provider-alibaba. By investigation above, the root cause might locate in this repo, so I created it here. But I think you are right with the transfer. Thanks.

zzxwill commented 4 years ago

Moreover, the English version of RDS creation specification is wrong, those allowed engine version should among 9.4/10.0/11.0/12.0 per the Chinese version which I also verified myself.

zzxwill commented 3 years ago

Implemented by the linked PR.