Download kubectl to /opt/kops/bin on Flatcar OS

Also add it to protokube's PATH.

Our flatcar job is currently failing because channels arent being applied.
A newly added error log reports that kubectl isn't in protokube's PATH.

This adds the kubectl's location (/opt/bin) to protokube's PATH.

See https://storage.googleapis.com/kubernetes-jenkins/logs/e2e-kops-aws-distro-imageflatcar/1371379886664454144/artifacts/54.206.100.130/protokube.log
This commit is contained in:
Peter Rifel 2021-03-15 07:27:09 -05:00
parent 307c0ef6d2
commit b57318fc3d
No known key found for this signature in database
GPG Key ID: BC6469E5B16DB2B6
2 changed files with 6 additions and 1 deletions

View File

@ -398,7 +398,7 @@ func (c *NodeupModelContext) UseSecureKubelet() bool {
func (c *NodeupModelContext) KubectlPath() string {
kubeletCommand := "/usr/local/bin"
if c.Distribution == distributions.DistributionFlatcar {
kubeletCommand = "/opt/bin"
kubeletCommand = "/opt/kops/bin"
}
if c.Distribution == distributions.DistributionContainerOS {
kubeletCommand = "/home/kubernetes/bin"

View File

@ -461,6 +461,11 @@ func (t *ProtokubeBuilder) buildEnvFile() (*nodetasks.File, error) {
envVars[envVar.Name] = envVar.Value
}
switch t.Distribution {
case distributions.DistributionFlatcar:
envVars["PATH"] = fmt.Sprintf("/opt/kops/bin:%v", os.Getenv("PATH"))
}
var sysconfig = ""
for key, value := range envVars {
sysconfig += key + "=" + value + "\n"