Skip to content

Conversation

@dn0
Copy link

@dn0 dn0 commented Jan 2, 2025

Motivation

This change adds public methods for managing offload policies at the namespace and topic level.
The main motivation is to later use these functions in the Terraform provider which we are planning to extend as well to be able to manage offloading policies via Terraform.

Modifications

I was trying to figure out the naming to be consistent with the REST API and other methods.
Feel free to suggest different naming structure.

Added the following methods:

  • Namespace:
// GetOffloadPolicies returns the offload configuration for a namespace
GetOffloadPolicies(namespace utils.NameSpaceName) (*utils.OffloadPolicies, error)

// SetOffloadPolicies sets the offload configuration on a namespace
SetOffloadPolicies(namespace utils.NameSpaceName, policy *utils.OffloadPolicies) error

// DeleteOffloadPolicies removes the offload configuration from a namespace
DeleteOffloadPolicies(namespace utils.NameSpaceName) error
  • Topic
// GetOffloadPolicies returns the offload configuration for a topic
GetOffloadPolicies(topic utils.TopicName, applied bool) (*utils.OffloadPolicies, error)

// SetOffloadPolicies sets the offload policy for a topic
SetOffloadPolicies(topic utils.TopicName, policy *utils.OffloadPolicies) error

// DeleteOffloadPolicies removes the offload configuration on a topic
DeleteOffloadPolicies(topic utils.TopicName) error

Verifying this change

This change added tests and can be verified as follows:

  • Added Go tests, which, however require a running cluster (part of the scripts/CI

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API: yes
  • The schema: don't know
  • The default values of configurations: yes
  • The wire protocol: no

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? GoDocs?

@dn0 dn0 marked this pull request as ready for review January 3, 2025 16:56
@shibd shibd added this to the v0.15.0 milestone Jan 17, 2025
@RobertIndie RobertIndie modified the milestones: v0.15.0, v0.16.0 May 15, 2025
@RobertIndie RobertIndie modified the milestones: v0.16.0, v0.17.0 Jul 29, 2025
@RobertIndie RobertIndie modified the milestones: v0.17.0, v0.18.0 Oct 23, 2025
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.

3 participants