-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gcs-fuse-csi-driver-sidecar-mounter: init at 1.8.0
- Loading branch information
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"]; | ||
}; | ||
} |