Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit 5976e1a

Browse files
committed
Updated error messages to be facility focused.
Signed-off-by: Chris Privitere <[email protected]>
1 parent e049612 commit 5976e1a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

api/v1beta1/packetcluster_webhook.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ func (c *PacketCluster) ValidateUpdate(oldRaw runtime.Object) error {
9292
if len(c.Spec.Facility) == 0 && len(c.Spec.Metro) == 0 {
9393
allErrs = append(allErrs,
9494
field.Invalid(field.NewPath("spec", "Metro"),
95-
c.Spec.Metro, "field is required when Facility is not set"),
95+
c.Spec.Metro, "Metro is required when Facility is not set"),
9696
)
9797
}
9898

9999
// Must have only one of Metro or Facility
100100
if len(c.Spec.Facility) > 0 && len(c.Spec.Metro) > 0 {
101101
allErrs = append(allErrs,
102-
field.Invalid(field.NewPath("spec", "Metro"),
103-
c.Spec.Metro, "field and Facility field are mutually exclusive"),
102+
field.Invalid(field.NewPath("spec", "Facility"),
103+
c.Spec.Facility, "Metro and Facility are mutually exclusive"),
104104
)
105105
}
106106

api/v1beta1/packetmachine_webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ func (m *PacketMachine) ValidateUpdate(old runtime.Object) error {
6363
// Must have only one of Metro or Facility specified
6464
if len(m.Spec.Facility) > 0 && len(m.Spec.Metro) > 0 {
6565
allErrs = append(allErrs,
66-
field.Invalid(field.NewPath("spec", "Metro"),
67-
m.Spec.Metro, "field and Facility field are mutually exclusive"),
66+
field.Invalid(field.NewPath("spec", "Facility"),
67+
m.Spec.Facility, "Metro and Facility field are mutually exclusive"),
6868
)
6969
}
7070

0 commit comments

Comments
 (0)