[ Cmii ] [ Octopus ] - 实际项目
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package agent_operator
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@@ -82,6 +82,11 @@ func (op *CmiiK8sOperator) changeOperatorEnv(cmiiEnv string) {
|
||||
|
||||
// ok
|
||||
op.checkAndBuildCmiiK8sOperator()
|
||||
|
||||
// speed up
|
||||
if op.CurrentNamespace == cmiiEnv {
|
||||
return
|
||||
}
|
||||
// first key
|
||||
op.CurrentNamespace = ""
|
||||
|
||||
@@ -131,9 +136,9 @@ func (op *CmiiK8sOperator) changeOperatorEnv(cmiiEnv string) {
|
||||
log.InfoF("[k8s env] - current env is => %s", op.CurrentNamespace)
|
||||
}
|
||||
|
||||
func (op *CmiiK8sOperator) BuildCurrentClientFromConfig(realClientConfig string) {
|
||||
func (op *CmiiK8sOperator) BuildCurrentClientFromConfig(realClientConfig []byte) {
|
||||
log.InfoF("[BuildCurrentClientFromConfig] - build real k8s operator client !")
|
||||
realEnvConfig, err := clientcmd.RESTConfigFromKubeConfig([]byte(realClientConfig))
|
||||
realEnvConfig, err := clientcmd.RESTConfigFromKubeConfig(realClientConfig)
|
||||
if err != nil {
|
||||
msg := "[BuildCurrentClientFromConfig] - build real k8s operator error !"
|
||||
log.Error(msg)
|
||||
|
||||
Reference in New Issue
Block a user