Skip to content

Commit

Permalink
chore(bors): merge pull request #799
Browse files Browse the repository at this point in the history
799: XFS compat with older kernels when formatting r=tiagolobocastro a=tiagolobocastro

    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 <[email protected]>

Co-authored-by: Tiago Castro <[email protected]>
  • Loading branch information
mayastor-bors and tiagolobocastro committed Apr 1, 2024
2 parents 6b35b1a + 9ccf23c commit e9a4b61
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
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

0 comments on commit e9a4b61

Please sign in to comment.