Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/metal-stack/metal-api int…
Browse files Browse the repository at this point in the history
…o dualstack-support
  • Loading branch information
majst01 committed Aug 14, 2024
2 parents f553164 + f0628c1 commit f408888
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package migrations_integration

import (
"context"
"fmt"
"log/slog"
"os"
"time"
Expand Down Expand Up @@ -236,13 +235,13 @@ func Test_MigrationChildPrefixLength(t *testing.T) {
n1fetched, err := rs.FindNetworkByID(n1.ID)
require.NoError(t, err)
require.NotNil(t, n1fetched)
require.Equal(t, p1.PrivateNetworkPrefixLength, n1fetched.DefaultChildPrefixLength[metal.IPv4AddressFamily], fmt.Sprintf("childprefixlength:%v", n1fetched.DefaultChildPrefixLength))
require.Equal(t, p1.PrivateNetworkPrefixLength, n1fetched.DefaultChildPrefixLength[metal.IPv4AddressFamily], "childprefixlength:%v", n1fetched.DefaultChildPrefixLength)
require.True(t, n1fetched.AddressFamilies[metal.IPv4AddressFamily])

n2fetched, err := rs.FindNetworkByID(n2.ID)
require.NoError(t, err)
require.NotNil(t, n2fetched)
require.Equal(t, p2.PrivateNetworkPrefixLength, n2fetched.DefaultChildPrefixLength[metal.IPv6AddressFamily], fmt.Sprintf("childprefixlength:%v", n2fetched.DefaultChildPrefixLength))
require.Equal(t, p2.PrivateNetworkPrefixLength, n2fetched.DefaultChildPrefixLength[metal.IPv6AddressFamily], "childprefixlength:%v", n2fetched.DefaultChildPrefixLength)
require.True(t, n2fetched.AddressFamilies[metal.IPv6AddressFamily])

n3fetched, err := rs.FindNetworkByID(n3.ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"log/slog"
"net"
Expand Down Expand Up @@ -226,7 +227,7 @@ func allocMachine(container *restful.Container, ar v1.MachineAllocateRequest) (v
resp := w.Result()
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return v1.MachineResponse{}, fmt.Errorf(w.Body.String())
return v1.MachineResponse{}, errors.New(w.Body.String())
}
var result v1.MachineResponse
err = json.NewDecoder(resp.Body).Decode(&result)
Expand All @@ -248,7 +249,7 @@ func freeMachine(container *restful.Container, id string) (v1.MachineResponse, e
resp := w.Result()
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return v1.MachineResponse{}, fmt.Errorf(w.Body.String())
return v1.MachineResponse{}, errors.New(w.Body.String())
}
var result v1.MachineResponse
err = json.NewDecoder(resp.Body).Decode(&result)
Expand Down

0 comments on commit f408888

Please sign in to comment.