Skip to content

Unable to unset filter subjects on a Consumer #244

@mjhoffman65

Description

@mjhoffman65

What version were you using?

I've recreated this issue with NACK versions1.15.0 and 1.17.1.

What environment was the server running in?

nats:2.10.18-alpine

Is this defect reproducible?

Removing the FilterSubjects field on a NATS Consumer custom resource's spec does not update the field on the actual NATS consumer. The server is running on version

To recreate, first create a Stream and Consumer with FilterSubjects set.

apiVersion: jetstream.nats.io/v1beta2
kind: Stream
metadata:
  name: test
spec:
  allowDirect: false
  allowRollup: false
  compression: ""
  creds: ""
  denyDelete: false
  discard: old
  discardPerSubject: false
  firstSequence: 0
  maxAge: ""
  maxBytes: -1
  maxConsumers: -1
  maxMsgSize: -1
  maxMsgs: -1
  maxMsgsPerSubject: 0
  name: test
  nkey: ""
  noAck: false
  preventDelete: false
  preventUpdate: false
  replicas: 3
  retention: limits
  storage: file
  subjects:
    - TEST.filter1
    - TEST.filter2
    - TEST.filter3
---
apiVersion: jetstream.nats.io/v1beta2
kind: Consumer
metadata:
  annotations:
    alert-group: test
  name: test
spec:
  ackPolicy: explicit
  ackWait: 15s
  creds: ""
  deliverPolicy: all
  durableName: test
  filterSubjects: [test.filter1, test.filter2]
  flowControl: false
  headersOnly: false
  maxAckPending: -1
  maxDeliver: 10
  memStorage: false
  nkey: ""
  preventDelete: false
  preventUpdate: false
  replayPolicy: instant
  streamName: test

Notice that the filter subjects is set on the provisioned consumer.

Image

Remove the FilterSubjects field and apply this to the cluster.

apiVersion: jetstream.nats.io/v1beta2
kind: Consumer
metadata:
  annotations:
    alert-group: test
  name: test
spec:
  ackPolicy: explicit
  ackWait: 15s
  creds: ""
  deliverPolicy: all
  durableName: test
  flowControl: false
  headersOnly: false
  maxAckPending: -1
  maxDeliver: 9
  memStorage: false
  nkey: ""
  preventDelete: false
  preventUpdate: false
  replayPolicy: instant
  streamName: test

Notice that the filter subjects has not changed even though the consumer has been updated (maxDeliver changed to 9).

Image

Given the capability you are leveraging, describe your expectation?

I'm expecting to be able to unset the FilterSubjects property on a consumer via the custom resource.

Given the expectation, what is the defect you are observing?

I'm not able to unset FilterSubjects property on a stream via the custom resource by removing the field. Setting it to [""] works, but this isn't very clean.

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectSuspected defect such as a bug or regression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions