Skip to content

Commit

Permalink
kubernetes-kcp: init at 0.26.0
Browse files Browse the repository at this point in the history
Update pkgs/applications/networking/cluster/kcp/default.nix

Co-authored-by: Aleksana <[email protected]>

Update pkgs/applications/networking/cluster/kcp/default.nix

Co-authored-by: Aleksana <[email protected]>

Update pkgs/applications/networking/cluster/kcp/default.nix

Co-authored-by: Aleksana <[email protected]>

Move package to pkgs/by-name/ku/kubernetes-kcp

Fix format error
  • Loading branch information
rytswd committed Nov 23, 2024
1 parent 919d4b8 commit 7c36e3c
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions pkgs/by-name/ku/kubernetes-kcp/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
testers,
}:

let
rev = "6a4e71a9d35c6906d3fdd46595e8b693c38669f5";
in
buildGoModule rec {
pname = "kubernetes-kcp";
version = "0.26.0";

src = fetchFromGitHub {
owner = "kcp-dev";
repo = "kcp";
rev = "refs/tags/v${version}";
hash = "sha256-ZEgDeILo2weSAZgBsfR2EQyzym/I/+3P99b47E5Tfrw=";
};
vendorHash = "sha256-IONbTih48LKAiEPFNFdBkJDMI2sjHWxiqVbEJCskyio=";

subPackages = [
"cmd/kcp"
"cli/cmd/kubectl-kcp"
"cli/cmd/kubectl-ws"
];

# TODO: The upstream has the additional version information pulled from go.mod
# dependencies.
ldflags = [
"-X k8s.io/client-go/pkg/version.gitCommit=${rev}"
"-X k8s.io/client-go/pkg/version.gitTreeState=clean"
"-X k8s.io/client-go/pkg/version.gitVersion=v${version}"
# "-X k8s.io/client-go/pkg/version.gitMajor=${KUBE_MAJOR_VERSION}"
# "-X k8s.io/client-go/pkg/version.gitMinor=${KUBE_MINOR_VERSION}"
"-X k8s.io/client-go/pkg/version.buildDate=unknown"
"-X k8s.io/component-base/version.gitCommit=${rev}"
"-X k8s.io/component-base/version.gitTreeState=clean"
"-X k8s.io/component-base/version.gitVersion=v${version}"
# "-X k8s.io/component-base/version.gitMajor=${KUBE_MAJOR_VERSION}"
# "-X k8s.io/component-base/version.gitMinor=${KUBE_MINOR_VERSION}"
"-X k8s.io/component-base/version.buildDate=unknown"
];

# TODO: Check if this is necessary.
# __darwinAllowLocalNetworking = true;

nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
$out/bin/kcp completion bash > kcp.bash
$out/bin/kcp completion zsh > kcp.zsh
$out/bin/kcp completion fish > kcp.fish
installShellCompletion kcp.{bash,zsh,fish}
'';

passthru.tests.version = testers.testVersion {
# package = kubernetes-kcp;
command = "kcp --version";
# NOTE: Once the go.mod version is pulled in, the version info here needs
# to be also updated.
version = "v${version}";
};

meta = {
homepage = "https://kcp.io";
description = "Kubernetes-like control planes for form-factors and use-cases beyond Kubernetes and container workloads";
mainProgram = "kcp";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
rytswd
];
};
}

0 comments on commit 7c36e3c

Please sign in to comment.