Skip to content

Commit

Permalink
Merge pull request #67 from Nordix/bug-64-rel03-jaakko
Browse files Browse the repository at this point in the history
🐛 CAPM3 should not select a BMH that is paused
  • Loading branch information
metal3-io-bot committed Apr 3, 2020
2 parents b31c64b + 4bcc877 commit c4b68c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions baremetal/metal3machine_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,13 @@ func (m *MachineManager) chooseHost(ctx context.Context) (*bmh.BareMetalHost, er
default:
continue
}
// continue if BaremetalHost is paused
annotations := host.GetAnnotations()
if annotations != nil {
if _, ok := annotations[bmh.PausedAnnotation]; ok {
continue
}
}
if labelSelector.Matches(labels.Set(host.ObjectMeta.Labels)) {
m.Log.Info("Host matched hostSelector for Metal3Machine", "host", host.Name)
availableHosts = append(availableHosts, &hosts.Items[i])
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ github.com/metal3-io/baremetal-operator v0.0.0-20200303095345-4b4f065f311b h1:ip
github.com/metal3-io/baremetal-operator v0.0.0-20200303095345-4b4f065f311b/go.mod h1:aJeLHszKLl8uCD7ZZz6KfLKgGXluo4hUBwL7X8YLs7E=
github.com/metal3-io/baremetal-operator v0.0.0-20200318114549-c3da1db56f43 h1:rKycVcdWOQ5wkzartz+ThvmuT4VnusRdytFFR+T5jyI=
github.com/metal3-io/baremetal-operator v0.0.0-20200318114549-c3da1db56f43/go.mod h1:aJeLHszKLl8uCD7ZZz6KfLKgGXluo4hUBwL7X8YLs7E=
github.com/metal3-io/baremetal-operator v0.0.0-20200402123356-c863ac5a6630 h1:n/FW9YW7qY8/J0YSq/SnXJ6RuLV4Jb3YHeZWQBJdYp8=
github.com/mholt/certmagic v0.6.2-0.20190624175158-6a42ef9fe8c2/go.mod h1:g4cOPxcjV0oFq3qwpjSA30LReKD8AoIfwAY9VvG35NY=
github.com/miekg/dns v0.0.0-20181005163659-0d29b283ac0f/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/miekg/dns v1.1.3/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
Expand Down Expand Up @@ -1373,6 +1374,7 @@ k8s.io/component-base v0.0.0-20190918160511-547f6c5d7090/go.mod h1:933PBGtQFJky3
k8s.io/component-base v0.0.0-20190918200425-ed2f0867c778/go.mod h1:DFWQCXgXVLiWtzFaS17KxHdlUeUymP7FLxZSkmL9/jU=
k8s.io/component-base v0.0.0-20191003000551-f573d376509c/go.mod h1:VLMr8+SrOC4J3MDbbL7cjBDEPBcwLP9/kv/u8PVUEo4=
k8s.io/component-base v0.17.2/go.mod h1:zMPW3g5aH7cHJpKYQ/ZsGMcgbsA/VyhEugF3QT1awLs=
k8s.io/component-base v0.17.3 h1:hQzTSshY14aLSR6WGIYvmw+w+u6V4d+iDR2iDGMrlUg=
k8s.io/component-base v0.17.3/go.mod h1:GeQf4BrgelWm64PXkIXiPh/XS0hnO42d9gx9BtbZRp8=
k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM=
k8s.io/csi-translation-lib v0.17.3/go.mod h1:FBya8XvGIqDm2/3evLQNxaFXqv/C2UcZa5JgJt6/qqY=
Expand Down

0 comments on commit c4b68c5

Please sign in to comment.