@@ -53,14 +53,10 @@ func (c *PacketCluster) ValidateCreate() error {
53
53
if len (c .Spec .Facility ) == 0 && len (c .Spec .Metro ) == 0 {
54
54
allErrs = append (allErrs ,
55
55
field .Invalid (field .NewPath ("spec" , "Metro" ),
56
- c .Spec .Metro , "field is required when Facility is not set " ),
56
+ c .Spec .Metro , "field is required" ),
57
57
)
58
58
}
59
59
60
- // If both Metro and Facility are set, ignore Facility, we'll leave this to
61
- // the controller to deal with - the facility will need to reside in the
62
- // metro.
63
-
64
60
if len (allErrs ) > 0 {
65
61
return apierrors .NewInvalid (GroupVersion .WithKind ("PacketCluster" ).GroupKind (), c .Name , allErrs )
66
62
}
@@ -92,15 +88,15 @@ func (c *PacketCluster) ValidateUpdate(oldRaw runtime.Object) error {
92
88
if len (c .Spec .Facility ) == 0 && len (c .Spec .Metro ) == 0 {
93
89
allErrs = append (allErrs ,
94
90
field .Invalid (field .NewPath ("spec" , "Metro" ),
95
- c .Spec .Metro , "Metro is required when Facility is not set " ),
91
+ c .Spec .Metro , "Metro is required" ),
96
92
)
97
93
}
98
94
99
95
// Must have only one of Metro or Facility
100
96
if len (c .Spec .Facility ) > 0 && len (c .Spec .Metro ) > 0 {
101
97
allErrs = append (allErrs ,
102
98
field .Invalid (field .NewPath ("spec" , "Facility" ),
103
- c .Spec .Facility , "Metro and Facility are mutually exclusive" ),
99
+ c .Spec .Facility , "Metro and Facility are mutually exclusive, Metro is recommended " ),
104
100
)
105
101
}
106
102
0 commit comments