mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-29 01:16:12 -05:00
Move discencryption package into internal
This commit is contained in:
parent
d8c8b12307
commit
4f93f8f45c
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user