MLE-22946: Fix the bug of cluster level labels propagate#94
Merged
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the label and annotation handling system to properly propagate cluster-level labels throughout the codebase. The main change replaces global variables for labels/annotations with context-based storage and methods, ensuring proper scoping and propagation.
Key changes:
- Replaces global label/annotation variables with context-scoped storage
- Adds new methods to ClusterContext and OperatorContext for label/annotation management
- Updates all resource generation functions to use context-based label retrieval
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/k8sutil/context.go | Adds label/annotation fields to contexts and implements getter/setter methods |
| pkg/k8sutil/common.go | Removes global variables and deprecated label/annotation functions |
| pkg/k8sutil/handler.go | Removes global label/annotation setup calls |
| pkg/k8sutil/service.go | Updates service generation to use context-based label retrieval |
| pkg/k8sutil/secret.go | Updates secret generation to use context-based label retrieval |
| pkg/k8sutil/networkPolicy.go | Updates network policy generation to use context-based label retrieval |
| pkg/k8sutil/marklogicServer.go | Updates MarkLogic group generation to use context-based label retrieval |
| pkg/k8sutil/ingress.go | Updates ingress generation to use context-based label retrieval |
| pkg/k8sutil/haProxy.go | Updates HAProxy configuration to use context-based label retrieval |
| pkg/k8sutil/configmap.go | Updates config map generation to use context-based label retrieval |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.