Uploaded image for project: 'Service Binding'
  1. Service Binding
  2. APPSVC-1318

Update ServiceCatalog on RegisteredService events

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Major Major
    • Primaza 0.1
    • None
    • Service Binding
    • None
    • 5
    • False
    • None
    • False
    • Hide
      Feature: Update ServiceCatalog on RegisteredService event

          Scenario: Add Registered Service to Service Catalog
              Given Primaza Cluster "main" is running
              And On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: ClusterEnvironment
              metadata:
                  name: worker
                  namespace: primaza-system
              spec:
                  environmentName: dev
                  clusterContextSecret: primaza-kw
              """
              When On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: RegisteredService
              metadata:
                name: primaza-rsdb
                namespace: primaza-system
              spec:
                serviceClassIdentity:
                  - name: type
                    value: psqlserver
                  - name: provider
                    value: aws
                serviceEndpointDefinition:
                  - name: host
                    value: mydavphost.io
                  - name: port
                    value: "5432"
                  - name: user
                    value: davp
                  - name: password
                    value: quedicelagente
                  - name: database
                    value: davpdata
                sla: L3
              """
              Then On Primaza Cluster "main", RegisteredService "primaza-rsdb" state will eventually move to "Available"
              And On Primaza Cluster "main", ServiceCatalog "dev" will contain RegisteredService "primaza-rsdb"

          Scenario: Update Registered Service in Service Catalog
              Given Primaza Cluster "main" is running
              And On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: ClusterEnvironment
              metadata:
                  name: worker
                  namespace: primaza-system
              spec:
                  environmentName: dev
                  clusterContextSecret: primaza-kw
              """
              And On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: RegisteredService
              metadata:
                name: primaza-rsdb
                namespace: primaza-system
              spec:
                serviceClassIdentity:
                  - name: type
                    value: psqlserver
                serviceEndpointDefinition:
                  - name: host
                    value: mydavphost.io
                  - name: port
                    value: "5432"
                  - name: user
                    value: davp
                  - name: password
                    value: quedicelagente
                  - name: database
                    value: davpdata
                sla: L3
              """
              And On Primaza Cluster "main", RegisteredService "primaza-rsdb" state will eventually move to "Available"
              And On Primaza Cluster "main", ServiceCatalog "dev" will contain RegisteredService "primaza-rsdb"
              When On Primaza Cluster "main", Resource is updated
              """
              apiVersion: primaza.io/v1alpha1
              kind: RegisteredService
              metadata:
                name: primaza-rsdb
                namespace: primaza-system
              spec:
                serviceClassIdentity:
                  - name: type
                    value: psqlserver
                  - name: provider
                    value: aws
                serviceEndpointDefinition:
                  - name: host
                    value: mydavphost.io
                  - name: port
                    value: "5432"
                  - name: user
                    value: davp
                  - name: password
                    value: quedicelagente
                  - name: database
                    value: davpdata
                sla: L3
              """
              Then On Primaza Cluster "main", ServiceCatalog "dev" has RegisteredService "primaza-rsdb" with Service Class Identity "provider=aws"

          Scenario: Remove Registered Service from Service Catalog
              Given Primaza Cluster "main" is running
              And On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: ClusterEnvironment
              metadata:
                  name: worker
                  namespace: primaza-system
              spec:
                  environmentName: dev
                  clusterContextSecret: primaza-kw
              """
              And On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: RegisteredService
              metadata:
                name: primaza-rsdb
                namespace: primaza-system
              spec:
                serviceClassIdentity:
                  - name: type
                    value: psqlserver
                  - name: provider
                    value: aws
                serviceEndpointDefinition:
                  - name: host
                    value: mydavphost.io
                  - name: port
                    value: "5432"
                  - name: user
                    value: davp
                  - name: password
                    value: quedicelagente
                  - name: database
                    value: davpdata
                sla: L3
              """
              And On Primaza Cluster "main", RegisteredService "primaza-rsdb" state will eventually move to "Available"
              And On Primaza Cluster "main", ServiceCatalog "dev" will contain RegisteredService "primaza-rsdb"
              When On Primaza Cluster "main", RegisteredService "primaza-rsdb" is deleted
              Then On Primaza Cluster "main", ServiceCatalog "dev" does not contain RegisteredService "primaza-rsdb"

          Scenario: Registered Service is not added in unmatched Service Catalog
              Given Primaza Cluster "main" is running
              And On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: ClusterEnvironment
              metadata:
                  name: worker
                  namespace: primaza-system
              spec:
                  environmentName: dev
                  clusterContextSecret: primaza-kw
              """
              When And On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: RegisteredService
              metadata:
                name: primaza-rsdb
                namespace: primaza-system
              spec:
                serviceClassIdentity:
                  - name: type
                    value: psqlserver
                  - name: provider
                    value: aws
                serviceEndpointDefinition:
                  - name: host
                    value: mydavphost.io
                  - name: port
                    value: "5432"
                  - name: user
                    value: davp
                  - name: password
                    value: quedicelagente
                  - name: database
                    value: davpdata
                constraints:
                  environments:
                    - !dev
                sla: L3
              """
              Then On Primaza Cluster "main", ServiceCatalog "dev" does not contain RegisteredService "primaza-rsdb"
      Show
      Feature: Update ServiceCatalog on RegisteredService event     Scenario: Add Registered Service to Service Catalog         Given Primaza Cluster "main" is running         And On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: ClusterEnvironment         metadata:             name: worker             namespace: primaza-system         spec:             environmentName: dev             clusterContextSecret: primaza-kw         """         When On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: RegisteredService         metadata:           name: primaza-rsdb           namespace: primaza-system         spec:           serviceClassIdentity:             - name: type               value: psqlserver             - name: provider               value: aws           serviceEndpointDefinition:             - name: host               value: mydavphost.io             - name: port               value: "5432"             - name: user               value: davp             - name: password               value: quedicelagente             - name: database               value: davpdata           sla: L3         """         Then On Primaza Cluster "main", RegisteredService "primaza-rsdb" state will eventually move to "Available"         And On Primaza Cluster "main", ServiceCatalog "dev" will contain RegisteredService "primaza-rsdb"     Scenario: Update Registered Service in Service Catalog         Given Primaza Cluster "main" is running         And On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: ClusterEnvironment         metadata:             name: worker             namespace: primaza-system         spec:             environmentName: dev             clusterContextSecret: primaza-kw         """         And On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: RegisteredService         metadata:           name: primaza-rsdb           namespace: primaza-system         spec:           serviceClassIdentity:             - name: type               value: psqlserver           serviceEndpointDefinition:             - name: host               value: mydavphost.io             - name: port               value: "5432"             - name: user               value: davp             - name: password               value: quedicelagente             - name: database               value: davpdata           sla: L3         """         And On Primaza Cluster "main", RegisteredService "primaza-rsdb" state will eventually move to "Available"         And On Primaza Cluster "main", ServiceCatalog "dev" will contain RegisteredService "primaza-rsdb"         When On Primaza Cluster "main", Resource is updated         """         apiVersion: primaza.io/v1alpha1         kind: RegisteredService         metadata:           name: primaza-rsdb           namespace: primaza-system         spec:           serviceClassIdentity:             - name: type               value: psqlserver             - name: provider               value: aws           serviceEndpointDefinition:             - name: host               value: mydavphost.io             - name: port               value: "5432"             - name: user               value: davp             - name: password               value: quedicelagente             - name: database               value: davpdata           sla: L3         """         Then On Primaza Cluster "main", ServiceCatalog "dev" has RegisteredService "primaza-rsdb" with Service Class Identity "provider=aws"     Scenario: Remove Registered Service from Service Catalog         Given Primaza Cluster "main" is running         And On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: ClusterEnvironment         metadata:             name: worker             namespace: primaza-system         spec:             environmentName: dev             clusterContextSecret: primaza-kw         """         And On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: RegisteredService         metadata:           name: primaza-rsdb           namespace: primaza-system         spec:           serviceClassIdentity:             - name: type               value: psqlserver             - name: provider               value: aws           serviceEndpointDefinition:             - name: host               value: mydavphost.io             - name: port               value: "5432"             - name: user               value: davp             - name: password               value: quedicelagente             - name: database               value: davpdata           sla: L3         """         And On Primaza Cluster "main", RegisteredService "primaza-rsdb" state will eventually move to "Available"         And On Primaza Cluster "main", ServiceCatalog "dev" will contain RegisteredService "primaza-rsdb"         When On Primaza Cluster "main", RegisteredService "primaza-rsdb" is deleted         Then On Primaza Cluster "main", ServiceCatalog "dev" does not contain RegisteredService "primaza-rsdb"     Scenario: Registered Service is not added in unmatched Service Catalog         Given Primaza Cluster "main" is running         And On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: ClusterEnvironment         metadata:             name: worker             namespace: primaza-system         spec:             environmentName: dev             clusterContextSecret: primaza-kw         """         When And On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: RegisteredService         metadata:           name: primaza-rsdb           namespace: primaza-system         spec:           serviceClassIdentity:             - name: type               value: psqlserver             - name: provider               value: aws           serviceEndpointDefinition:             - name: host               value: mydavphost.io             - name: port               value: "5432"             - name: user               value: davp             - name: password               value: quedicelagente             - name: database               value: davpdata           constraints:             environments:               - !dev           sla: L3         """         Then On Primaza Cluster "main", ServiceCatalog "dev" does not contain RegisteredService "primaza-rsdb"
    • AppSvc Sprint 235, AppSvc Sprint 236, AppSvc Sprint 237

      Owner: Architect:

      Francesco Ilario

      Story (Required)

      As a Primaza Developer,
      I would like Primaza to update the impacted Service Catalogs when a Registered Service's event is processed
      so that Service Catalogs are up to date

      Background (Required)

      As of now, a single Service Catalog is maintained by Primaza.
      In the process of splitting the single Service Catalog in one per each environment we need to update the Registered Service controller's logic.

      See epic for arch document link.

      Glossary

      See glossary in architecture document

      Out of scope

      • NA

      In Scope

      • update documentation
      • update multiple service catalogs

      Approach(Required)

      When a Registered Service is created, updated, or deleted, the Registered Service controller should retrieve all the matching Service Catalogs and update them.
      A Service Catalog is a match if its environment matches the constraints of the Registered Service.
      The logic to check the match is already implemented at pkg/envtag.

      The controller must try to update all the matching Service Catalogs, collect all the errors and return a joined error (i.e. errrors.Join).

      Demo requirements(Required)

      NA

      Dependencies

      Edge Case

      NA

      BDD Tests

      You can find BDD Test specification for this story in the "Testing Instruction" Field Tab or in the GitHub Issue linked to this story.
      Click here for all BDD Tests Issues.

      Acceptance Criteria

      • Development
        RegisteredService controller updates matching ServiceCatalogs
      • QE
        There are test cases for updates of Service Catalogs
      • Docs
        There is a Section in our Service Catalog doc dedicated to explaining how they are updated
        Update architecture document with any changes while implementing

      INVEST Checklist

      Dependencies identified
      Blockers noted and expected delivery timelines set
      Design is implementable
      Acceptance criteria agreed upon
      Story estimated

      Legend

      Unknown
      Verified
      Unsatisfied

              dperaza@redhat.com David Peraza
              rh-ee-filario Francesco Ilario
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: