From f91496329a5abee2ce0071caeb7d0a69c14cdc33 Mon Sep 17 00:00:00 2001 From: "metal-robot[bot]" <68018895+metal-robot[bot]@users.noreply.github.com> Date: Thu, 15 Feb 2024 10:26:49 +0100 Subject: [PATCH] Bump metal-api to version v0.27.1 (#152) * Bump metal-api to version v0.27.1 * Bump to version v0.27.1 --------- Co-authored-by: metal-stack --- VERSION | 2 +- api/models/v1_machine_allocation.go | 12 +++++++----- metal-api.json | 3 +-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/VERSION b/VERSION index 0a8bf80..04e9457 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.27.0 +v0.27.1 diff --git a/api/models/v1_machine_allocation.go b/api/models/v1_machine_allocation.go index 45cd1a9..6284b37 100644 --- a/api/models/v1_machine_allocation.go +++ b/api/models/v1_machine_allocation.go @@ -44,8 +44,7 @@ type V1MachineAllocation struct { Filesystemlayout *V1FilesystemLayoutResponse `json:"filesystemlayout,omitempty" yaml:"filesystemlayout,omitempty"` // a set of firewall rules to apply - // Required: true - FirewallRules *V1FirewallRules `json:"firewall_rules" yaml:"firewall_rules"` + FirewallRules *V1FirewallRules `json:"firewall_rules,omitempty" yaml:"firewall_rules,omitempty"` // the hostname which will be used when creating the machine // Required: true @@ -235,9 +234,8 @@ func (m *V1MachineAllocation) validateFilesystemlayout(formats strfmt.Registry) } func (m *V1MachineAllocation) validateFirewallRules(formats strfmt.Registry) error { - - if err := validate.Required("firewall_rules", "body", m.FirewallRules); err != nil { - return err + if swag.IsZero(m.FirewallRules) { // not required + return nil } if m.FirewallRules != nil { @@ -496,6 +494,10 @@ func (m *V1MachineAllocation) contextValidateFirewallRules(ctx context.Context, if m.FirewallRules != nil { + if swag.IsZero(m.FirewallRules) { // not required + return nil + } + if err := m.FirewallRules.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("firewall_rules") diff --git a/metal-api.json b/metal-api.json index d6d639b..c028d15 100644 --- a/metal-api.json +++ b/metal-api.json @@ -2176,7 +2176,6 @@ "allocationuuid", "created", "creator", - "firewall_rules", "hostname", "name", "networks", @@ -5401,7 +5400,7 @@ "url": "https://www.gnu.org/licenses/agpl-3.0.de.html" }, "title": "metal-api", - "version": "v0.27.0" + "version": "v0.27.1" }, "paths": { "/v1/audit/find": {