dnsname-cni: Use wrapper instead of patch for dnsmasq
The patch proved to be an incomplete solution while developing nixosTests.podman-dnsname (cherry picked from commit 651777934941480a36f7df9c434e6044957d045d)
This commit is contained in:
parent
29ee113277
commit
03e08759f7
@ -1,4 +1,11 @@
|
|||||||
{ buildGoModule, fetchFromGitHub, lib, dnsmasq }:
|
{
|
||||||
|
buildGoModule,
|
||||||
|
dnsmasq,
|
||||||
|
fetchFromGitHub,
|
||||||
|
lib,
|
||||||
|
nixosTests,
|
||||||
|
makeWrapper,
|
||||||
|
}:
|
||||||
|
|
||||||
buildGoModule rec {
|
buildGoModule rec {
|
||||||
pname = "cni-plugin-dnsname";
|
pname = "cni-plugin-dnsname";
|
||||||
@ -11,10 +18,9 @@ buildGoModule rec {
|
|||||||
sha256 = "090kpq2ppan9ayajdk5vwbvww30nphylgajn2p3441d4jg2nvsm3";
|
sha256 = "090kpq2ppan9ayajdk5vwbvww30nphylgajn2p3441d4jg2nvsm3";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [ ./hardcode-dnsmasq-path.patch ];
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
postInstall = ''
|
||||||
postPatch = ''
|
wrapProgram $out/bin/dnsname --prefix PATH : ${lib.makeBinPath [ dnsmasq ]}
|
||||||
substituteInPlace plugins/meta/dnsname/service.go --replace '@DNSMASQ@' '${dnsmasq}/bin/dnsmasq'
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
vendorSha256 = null;
|
vendorSha256 = 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,
|
|
Loading…
x
Reference in New Issue
Block a user