-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delete randomly generated namespaces
Signed-off-by: chaunceyjiang <[email protected]>
- Loading branch information
1 parent
280e000
commit bfa4e95
Showing
8 changed files
with
96 additions
and
68 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
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
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
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,16 @@ | ||
package utils | ||
|
||
import ( | ||
installv1alpha1 "github.com/daocloud/karmada-operator/pkg/apis/install/v1alpha1" | ||
"github.com/daocloud/karmada-operator/pkg/constants" | ||
) | ||
|
||
func GetControlPlaneNamespace(kmd *installv1alpha1.KarmadaDeployment) string { | ||
if kmd.Spec.ControlPlane.Namespace != "" { | ||
return kmd.Spec.ControlPlane.Namespace | ||
} | ||
if ns, exist := kmd.Annotations[constants.RandomNamespace]; exist { | ||
return ns | ||
} | ||
return "default" | ||
} |