Skip to content

Support enforceInTransit field in PubSubTopic MessageStoragePolicy#9700

Open
codebot-robot wants to merge 3 commits into
GoogleCloudPlatform:masterfrom
codebot-robot:issue_9649
Open

Support enforceInTransit field in PubSubTopic MessageStoragePolicy#9700
codebot-robot wants to merge 3 commits into
GoogleCloudPlatform:masterfrom
codebot-robot:issue_9649

Conversation

@codebot-robot

Copy link
Copy Markdown
Collaborator

This PR adds support for the enforceInTransit parameter under messageStoragePolicy in the PubSubTopic CRD (pubsubtopics.pubsub.cnrm.cloud.google.com).

Changes

  • Updated the local/vendored TPG Beta provider (resource_pubsub_topic.go) to add enforce_in_transit to the message_storage_policy schema, including its expander/flattener mapping helpers.
  • Added the EnforceInTransit *bool field under the MessageStoragePolicy struct in apis/pubsub/v1beta1/topic_types.go.
  • Added mapping logic for EnforceInTransit to pkg/controller/direct/pubsub/topic_mapper.go.
  • Promoted .message_storage_policy.enforce_in_transit to a SpecField in pkg/controller/direct/pubsub/topic_fuzzer.go.
  • Regenerated manifests (CRDs, DeepCopy functions, generated clients).
  • Updated the E2E golden tests for pubsubtopic to configure enforceInTransit: true during creation and enforceInTransit: false during update to verify correct handling in both states.

Fixes #9649

@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign xiaoweim for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@justinsb

Copy link
Copy Markdown
Collaborator

@maqiuyujoyce I think this works - adding to both controllers (I've just reassigned back to codebot-robot to regenerate the clients, I'm assuming). Mind taking a look with me (I did cross-check against the terraform code, but I'm not sure I'm much more competent than the AI here 😂 )

@justinsb justinsb requested a review from maqiuyujoyce June 11, 2026 11:17
@codebot-robot codebot-robot removed their assignment Jun 11, 2026
@justinsb

Copy link
Copy Markdown
Collaborator

We have a unit test failure:

=== NAME  TestSpecAndStatusToYAML
    utils.go:150: FAIL: unexpected diff in testdata/pubsubtopic-spec.yaml.golden:   (
          	"""
          	... // 6 identical lines
          	  allowedPersistenceRegions:
          	  - string
        + 	  enforceInTransit: boolean
          	resourceID: string
          	schemaSettings:
          	... // 6 identical lines
          	"""
          )
--- FAIL: TestSpecAndStatusToYAML (7.78s)

@codebot-robot codebot-robot removed their assignment Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support enforceInTransit field in PubSubTopic MessageStoragePolicy

2 participants