Environment.assertAliveOp() in juju-1.17.0 incompatible with juju-1.16.*
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-core |
Fix Released
|
Critical
|
Andrew Wilkins |
Bug Description
The new code in AddOneMachine has:
env, err := st.Environment()
if err != nil {
return nil, err
} else if env.Life() != Alive {
return nil, fmt.Errorf(
}
...
ops = append(ops, env.assertAlive
if err := st.runTransacti
return nil, onAbort(err, fmt.Errorf(
}
However, if you are connecting to a 1.16 environment, there is no Life attribute in the environment doc. Which means that the assertion op:
func (e *Environment) assertAliveOp() txn.Op {
return txn.Op{
C: e.st.environmen
Id: e.UUID(),
Assert: isAliveDoc,
}
}
fails. Because null != "0". So even though st.environment.
This is a compatibility regression for 1.17 vs a 1.16 environment (you can't add-machines to a 1.16 environment once my patch to support falling back is finished).
summary: |
- Environments.Life() in juju-1.17.0 incompatible with juju-1.16.* + Environment.assertAliveOp() in juju-1.17.0 incompatible with juju-1.16.* |
Changed in juju-core: | |
status: | In Progress → Fix Committed |
Changed in juju-core: | |
status: | Fix Committed → Fix Released |
The assertion was originally !dead, which worked if the attribute didn't exist; this got broken during review changes. I'll see if I can whip up a unit test for this first.