Skip to content

Commit

Permalink
addressing pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mitali-salvi committed May 30, 2024
1 parent ab01933 commit 3e34bb5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 0 additions & 2 deletions internal/aws/k8s/k8sclient/clientset.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ func Get(logger *zap.Logger, options ...Option) *K8sClient {
err := k8sClient.init(logger, options...)
if err == nil {
optionsToK8sClient[strOptions] = k8sClient
} else {
optionsToK8sClient[strOptions] = nil
}
}
mu.Unlock()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,14 @@ func newNodeCapacity(logger *zap.Logger, options ...nodeCapacityOption) (nodeCap

ctx := context.Background()
if runtime.GOOS != ci.OperatingSystemWindows {
procPath := hostProc
if os.Getenv("RUN_ON_SYSTEMD") == "true" {
if _, err := nc.osLstat("/proc"); os.IsNotExist(err) {
return nil, err
}
} else {
if _, err := nc.osLstat(hostProc); os.IsNotExist(err) {
return nil, err
}
procPath = "/proc"
}
envMap := common.EnvMap{common.HostProcEnvKey: hostProc}
if _, err := nc.osLstat(procPath); os.IsNotExist(err) {
return nil, err
}
envMap := common.EnvMap{common.HostProcEnvKey: procPath}
ctx = context.WithValue(ctx, common.EnvKey, envMap)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func NewKubeletClient(kubeIP string, port string, kubeConfigPath string, logger
endpoint = endpoint + ":" + port

clientConfig := &kubelet.ClientConfig{}
if os.Getenv("RUN_ON_SYSTEMD") == "true" {
if kubeConfigPath != "" {
// use kube-config for authentication
clientConfig = &kubelet.ClientConfig{
APIConfig: k8sconfig.APIConfig{
Expand Down

0 comments on commit 3e34bb5

Please sign in to comment.