@@ -133,27 +133,14 @@ func loadDecisionTreeEntry(entry *decisionTreeFilterEntry, handle plugins.Handle
133
133
return nil , errors .New ("either pluginRef or decisionTree must be specified" )
134
134
}
135
135
136
- // Type returns the type of the filter.
137
- func (f * DecisionTreeFilter ) Type () string {
138
- if f == nil {
139
- return "nil"
140
- }
141
- return f .Current .Type ()
142
- }
143
-
144
- // Name returns the name of the filter.
145
- func (f * DecisionTreeFilter ) Name () string {
146
- if f == nil {
147
- return ""
148
- }
149
- return f .Current .Name ()
150
- }
151
-
152
136
func (f * DecisionTreeFilter ) GetTypedName () plugins.TypedName {
153
- return plugins.TypedName {
154
- PluginType : f .Type (),
155
- PluginName : f .Name (),
137
+ if f == nil {
138
+ // TODO: this keeps the previous behavior ("nil"/"") - not sure
139
+ // why done this way.
140
+ // Change to empty TypedName or some more meaningful values?
141
+ return plugins.TypedName {Type : "nil" , Name : "" }
156
142
}
143
+ return f .Current .GetTypedName ()
157
144
}
158
145
159
146
// Filter filters out pods that doesn't meet the filter criteria.
@@ -170,7 +157,7 @@ func (f *DecisionTreeFilter) Filter(ctx context.Context, cycleState *types.Cycle
170
157
if f .NextOnSuccess != nil {
171
158
next = f .NextOnSuccess
172
159
}
173
- loggerTrace .Info ("Filter succeeded" , "filter" , f .Type (), "next" , next .Type (), "filteredPodCount" , len (filteredPod ))
160
+ loggerTrace .Info ("Filter succeeded" , "filter" , f .GetTypedName (), "next" , next .GetTypedName (), "filteredPodCount" , len (filteredPod ))
174
161
// On success, pass the filtered result to the next filter.
175
162
return next .Filter (ctx , cycleState , request , filteredPod )
176
163
} else {
@@ -181,7 +168,7 @@ func (f *DecisionTreeFilter) Filter(ctx context.Context, cycleState *types.Cycle
181
168
if f .NextOnFailure != nil {
182
169
next = f .NextOnFailure
183
170
}
184
- loggerTrace .Info ("Filter failed" , "filter" , f .Type (), "next" , next .Type ())
171
+ loggerTrace .Info ("Filter failed" , "filter" , f .GetTypedName (), "next" , next .GetTypedName ())
185
172
// On failure, pass the initial set of pods to the next filter.
186
173
return next .Filter (ctx , cycleState , request , pods )
187
174
}
0 commit comments