Skip to content

Commit

Permalink
net-runner: Fix regression introduced in #4564
Browse files Browse the repository at this point in the history
  • Loading branch information
matevz committed Jun 21, 2022
1 parent f7ee72d commit b7273ef
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .changelog/4808.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
net-runner: Fix regression introduced in #4564

Fix the missing Deployments field when oasis-net-runner generating the genesis
state and no key manager is provided.
23 changes: 11 additions & 12 deletions go/oasis-net-runner/fixtures/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ func newDefaultFixture() (*oasis.NetworkFixture, error) {
usingKeymanager := len(viper.GetString(cfgKeymanagerBinary)) > 0

if viper.GetBool(cfgSetupRuntimes) {
fixture.Runtimes = []oasis.RuntimeFixture{
if usingKeymanager {
// Key manager runtime.
{
fixture.Runtimes = append(fixture.Runtimes, oasis.RuntimeFixture{
ID: keymanagerID,
Kind: registry.KindKeyManager,
Entity: 0,
Expand All @@ -126,16 +126,14 @@ func newDefaultFixture() (*oasis.NetworkFixture, error) {
AnyNode: &registry.AnyNodeRuntimeAdmissionPolicy{},
},
GovernanceModel: registry.GovernanceEntity,
},
}
if usingKeymanager {
fixture.Runtimes[0].Deployments = []oasis.DeploymentCfg{
{
Binaries: map[node.TEEHardware]string{
tee: viper.GetString(cfgKeymanagerBinary),
Deployments: []oasis.DeploymentCfg{
{
Binaries: map[node.TEEHardware]string{
tee: viper.GetString(cfgKeymanagerBinary),
},
},
},
}
})
fixture.KeymanagerPolicies = []oasis.KeymanagerPolicyFixture{
{Runtime: 0, Serial: 1},
}
Expand Down Expand Up @@ -200,11 +198,12 @@ func newDefaultFixture() (*oasis.NetworkFixture, error) {
},
},
})
rtIndex := len(fixture.Runtimes) - 1

for j := range fixture.ComputeWorkers {
fixture.ComputeWorkers[j].Runtimes = append(fixture.ComputeWorkers[j].Runtimes, i+1)
fixture.ComputeWorkers[j].Runtimes = append(fixture.ComputeWorkers[j].Runtimes, rtIndex)
}
fixture.Clients[0].Runtimes = append(fixture.Clients[0].Runtimes, i+1)
fixture.Clients[0].Runtimes = append(fixture.Clients[0].Runtimes, rtIndex)
}
}

Expand Down

0 comments on commit b7273ef

Please sign in to comment.