Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

argocd-vault-plugin: fix version output #270985

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion pkgs/tools/security/argocd-vault-plugin/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{ buildGoModule, fetchFromGitHub, lib }:
{ buildGoModule
, fetchFromGitHub
, lib
, testers
, argocd-vault-plugin
}:

buildGoModule rec {
pname = "argocd-vault-plugin";
Expand All @@ -13,9 +18,23 @@ buildGoModule rec {

vendorHash = "sha256-0PrGrcS8Gx0cVImGrlmXlycFgWCTLjg2ISi0OhYoPpw=";

ldflags = [
"-X=github.com/argoproj-labs/argocd-vault-plugin/version.Version=v${version}"
"-X=github.com/argoproj-labs/argocd-vault-plugin/version.BuildDate=1970-01-01T00:00:00Z"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 1970-01-01T00:00:00Z as BuildDate?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would builtins.currentTime make sense here at all? Just curious.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1970-01-01T00:00:00Z is the Unix epoch, it is the "zero" of Unix time basically.

builtins.currentTime is impure, using it would result in non-reproducible builds

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blah, duh! Thx

"-X=github.com/argoproj-labs/argocd-vault-plugin/version.CommitSHA=unknown"
];

# integration tests require filesystem and network access for credentials
doCheck = false;

doInstallCheck = true;

passthru.tests.version = testers.testVersion {
package = argocd-vault-plugin;
command = "argocd-vault-plugin version";
version = "argocd-vault-plugin v${version} (unknown) BuildDate: 1970-01-01T00:00:00Z";
};

meta = with lib; {
homepage = "https://argocd-vault-plugin.readthedocs.io";
changelog = "https://github.com/argoproj-labs/argocd-vault-plugin/releases/tag/v${version}";
Expand Down