Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XFS compat with older kernels when formatting #799

Merged
merged 3 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions control-plane/csi-driver/src/bin/node/filesystem_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ pub(crate) trait FileSystemOps: Send + Sync {
#[async_trait]
impl FileSystemOps for Ext4Fs {
async fn create(&self, device: &str) -> Result<(), Error> {
let binary = format!("mkfs.{}", "ext4");
let output = Command::new(&binary)
let binary = "mkfs.ext4";
let output = Command::new(binary)
.arg(device)
.output()
.await
Expand Down Expand Up @@ -209,8 +209,16 @@ impl FileSystemOps for Ext4Fs {
#[async_trait]
impl FileSystemOps for XFs {
async fn create(&self, device: &str) -> Result<(), Error> {
let binary = format!("mkfs.{}", "xfs");
let output = Command::new(&binary)
let binary = "mkfs.xfs";
let args = match std::env::var("MKFS_XFS_ARGS") {
Ok(args) => args
.split_whitespace()
.map(str::to_string)
.collect::<Vec<_>>(),
_ => vec![],
};
let output = Command::new(binary)
.args(args)
.arg(device)
.output()
.await
Expand Down Expand Up @@ -297,8 +305,8 @@ impl FileSystemOps for XFs {
#[async_trait]
impl FileSystemOps for BtrFs {
async fn create(&self, device: &str) -> Result<(), Error> {
let binary = format!("mkfs.{}", "btrfs");
let output = Command::new(&binary)
let binary = "mkfs.btrfs";
let output = Command::new(binary)
.arg(device)
.output()
.await
Expand Down Expand Up @@ -393,7 +401,7 @@ impl FileSystemOps for BtrFs {
}

// Acknowledge the output from Command.
fn ack_command_output(output: Output, binary: String) -> Result<(), Error> {
fn ack_command_output(output: Output, binary: &str) -> Result<(), Error> {
trace!(
"Output from {} command: {}, status code: {:?}",
binary,
Expand Down
6 changes: 4 additions & 2 deletions terraform/cluster/mod/k8s/repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ elif [ "$RUNTIME" = "containerd" ]; then
sudo add-apt-repository --yes "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
fi

curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo mkdir -p /etc/apt/keyrings/
KUBE_APT_V=$(echo "${kube_version}" | awk -F. '{ sub(/-.*/, ""); print "v" $1 "." $2 }')
curl -fsSL https://pkgs.k8s.io/core:/stable:/$KUBE_APT_V/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/$KUBE_APT_V/deb/ /
EOF

sudo apt-get update
Expand Down
2 changes: 1 addition & 1 deletion terraform/cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ variable "master_vcpu" {
variable "kubernetes_version" {
type = string
description = "Version of all kubernetes components"
default = "1.26.0-00"
default = "1.26.14-1.1"
}

variable "kubeconfig_output" {
Expand Down
Loading