FIX: fixed a bug where the classes are fixed to a namespace
This commit is contained in:
@@ -21,6 +21,7 @@ namespace kubecontrol
|
||||
YAML::Node config = YAML::LoadFile(pathToKubectlConfig);
|
||||
|
||||
BearerToken_ = config["users"][0]["user"]["token"].as<std::string>();
|
||||
Namespace_ = config["contexts"][0]["context"]["namespace"].as<std::string>();
|
||||
|
||||
char * KUBERNETES_SERVICE_HOST = std::getenv("KUBERNETES_SERVICE_HOST");
|
||||
char * KUBERNETES_SERVICE_PORT = std::getenv("KUBERNETES_SERVICE_PORT");
|
||||
@@ -35,7 +36,7 @@ namespace kubecontrol
|
||||
ServerAddress_ = config["clusters"][0]["cluster"]["server"].as<std::string>();
|
||||
}
|
||||
|
||||
ApiCall_ = "/api/v1/namespaces/hwinkel/pods/";
|
||||
ApiCall_ = "/api/v1/namespaces/"+Namespace_+"/pods/";
|
||||
} catch (std::exception& e) {
|
||||
LOG_S(ERROR)<< e.what();
|
||||
throw e.what();
|
||||
|
||||
Reference in New Issue
Block a user