diff --git a/coordinator/diskencryption/diskencryption.go b/coordinator/internal/diskencryption/diskencryption.go similarity index 100% rename from coordinator/diskencryption/diskencryption.go rename to coordinator/internal/diskencryption/diskencryption.go diff --git a/coordinator/diskencryption/diskencryption_test.go b/coordinator/internal/diskencryption/diskencryption_test.go similarity index 100% rename from coordinator/diskencryption/diskencryption_test.go rename to coordinator/internal/diskencryption/diskencryption_test.go diff --git a/coordinator/internal/initserver/initserver.go b/coordinator/internal/initserver/initserver.go index fc5d90624..117e6b880 100644 --- a/coordinator/internal/initserver/initserver.go +++ b/coordinator/internal/initserver/initserver.go @@ -8,8 +8,8 @@ import ( "sync" "github.com/edgelesssys/constellation/coordinator/config" - "github.com/edgelesssys/constellation/coordinator/diskencryption" "github.com/edgelesssys/constellation/coordinator/initproto" + "github.com/edgelesssys/constellation/coordinator/internal/diskencryption" "github.com/edgelesssys/constellation/coordinator/internal/kubernetes" "github.com/edgelesssys/constellation/coordinator/nodestate" "github.com/edgelesssys/constellation/coordinator/role" diff --git a/coordinator/internal/joinclient/client.go b/coordinator/internal/joinclient/client.go index f7fe845d0..9f66ef955 100644 --- a/coordinator/internal/joinclient/client.go +++ b/coordinator/internal/joinclient/client.go @@ -10,7 +10,7 @@ import ( "time" "github.com/edgelesssys/constellation/activation/activationproto" - "github.com/edgelesssys/constellation/coordinator/diskencryption" + "github.com/edgelesssys/constellation/coordinator/internal/diskencryption" "github.com/edgelesssys/constellation/coordinator/nodestate" "github.com/edgelesssys/constellation/coordinator/role" "github.com/edgelesssys/constellation/internal/cloud/metadata" diff --git a/coordinator/util/util.go b/coordinator/util/util.go index 5d863ca38..37b8ccb08 100644 --- a/coordinator/util/util.go +++ b/coordinator/util/util.go @@ -3,7 +3,6 @@ package util import ( "crypto/rand" "crypto/sha256" - "fmt" "io" "math/big" "net" @@ -49,22 +48,3 @@ func GetIPAddr() (string, error) { return localAddr.IP.String(), nil } - -func GetInterfaceIP(netInterface string) (string, error) { - netif, err := net.InterfaceByName(netInterface) - if err != nil { - return "", fmt.Errorf("finding interface %s: %w", netInterface, err) - } - addrs, err := netif.Addrs() - if err != nil { - return "", fmt.Errorf("retrieving interface ip addresses %s: %w", netInterface, err) - } - for _, addr := range addrs { - if ipn, ok := addr.(*net.IPNet); ok { - if ip := ipn.IP.To4(); ip != nil { - return ip.String(), nil - } - } - } - return "", fmt.Errorf("interface %s don't have an ipv4 address", netInterface) -}