Skip to content

Commit

Permalink
Merge pull request #216 from kinvolk/tormath1/fix-flannel-tests
Browse files Browse the repository at this point in the history
etcd: enable `v2` support for various tests
  • Loading branch information
Mathieu Tortuyaux committed Aug 25, 2021
2 parents 8caf355 + 9eb5b33 commit 12b5a96
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
12 changes: 10 additions & 2 deletions kola/tests/etcd/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,15 @@ etcd:
listen_peer_urls: http://0.0.0.0:2380
initial_advertise_peer_urls: http://{PRIVATE_IPV4}:2380
discovery: $discovery
`),
systemd:
units:
- name: etcd-member.service
enabled: true
dropins:
- name: 10-enable-v2.conf
contents: |
[Service]
Environment=ETCD_ENABLE_V2=true`),
ExcludePlatforms: []string{"esx", "qemu-unpriv"}, // etcd-member requires ct rendering and networking
Distros: []string{"cl"},
})
Expand Down Expand Up @@ -113,7 +121,7 @@ func etcdMemberV2BackupRestore(c cluster.TestCluster) {
backup_to="$(mktemp -d)"
sudo etcdctl backup --data-dir=/var/lib/etcd \
sudo --preserve-env=ETCDCTL_API etcdctl backup --data-dir=/var/lib/etcd \
--backup-dir "${backup_to}"
etcdctl rm /$prefix/test
Expand Down
12 changes: 11 additions & 1 deletion kola/tests/flannel/flannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,16 @@ systemd:
- name: 50-network-config.conf
contents: |
[Service]
ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{ \"Network\": \"10.254.0.0/16\", \"Backend\": {\"Type\": \"$type\"} }'`)
# to be changed when flannel will support etcd/V3
Environment=ETCDCTL_API=2
ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{ \"Network\": \"10.254.0.0/16\", \"Backend\": {\"Type\": \"$type\"} }'
- name: etcd-member.service
enabled: true
dropins:
- name: 10-enable-v2.conf
contents: |
[Service]
Environment=ETCD_ENABLE_V2=true`)
)

func init() {
Expand All @@ -65,6 +74,7 @@ func init() {
Distros: []string{"cl"},
ExcludePlatforms: []string{"qemu-unpriv"},
UserData: flannelConf.Subst("$type", "udp"),
Architectures: []string{"amd64"},
})

register.Register(&register.Test{
Expand Down
13 changes: 11 additions & 2 deletions kola/tests/locksmith/locksmith.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,16 @@ etcd:
advertise_client_urls: http://{PRIVATE_IPV4}:2379
initial_advertise_peer_urls: http://{PRIVATE_IPV4}:2380
listen_peer_urls: http://{PRIVATE_IPV4}:2380
discovery: $discovery`),
discovery: $discovery
systemd:
units:
- name: etcd-member.service
enabled: true
dropins:
- name: 10-enable-v2.conf
contents: |
[Service]
Environment=ETCD_ENABLE_V2=true`),
Distros: []string{"cl"},
ExcludePlatforms: []string{"qemu-unpriv"},
})
Expand All @@ -70,7 +79,7 @@ etcd:
"name": "etcd-member.service",
"dropins": [{
"name": "environment.conf",
"contents": "[Unit]\nAfter=certgen.service\nRequires=certgen.service\n[Service]\nEnvironment=ETCD_ADVERTISE_CLIENT_URLS=https://127.0.0.1:2379\nEnvironment=ETCD_LISTEN_CLIENT_URLS=https://127.0.0.1:2379\nEnvironment=ETCD_CERT_FILE=/etc/ssl/certs/etcd-cert.pem\nEnvironment=ETCD_KEY_FILE=/etc/ssl/certs/etcd-key.pem\nEnvironment=ETCD_TRUSTED_CA_FILE=/etc/ssl/certs/ca-locksmith-cert.pem\nEnvironment=ETCD_CLIENT_CERT_AUTH=true"
"contents": "[Unit]\nAfter=certgen.service\nRequires=certgen.service\n[Service]\nEnvironment=ETCD_ADVERTISE_CLIENT_URLS=https://127.0.0.1:2379\nEnvironment=ETCD_LISTEN_CLIENT_URLS=https://127.0.0.1:2379\nEnvironment=ETCD_CERT_FILE=/etc/ssl/certs/etcd-cert.pem\nEnvironment=ETCD_KEY_FILE=/etc/ssl/certs/etcd-key.pem\nEnvironment=ETCD_TRUSTED_CA_FILE=/etc/ssl/certs/ca-locksmith-cert.pem\nEnvironment=ETCD_CLIENT_CERT_AUTH=true\nEnvironment=ETCD_ENABLE_V2=true"
}]
},
{
Expand Down

0 comments on commit 12b5a96

Please sign in to comment.