Skip to content

P0lskay/issue182 Add support for customizable labels on Vector resources#185

Merged
dkhachyan merged 1 commit into
kaasops:mainfrom
P0lskay:P0lskay/issue182
Apr 26, 2025
Merged

P0lskay/issue182 Add support for customizable labels on Vector resources#185
dkhachyan merged 1 commit into
kaasops:mainfrom
P0lskay:P0lskay/issue182

Conversation

@P0lskay

@P0lskay P0lskay commented Apr 18, 2025

Copy link
Copy Markdown
Contributor
  1. Customizable labels on Vector resources: We've added the ability to modify labels on Vector resources, providing more flexibility in managing and filtering resources.
  2. New method for selector labels: To avoid potential immutability issues with the selector field in DaemonSet resources, we've created a separate method that returns a set of labels specifically for selectors. This ensures that the operator can safely update labels without encountering errors.
  3. New field for labels in Vector and VectorAggregator CRDs: We've added a new labels field to the Vector and VectorAggregator CRDs, allowing users to specify custom labels for these resources.
  4. Updated documentation: We've added information about label and annotation parameters to the documentation, providing users with clear guidance on how to utilize these features.
  5. These changes enhance the overall functionality and usability of the Vector Operator, making it easier for users to manage and customize their Vector resources.

Related issues: #182

Changes:

  • Added labels field to Vector and VectorAggregator CRDs
  • Introduced a new method for returning selector labels
  • Updated documentation to include information on label and annotation parameters
  • Modified the operator to support customizable labels on Vector resources

@dkhachyan

Copy link
Copy Markdown
Collaborator

Thank you for the pull request!

I've reviewed it and everything looks good. Maybe we could create a separate function for adding labels? Something like this:

func AddLabels(dst, src map[string]string) {
    if dst == nil {
        dst = make(map[string]string)
    }
    
    for k, v := range src {
        if _, ok := dst[k]; !ok {
            dst[k] = v
        }
    }
}

We could save it here, for example:
https://github.com/kaasops/vector-operator/blob/main/internal/utils/k8s/label.go

@P0lskay

P0lskay commented Apr 26, 2025

Copy link
Copy Markdown
Contributor Author

@dkhachyan Great idea, thanks! I have already added the function of merging labels in commit 187e41b. If it's ok, then I think we can merge this PullRequest.

@dkhachyan dkhachyan self-requested a review April 26, 2025 15:10

@dkhachyan dkhachyan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Fixes kaasops#182

Update labels definition for all resources
Fixes kaasops#182

Update manifests and code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations

Update documentation

Add individual method for matchLabels

Update description for labels field in CRDs

Fix specification.md

Update CRDs in helm chart

Create new function MergeLabels for merging of labels :)
@dkhachyan dkhachyan merged commit 50a7a4a into kaasops:main Apr 26, 2025
zvlb pushed a commit that referenced this pull request May 28, 2026
P0lskay/issue182 Add support for customizable labels on Vector resources
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