Uploaded image for project: 'Red Hat Data Grid'
  1. Red Hat Data Grid
  2. JDG-5427

Subsequent Cache CR reconciliations fail with Cache Service #1581

XMLWordPrintable

      Creating a Cache CR for an Infinispan CR with `spec.service.type: Cache` will result in a Cache CR that always has the following Status:

      status: 
        conditions: 
        - message: cannot update an existing cache in a CacheService cluster
          status: "False"
          type: Ready
      

      Cache CR:

      apiVersion: infinispan.org/v2alpha1
      kind: Cache
      spec: 
        clusterName: test-cache-service
        name: cache-service
      

      Operator Logs repeated indefinitely:

      2022-06-29T16:37:46.409+0100	ERROR	controllers.Cache	Error updating cache	{"Request.Namespace": "namespace-for-testing", "Request.Name": "cache-service", "error": "cannot update an existing cache in a CacheService cluster"}
      

      This occurs as the cache_controller always throws the above error if a cache already exists on the server. In order to prevent this, we need to update the controller logic so that no action is taken if the cache already exists as all caches share the same configuration in the Cache Service, so if the cache exists then the Cache CR promise has been fulfilled.

              remerson@redhat.com Ryan Emerson
              remerson@redhat.com Ryan Emerson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: