Skip to content

Queue update sends channelConsumptionLimit=0 when the field was omitted #84

Description

@HaoyL666

Summary

When a Queue is created without spec.channelConsumptionLimit, OCI defaults the value to 100. A later update to an unrelated mutable field causes OSOK to compare the observed value 100 with the Go zero value 0 and include channelConsumptionLimit: 0 in UpdateQueueDetails. OCI rejects the update with HTTP 400.

This was found during live CRUD regression testing. The Queue runtime path is unchanged from main, so this is not caused by OKE-44460.

Reproduction

  1. Install the Queue package and create a Queue without channelConsumptionLimit:
apiVersion: queue.oracle.com/v1beta1
kind: Queue
metadata:
  name: queue-default-channel-limit
spec:
  compartmentId: <compartment-ocid>
  displayName: queue-default-channel-limit
  visibilityInSeconds: 30
  timeoutInSeconds: 20
  1. Wait for the Queue to become active. OCI reports channel-consumption-limit: 100.
  2. Change an unrelated mutable field such as spec.displayName or spec.freeformTags.
  3. Reconciliation fails with OCI HTTP 400: Parameter is invalid or incorrectly formatted.

Adding spec.channelConsumptionLimit: 100 before retrying allows the unrelated update to succeed.

Root cause

QueueSpec.ChannelConsumptionLimit is a non-pointer int with omitempty, so omission and the Go zero value are indistinguishable. buildQueueUpdateBody compares the OCI-observed value with resource.Spec.ChannelConsumptionLimit and sends zero when they differ.

Relevant files:

  • api/queue/v1beta1/queue_types.go
  • pkg/servicemanager/queue/queue/queue_runtime.go

Expected behavior

When channelConsumptionLimit is omitted, updates to other fields should preserve the OCI default and should not include zero for this field in the update request. Explicit user intent must remain distinguishable from omission.

Acceptance criteria

  • An unrelated update after creating a Queue with the field omitted does not send channelConsumptionLimit: 0.
  • Explicit updates to supported channelConsumptionLimit values continue to work.
  • A unit test covers OCI-observed default 100, an omitted spec field, and an unrelated mutable update.
  • Live Queue create, update, and delete succeeds without adding channelConsumptionLimit solely as a workaround.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions