Move discencryption package into internal

This commit is contained in:
katexochen 2022-06-28 18:29:29 +02:00 committed by Paul Meyer
parent d8c8b12307
commit 4f93f8f45c
5 changed files with 2 additions and 22 deletions

View File

@ -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"

View File

@ -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"

View File

@ -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)
}