-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(coredns): preserving externally managed coredns addon (#571)
A bug has been introduced with #527 which doesn't handle properly all the required business logic, such as the application of customised labels, as well as the handling of the controller Resource. Signed-off-by: Dario Tranchitella <[email protected]>
- Loading branch information
1 parent
3351f73
commit 438639d
Showing
2 changed files
with
40 additions
and
37 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2022 Clastix Labs | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package addons | ||
|
||
import ( | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
|
||
"github.com/clastix/kamaji/internal/constants" | ||
"github.com/clastix/kamaji/internal/utilities" | ||
) | ||
|
||
func setKamajiManagedLabels(obj client.Object) { | ||
obj.SetLabels(utilities.MergeMaps(obj.GetLabels(), map[string]string{ | ||
constants.ProjectNameLabelKey: constants.ProjectNameLabelValue, | ||
})) | ||
} |