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
- 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
- Wait for the Queue to become active. OCI reports
channel-consumption-limit: 100.
- Change an unrelated mutable field such as
spec.displayName or spec.freeformTags.
- 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.
Summary
When a Queue is created without
spec.channelConsumptionLimit, OCI defaults the value to100. A later update to an unrelated mutable field causes OSOK to compare the observed value100with the Go zero value0and includechannelConsumptionLimit: 0inUpdateQueueDetails. 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
channelConsumptionLimit:channel-consumption-limit: 100.spec.displayNameorspec.freeformTags.Parameter is invalid or incorrectly formatted.Adding
spec.channelConsumptionLimit: 100before retrying allows the unrelated update to succeed.Root cause
QueueSpec.ChannelConsumptionLimitis a non-pointerintwithomitempty, so omission and the Go zero value are indistinguishable.buildQueueUpdateBodycompares the OCI-observed value withresource.Spec.ChannelConsumptionLimitand sends zero when they differ.Relevant files:
api/queue/v1beta1/queue_types.gopkg/servicemanager/queue/queue/queue_runtime.goExpected behavior
When
channelConsumptionLimitis 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
channelConsumptionLimit: 0.channelConsumptionLimitvalues continue to work.100, an omitted spec field, and an unrelated mutable update.channelConsumptionLimitsolely as a workaround.