Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for managing offload policies in namespaces and topics #1324

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
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.

2 participants