crc: 2.36.0 -> 2.49.0 (#400339)

This commit is contained in:
Pol Dellaiera
2025-04-28 09:52:05 +00:00
committed by GitHub
2 changed files with 27 additions and 37 deletions
+26 -30
View File
@@ -2,28 +2,26 @@
lib,
buildGoModule,
fetchFromGitHub,
testers,
crc,
coreutils,
writableTmpDirAsHomeHook,
}:
let
openShiftVersion = "4.15.12";
openShiftVersion = "4.18.2";
okdVersion = "4.15.0-0.okd-2024-02-23-163410";
microshiftVersion = "4.15.12";
podmanVersion = "4.4.4";
microshiftVersion = "4.18.2";
writeKey = "$(MODULEPATH)/pkg/crc/segment.WriteKey=cvpHsNcmGCJqVzf6YxrSnVlwFSAZaYtp";
gitCommit = "27c493c19b7f396931c3b94cc3367f572e6af04a";
gitHash = "sha256-uxp3DVYbbjKf1Cjj7GCf9QBxFq3K136k51eymD0U018=";
gitCommit = "e843be9c9889abd33ce2f9aee161fac1d44e3fa8";
gitHash = "sha256-irlVpRBZzE6lfjK8nlNmWlryGj25u/5LcX7pG3WD/Fs=";
in
buildGoModule rec {
version = "2.36.0";
buildGoModule (finalAttrs: {
pname = "crc";
version = "2.49.0";
src = fetchFromGitHub {
owner = "crc-org";
repo = "crc";
rev = "v${version}";
tag = "v${finalAttrs.version}";
hash = gitHash;
};
@@ -31,48 +29,46 @@ buildGoModule rec {
postPatch = ''
substituteInPlace pkg/crc/oc/oc_linux_test.go \
--replace "/bin/echo" "${coreutils}/bin/echo"
--replace-fail "/bin/echo" "${coreutils}/bin/echo"
'';
subPackages = [
"cmd/crc"
];
subPackages = [ "cmd/crc" ];
tags = [ "containers_image_openpgp" ];
ldflags = [
"-X github.com/crc-org/crc/v2/pkg/crc/version.crcVersion=${version}"
"-X github.com/crc-org/crc/v2/pkg/crc/version.crcVersion=${finalAttrs.version}"
"-X github.com/crc-org/crc/v2/pkg/crc/version.ocpVersion=${openShiftVersion}"
"-X github.com/crc-org/crc/v2/pkg/crc/version.okdVersion=${okdVersion}"
"-X github.com/crc-org/crc/v2/pkg/crc/version.podmanVersion=${podmanVersion}"
"-X github.com/crc-org/crc/v2/pkg/crc/version.microshiftVersion=${microshiftVersion}"
"-X github.com/crc-org/crc/v2/pkg/crc/version.commitSha=${builtins.substring 0 8 gitCommit}"
"-X github.com/crc-org/crc/v2/pkg/crc/segment.WriteKey=${writeKey}"
];
preCheck = ''
export HOME=$(mktemp -d)
nativeCheckInputs = [ writableTmpDirAsHomeHook ];
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
HOME=$(mktemp -d) $out/bin/crc version | grep ${finalAttrs.version} > /dev/null
runHook postInstallCheck
'';
passthru.tests.version = testers.testVersion {
package = crc;
command = ''
export HOME=$(mktemp -d)
crc version
'';
};
passthru.updateScript = ./update.sh;
meta = with lib; {
meta = {
description = "Manage a local OpenShift 4.x cluster, Microshift or a Podman VM optimized for testing and development purposes";
homepage = "https://crc.dev/crc/getting_started/getting_started/introducing/";
changelog = "https://github.com/crc-org/crc/releases/tag/v${version}";
license = licenses.asl20;
changelog = "https://github.com/crc-org/crc/releases/tag/v${finalAttrs.version}";
license = lib.licenses.asl20;
mainProgram = "crc";
maintainers = with maintainers; [
maintainers = with lib.maintainers; [
matthewpi
shikanime
tricktron
];
};
}
})
+1 -7
View File
@@ -26,7 +26,7 @@ CRC_COMMIT=$(curl --silent ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
jq -r "map(select(.name == \"${LATEST_TAG_NAME}\")) | .[0] | .commit.sha")
CRC_GIT_PREFETCH=$(nix-prefetch-url --unpack https://github.com/crc-org/crc/archive/${CRC_COMMIT}.tar.gz)
CRC_GIT_HASH=$(nix hash to-sri --type sha256 ${CRC_GIT_PREFETCH})
CRC_GIT_HASH=$(nix hash convert --to sri --hash-algo sha256 ${CRC_GIT_PREFETCH})
FILE_MAKEFILE=${WORKDIR}/Makefile
curl --silent https://raw.githubusercontent.com/crc-org/crc/${CRC_COMMIT}/Makefile >$FILE_MAKEFILE
@@ -37,9 +37,6 @@ OPENSHIFT_VERSION=$(grep 'OPENSHIFT_VERSION' ${FILE_MAKEFILE} |
OKD_VERSION=$(grep 'OKD_VERSION' ${FILE_MAKEFILE} |
head -n1 | awk '{print $3}')
PODMAN_VERSION=$(grep 'PODMAN_VERSION' ${FILE_MAKEFILE} |
head -n1 | awk '{print $3}')
MICROSHIFT_VERSION=$(grep 'MICROSHIFT_VERSION' ${FILE_MAKEFILE} |
head -n1 | awk '{print $3}')
@@ -61,9 +58,6 @@ sed -i "s|openShiftVersion = \".*\"|openShiftVersion = \"${OPENSHIFT_VERSION:-}\
sed -i "s|okdVersion = \".*\"|okdVersion = \"${OKD_VERSION:-}\"|" \
${NIXPKGS_CRC_FOLDER}/package.nix
sed -i "s|podmanVersion = \".*\"|podmanVersion = \"${PODMAN_VERSION:-}\"|" \
${NIXPKGS_CRC_FOLDER}/package.nix
sed -i "s|microshiftVersion = \".*\"|microshiftVersion = \"${MICROSHIFT_VERSION:-}\"|" \
${NIXPKGS_CRC_FOLDER}/package.nix