nixpkgs/pkgs/applications/networking/cluster/calico/default.nix
Colin Arnott 112fa92938
calico-various,calicoctl,confd-calico: init at 3.24.5
As calico internally builds a series of images, and multiple images
contain different calico binaries, we have had to segregate the various
components into different derivations. We have also used these image's
CMD or ENTRYPOINT as the mainProgram, so that nix run is more useful.

The cgo build process also proved to be quite tricky, so for now
calico-felix and calico-node, both of which depend on libbpf, have not
been packaged.

Updates #124071
2022-12-27 13:10:42 +00:00

82 lines
1.8 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub }:
builtins.mapAttrs (pname: { doCheck ? true, mainProgram ? pname, subPackages }: buildGoModule rec {
inherit pname;
version = "3.24.5";
src = fetchFromGitHub {
owner = "projectcalico";
repo = "calico";
rev = "v${version}";
hash = "sha256-fB9FHiIqVieVkPfHmBvcaUmUqkT1ZbDT26+DUE9lbdc=";
};
vendorHash = "sha256-ogQ/REf5cngoGAFIBN++txew6UqOw1hqCVsixyuGtug=";
inherit doCheck subPackages;
ldflags = [ "-s" "-w" ];
meta = with lib; {
homepage = "https://projectcalico.docs.tigera.io";
changelog = "https://github.com/projectcalico/calico/releases/tag/v${version}";
description = "Cloud native networking and network security";
license = licenses.asl20;
maintainers = with maintainers; [ urandom ];
inherit mainProgram;
};
}) {
calico-apiserver = {
mainProgram = "apiserver";
subPackages = [
"apiserver/cmd/..."
];
};
calico-app-policy = {
# integration tests require network
doCheck = false;
mainProgram = "dikastes";
subPackages = [
"app-policy/cmd/..."
];
};
calico-cni-plugin = {
mainProgram = "calico";
subPackages = [
"cni-plugin/cmd/..."
];
};
calico-kube-controllers = {
# integration tests require network and docker
doCheck = false;
mainProgram = "kube-controllers";
subPackages = [
"kube-controllers/cmd/..."
];
};
calico-pod2daemon = {
mainProgram = "flexvol";
subPackages = [
"pod2daemon/csidriver"
"pod2daemon/flexvol"
"pod2daemon/nodeagent"
];
};
calico-typha = {
subPackages = [
"typha/cmd/..."
];
};
calicoctl = {
subPackages = [
"calicoctl/calicoctl"
];
};
confd-calico = {
mainProgram = "confd";
subPackages = [
"confd"
];
};
}