etcd: switch to etcd_3_5

This commit is contained in:
Thomas Gerbet 2023-05-23 22:54:43 +02:00 committed by zowoq
parent a24848c470
commit 85f15277d0
6 changed files with 24 additions and 18 deletions

View file

@ -16,6 +16,8 @@
- The latest version of `clonehero` now stores custom content in `~/.clonehero`. See the [migration instructions](https://clonehero.net/2022/11/29/v23-to-v1-migration-instructions.html). Typically, these content files would exist along side the binary, but the previous build used a wrapper script that would store them in `~/.config/unity3d/srylain Inc_/Clone Hero`.
- `etcd` has been updated to 3.5, you will want to read the [3.3 to 3.4](https://etcd.io/docs/v3.5/upgrades/upgrade_3_4/) and [3.4 to 3.5](https://etcd.io/docs/v3.5/upgrades/upgrade_3_5/) upgrade guides
## Other Notable Changes {#sec-release-23.11-notable-changes}
- A new option was added to the virtualisation module that enables specifying explicitly named network interfaces in QEMU VMs. The existing `virtualisation.vlans` is still supported for cases where the name of the network interface is irrelevant.

View file

@ -53,7 +53,7 @@ import ./make-test-python.nix ({ pkgs, ... } : let
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = @alt_names
[alt_names]
DNS.1 = node1
@ -86,10 +86,13 @@ import ./make-test-python.nix ({ pkgs, ... } : let
};
environment.variables = {
ETCDCTL_CERT_FILE = "${etcd_client_cert}";
ETCDCTL_KEY_FILE = "${etcd_client_key}";
ETCDCTL_CA_FILE = "${ca_pem}";
ETCDCTL_PEERS = "https://127.0.0.1:2379";
ETCD_CERT_FILE = "${etcd_client_cert}";
ETCD_KEY_FILE = "${etcd_client_key}";
ETCD_CA_FILE = "${ca_pem}";
ETCDCTL_ENDPOINTS = "https://127.0.0.1:2379";
ETCDCTL_CACERT = "${ca_pem}";
ETCDCTL_CERT = "${etcd_cert}";
ETCDCTL_KEY = "${etcd_key}";
};
networking.firewall.allowedTCPPorts = [ 2380 ];
@ -134,21 +137,21 @@ in {
node2.start()
node1.wait_for_unit("etcd.service")
node2.wait_for_unit("etcd.service")
node2.wait_until_succeeds("etcdctl cluster-health")
node1.succeed("etcdctl set /foo/bar 'Hello world'")
node2.wait_until_succeeds("etcdctl endpoint status")
node1.succeed("etcdctl put /foo/bar 'Hello world'")
node2.succeed("etcdctl get /foo/bar | grep 'Hello world'")
with subtest("should add another member"):
node1.wait_until_succeeds("etcdctl member add node3 https://node3:2380")
node1.wait_until_succeeds("etcdctl member add node3 --peer-urls=https://node3:2380")
node3.start()
node3.wait_for_unit("etcd.service")
node3.wait_until_succeeds("etcdctl member list | grep 'node3'")
node3.succeed("etcdctl cluster-health")
node3.succeed("etcdctl endpoint status")
with subtest("should survive member crash"):
node3.crash()
node1.succeed("etcdctl cluster-health")
node1.succeed("etcdctl set /foo/bar 'Hello degraded world'")
node1.succeed("etcdctl endpoint status")
node1.succeed("etcdctl put /foo/bar 'Hello degraded world'")
node1.succeed("etcdctl get /foo/bar | grep 'Hello degraded world'")
'';
})

View file

@ -19,7 +19,7 @@ import ./make-test-python.nix ({ pkgs, ... } : {
node.wait_for_unit("etcd.service")
with subtest("should write and read some values to etcd"):
node.succeed("etcdctl set /foo/bar 'Hello world'")
node.succeed("etcdctl put /foo/bar 'Hello world'")
node.succeed("etcdctl get /foo/bar | grep 'Hello world'")
'';
})

View file

@ -1,4 +1,4 @@
{ lib, buildGoPackage, fetchFromGitHub, nixosTests, stdenv }:
{ lib, buildGoPackage, fetchFromGitHub, stdenv }:
buildGoPackage rec {
pname = "etcd";
@ -24,8 +24,6 @@ buildGoPackage rec {
install -Dm755 bin/* bin/functional/cmd/* -t $out/bin
'';
passthru.tests = { inherit (nixosTests) etcd etcd-cluster; };
meta = with lib; {
description = "Distributed reliable key-value store for the most critical data of a distributed system";
license = licenses.asl20;

View file

@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub, symlinkJoin }:
{ lib, buildGoModule, fetchFromGitHub, symlinkJoin, nixosTests }:
let
version = "3.5.9";
@ -65,7 +65,10 @@ symlinkJoin {
inherit meta version;
passthru = { inherit etcdserver etcdutl etcdctl; };
passthru = {
inherit etcdserver etcdutl etcdctl;
tests = { inherit (nixosTests) etcd etcd-cluster; };
};
paths = [
etcdserver

View file

@ -25320,7 +25320,7 @@ with pkgs;
ergochat = callPackage ../servers/irc/ergochat { };
etcd = etcd_3_3;
etcd = etcd_3_5;
etcd_3_3 = callPackage ../servers/etcd/3.3.nix { };
etcd_3_4 = callPackage ../servers/etcd/3.4.nix { };
etcd_3_5 = callPackage ../servers/etcd/3.5.nix { };