Skip to content

Commit

Permalink
gcs-fuse-csi-driver-sidecar-mounter: init at 1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nbdd0121 committed Nov 25, 2024
1 parent caf9666 commit 63d803c
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

# IT packages
gcsfuse = pkgs.callPackage ./gcsfuse {};
gcs-fuse-csi-driver-sidecar-mounter = pkgs.callPackage ./gcs-fuse-csi-driver-sidecar-mounter.nix {inherit gcsfuse;};
container-hotplug = pkgs.callPackage ./container-hotplug {};

surfer = pkgs.callPackage ./surfer/default.nix {};
Expand Down
62 changes: 62 additions & 0 deletions pkgs/gcs-fuse-csi-driver-sidecar-mounter.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copyright lowRISC Contributors.
# Licensed under the MIT License, see LICENSE for details.
# SPDX-License-Identifier: MIT
{
lib,
fetchFromGitHub,
buildGoModule,
gcsfuse,
dockerTools,
runCommandLocal,
cacert,
}: let
mounter = buildGoModule rec {
pname = "gcs-fuse-csi-driver-sidecar-mounter";
version = "1.8.0";

src = fetchFromGitHub {
owner = "googlecloudplatform";
repo = "gcs-fuse-csi-driver";
rev = "v${version}";
hash = "sha256-qJJLOek11ARxcrdB8M6UZh6PaJBV0tvVnL//ANn7YMc=";
};
vendorHash = null;

subPackages = ["cmd/sidecar_mounter"];

ldflags = ["-s" "-w" "-X main.version=${version}"];

postInstall = ''
mv $out/bin/sidecar_mounter $out/bin/gcs-fuse-csi-driver-sidecar-mounter
'';

dontCheck = true;

meta.mainProgram = pname;
};
in
dockerTools.buildLayeredImage {
name = "gcs-fuse-csi-driver-sidecar-mounter";
tag = "latest";
contents = [
(runCommandLocal "root" {} ''
mkdir -p $out/etc/ssl/certs
ln -s ${lib.getExe gcsfuse} $out/
ln -s ${lib.getExe mounter} $out/
# Ensure SSL can still find certificates
ln -s ${cacert}/etc/ssl/certs/ca-bundle.crt $out/etc/ssl/certs/ca-certificates.crt
'')
];
config = {
Entrypoint = ["/gcs-fuse-csi-driver-sidecar-mounter"];
};
}
// {
meta = with lib; {
description = "Sidecar mounter for the Google Cloud Storage FUSE Container Storage Interface (CSI) Plugin";
homepage = "https://github.com/GoogleCloudPlatform/gcs-fuse-csi-driver";
changelog = "https://github.com/GoogleCloudPlatform/gcs-fuse-csi-driver/releases/tag/v${version}";
license = licenses.asl20;
platforms = ["x86_64-linux"];
};
}

0 comments on commit 63d803c

Please sign in to comment.