Skip to content

Commit 4d4fc0d

Browse files
authored
Merge pull request #841 from ecpullen/aws-version-fix
eks: Update the authenticator version to v1beta1
2 parents c92b03e + cc81525 commit 4d4fc0d

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ ENTRYPOINT ["./vsphere-vm-resource-agent"]
118118
# =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^=
119119
# Builds the EKS resource agent image
120120
FROM public.ecr.aws/amazonlinux/amazonlinux:2 as eks-resource-agent
121+
RUN yum install -y unzip
122+
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
123+
unzip awscliv2.zip && \
124+
./aws/install
121125

122126
# Copy eksctl
123127
COPY --from=tools /eksctl /usr/bin/eksctl

bottlerocket/agents/src/bin/eks-resource-agent/eks_provider.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,30 @@ fn write_kubeconfig(cluster_name: &str, region: &str, kubeconfig_dir: &Path) ->
513513
));
514514
}
515515

516+
info!("Updating kubeconfig file");
517+
let status = Command::new("aws")
518+
.args([
519+
"eks",
520+
"update-kubeconfig",
521+
"--region",
522+
region,
523+
&format!("--name={}", cluster_name),
524+
"--kubeconfig",
525+
kubeconfig_dir.to_str().context(
526+
Resources::Remaining,
527+
format!("Unable to convert '{:?}' to string path", kubeconfig_dir),
528+
)?,
529+
])
530+
.status()
531+
.context(Resources::Remaining, "Failed update kubeconfig")?;
532+
533+
if !status.success() {
534+
return Err(ProviderError::new_with_context(
535+
Resources::Remaining,
536+
format!("Failed update kubeconfig with status code {}", status),
537+
));
538+
}
539+
516540
Ok(())
517541
}
518542

0 commit comments

Comments
 (0)