Skip to content

Commit 684dba3

Browse files
Updates conditions package to support MachineSet
1 parent ed764c1 commit 684dba3

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

pkg/util/conditions/gettersetter.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ func getWrapperObject(from interface{}) GetterSetter {
171171
switch obj := from.(type) {
172172
case *machinev1.Machine:
173173
return &MachineWrapper{obj}
174+
case *machinev1.MachineSet:
175+
return &MachineSetWrapper{obj}
174176
case *machinev1.MachineHealthCheck:
175177
return &MachineHealthCheckWrapper{obj}
176178
default:

pkg/util/conditions/wrap.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,15 @@ func (m *MachineHealthCheckWrapper) GetConditions() []machinev1.Condition {
2727
func (m *MachineHealthCheckWrapper) SetConditions(conditions []machinev1.Condition) {
2828
m.Status.Conditions = conditions
2929
}
30+
31+
type MachineSetWrapper struct {
32+
*machinev1.MachineSet
33+
}
34+
35+
func (m *MachineSetWrapper) GetConditions() []machinev1.Condition {
36+
return m.Status.Conditions
37+
}
38+
39+
func (m *MachineSetWrapper) SetConditions(conditions []machinev1.Condition) {
40+
m.Status.Conditions = conditions
41+
}

0 commit comments

Comments
 (0)