fix tests
This commit is contained in:
@@ -74,7 +74,7 @@ func ToCorrelation(obj *correlationsV0.Correlation) (*Correlation, error) {
|
||||
if obj.Spec.Target != nil {
|
||||
result.TargetUID = &obj.Spec.Target.Name
|
||||
result.TargetType = ptr.To(obj.Spec.Target.Group)
|
||||
}
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ func ToSpecConfig(orig CorrelationConfig) (*correlationsV0.CorrelationConfigSpec
|
||||
return nil, err
|
||||
}
|
||||
if len(out.Target) == 0 {
|
||||
out.Target = map[string]any{}
|
||||
out.Target = nil
|
||||
}
|
||||
return out, err
|
||||
}
|
||||
@@ -105,7 +105,7 @@ func ToConfig(orig correlationsV0.CorrelationConfigSpec) (*CorrelationConfig, er
|
||||
return nil, err
|
||||
}
|
||||
if len(out.Target) == 0 {
|
||||
out.Target = map[string]any{}
|
||||
out.Target = nil
|
||||
}
|
||||
return out, err
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ func TestConversion(t *testing.T) {
|
||||
Description: ptr.To("A test correlation"),
|
||||
Config: &CorrelationConfigUpdateDTO{
|
||||
Field: ptr.To("test-field"),
|
||||
Target: nil,
|
||||
Target: &map[string]any{},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user