mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
cni: network.cni job updates should replace allocs (#23764)
a change to the network{cni{}} block means that
the user wants the network config to change,
and that only happens during initial alloc setup,
so we need to replace the alloc(s) to get
fresh network(s) to reconfigure from scratch.
e.g. a job plan diff like this
```
+/- Task Group: "g" (1 in-place update)
+ Network {
+ CNIConfig {
+ a: "ayy"
}
```
should instead be
```
+/- Task Group: "g" (1 create/destroy update)
+ Network {
+ CNIConfig {
+ a: "ayy"
}
```
This commit is contained in:
3
.changelog/23764.txt
Normal file
3
.changelog/23764.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
cni: network.cni jobspec updates now replace allocs to apply the new network config
|
||||
```
|
||||
@@ -544,6 +544,10 @@ func networkUpdated(netA, netB []*structs.NetworkResource) comparison {
|
||||
return difference("network dns", an.DNS, bn.DNS)
|
||||
}
|
||||
|
||||
if !an.CNI.Equal(bn.CNI) {
|
||||
return difference("network cni", an.CNI, bn.CNI)
|
||||
}
|
||||
|
||||
aPorts, bPorts := networkPortMap(an), networkPortMap(bn)
|
||||
if !aPorts.Equal(bPorts) {
|
||||
return difference("network port map", aPorts, bPorts)
|
||||
|
||||
Reference in New Issue
Block a user