From c6a2cdbbb54db91bbf3f73da72449828d083ab73 Mon Sep 17 00:00:00 2001 From: Tiago Castro Date: Tue, 5 Mar 2024 15:26:35 +0000 Subject: [PATCH 1/3] chore(terraform): switch to pkgs.k8s.io https://kubernetes.io/blog/2023/08/15/pkgs-k8s-io-introduction/ Signed-off-by: Tiago Castro --- terraform/cluster/mod/k8s/repo.sh | 5 +++-- terraform/cluster/variables.tf | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/terraform/cluster/mod/k8s/repo.sh b/terraform/cluster/mod/k8s/repo.sh index af342978d..29e168f43 100644 --- a/terraform/cluster/mod/k8s/repo.sh +++ b/terraform/cluster/mod/k8s/repo.sh @@ -43,9 +43,10 @@ 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 - +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 < Date: Thu, 28 Mar 2024 18:03:32 +0000 Subject: [PATCH 2/3] fix(terraform): add missing dir when using ubuntu 2004 Signed-off-by: Tiago Castro --- terraform/cluster/mod/k8s/repo.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/cluster/mod/k8s/repo.sh b/terraform/cluster/mod/k8s/repo.sh index 29e168f43..a561ec7d5 100644 --- a/terraform/cluster/mod/k8s/repo.sh +++ b/terraform/cluster/mod/k8s/repo.sh @@ -43,6 +43,7 @@ elif [ "$RUNTIME" = "containerd" ]; then sudo add-apt-repository --yes "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" fi +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 < Date: Thu, 28 Mar 2024 18:42:19 +0000 Subject: [PATCH 3/3] feat(csi/xfs): allow extra mkfs.xfs args Allows supporting older kernel versions when formatting the volumes, example: "-m bigtime=0,inobtcount=0" Signed-off-by: Tiago Castro --- .../csi-driver/src/bin/node/filesystem_ops.rs | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/control-plane/csi-driver/src/bin/node/filesystem_ops.rs b/control-plane/csi-driver/src/bin/node/filesystem_ops.rs index ecb47a0bf..d8eb00079 100644 --- a/control-plane/csi-driver/src/bin/node/filesystem_ops.rs +++ b/control-plane/csi-driver/src/bin/node/filesystem_ops.rs @@ -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 @@ -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![], + }; + let output = Command::new(binary) + .args(args) .arg(device) .output() .await @@ -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 @@ -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,