diff options
author | Robert Hensing <robert@roberthensing.nl> | 2021-05-31 08:32:21 +0200 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2021-05-31 14:29:56 +0200 |
commit | 651777934941480a36f7df9c434e6044957d045d (patch) | |
tree | 4d708de37b977a0eb5db809085587a519d4259a8 /pkgs/applications/networking/cluster/dnsname-cni | |
parent | 3600a82711987ac1267a96fd97974437b69f6806 (diff) |
dnsname-cni: Use wrapper instead of patch for dnsmasq
The patch proved to be an incomplete solution while developing nixosTests.podman-dnsname
Diffstat (limited to 'pkgs/applications/networking/cluster/dnsname-cni')
-rw-r--r-- | pkgs/applications/networking/cluster/dnsname-cni/default.nix | 16 | ||||
-rw-r--r-- | pkgs/applications/networking/cluster/dnsname-cni/hardcode-dnsmasq-path.patch | 19 |
2 files changed, 11 insertions, 24 deletions
diff --git a/pkgs/applications/networking/cluster/dnsname-cni/default.nix b/pkgs/applications/networking/cluster/dnsname-cni/default.nix index 91ef8b68fb630..2770617db7e5b 100644 --- a/pkgs/applications/networking/cluster/dnsname-cni/default.nix +++ b/pkgs/applications/networking/cluster/dnsname-cni/default.nix @@ -1,4 +1,11 @@ -{ buildGoModule, fetchFromGitHub, lib, dnsmasq }: +{ + buildGoModule, + dnsmasq, + fetchFromGitHub, + lib, + nixosTests, + makeWrapper, +}: buildGoModule rec { pname = "cni-plugin-dnsname"; @@ -11,10 +18,9 @@ buildGoModule rec { sha256 = "090kpq2ppan9ayajdk5vwbvww30nphylgajn2p3441d4jg2nvsm3"; }; - patches = [ ./hardcode-dnsmasq-path.patch ]; - - postPatch = '' - substituteInPlace plugins/meta/dnsname/service.go --replace '@DNSMASQ@' '${dnsmasq}/bin/dnsmasq' + nativeBuildInputs = [ makeWrapper ]; + postInstall = '' + wrapProgram $out/bin/dnsname --prefix PATH : ${lib.makeBinPath [ dnsmasq ]} ''; vendorSha256 = null; diff --git a/pkgs/applications/networking/cluster/dnsname-cni/hardcode-dnsmasq-path.patch b/pkgs/applications/networking/cluster/dnsname-cni/hardcode-dnsmasq-path.patch deleted file mode 100644 index 24ef5eb85d138..0000000000000 --- a/pkgs/applications/networking/cluster/dnsname-cni/hardcode-dnsmasq-path.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/plugins/meta/dnsname/service.go b/plugins/meta/dnsname/service.go -index fc05f75..f6b4caf 100644 ---- a/plugins/meta/dnsname/service.go -+++ b/plugins/meta/dnsname/service.go -@@ -16,10 +16,14 @@ import ( - - // newDNSMasqFile creates a new instance of a dnsNameFile - func newDNSMasqFile(domainName, networkInterface, networkName string) (dnsNameFile, error) { -+ /* - dnsMasqBinary, err := exec.LookPath("dnsmasq") - if err != nil { - return dnsNameFile{}, errors.Errorf("the dnsmasq cni plugin requires the dnsmasq binary be in PATH") - } -+ */ -+ _ = errors.Errorf // XXX(mikroskeem): reduce diff -+ dnsMasqBinary := "@DNSMASQ@" - masqConf := dnsNameFile{ - ConfigFile: makePath(networkName, confFileName), - Domain: domainName, |