Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gomod: Switch UUID package #12471

Merged
merged 19 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f7b3572
gomod: Remove github.com/pborman/uuid dependency
roosterfish Oct 25, 2023
dd97481
lxd/storage/drivers: Generate and parse UUID using github.com/google/…
roosterfish Oct 25, 2023
b3005d9
lxd/instance/drivers: Generate and parse UUID using github.com/google…
roosterfish Oct 26, 2023
0af186d
lxd/instance: Generate UUID using github.com/google/uuid
roosterfish Oct 26, 2023
5b47ffe
lxc-to-lxd: Generate UUID using github.com/google/uuid
roosterfish Oct 26, 2023
98473d7
lxd-migrate: Generate UUID using github.com/google/uuid
roosterfish Oct 26, 2023
de58e2d
lxd/apparmor: Generate UUID using github.com/google/uuid
roosterfish Oct 26, 2023
98b8f28
lxd/bgp: Generate UUID using github.com/google/uuid
roosterfish Oct 26, 2023
2c52e35
lxd/db: Generate UUID using github.com/google/uuid
roosterfish Oct 26, 2023
9c84929
lxd/device: Generate UUID using github.com/google/uuid
roosterfish Oct 26, 2023
3206a5e
lxd/events: Generate UUID using github.com/google/uuid
roosterfish Oct 26, 2023
feb57fe
lxd/firewall/drivers: Generate UUID using github.com/google/uuid
roosterfish Oct 26, 2023
7bebc8e
lxd/operations: Generate UUID using github.com/google/uuid
roosterfish Oct 26, 2023
13c60b4
lxd/rsync: Generate UUID using github.com/google/uuid
roosterfish Oct 26, 2023
72d5fb7
lxd/storage/s3/miniod: Generate UUID using github.com/google/uuid
roosterfish Oct 26, 2023
f208c7c
shared/validate: Parse UUID using github.com/google/uuid
roosterfish Oct 26, 2023
45ad4c1
test/rbac: Generate UUID using github.com/google/uuid
roosterfish Oct 26, 2023
7917e78
lxd/auth/oidc: Generate UUID using github.com/google/uuid
roosterfish Oct 26, 2023
030c28e
lxd: Handler error from oidc.NewVerifier
roosterfish Oct 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
github.com/go-acme/lego/v4 v4.13.3
github.com/go-macaroon-bakery/macaroon-bakery/v3 v3.0.1
github.com/google/gopacket v1.1.19
github.com/google/uuid v1.3.1
github.com/gorilla/mux v1.8.0
github.com/gorilla/websocket v1.5.0
github.com/gosexy/gettext v0.0.0-20160830220431-74466a0a0c4a
Expand All @@ -38,7 +39,6 @@ require (
github.com/mitchellh/mapstructure v1.5.0
github.com/olekukonko/tablewriter v0.0.5
github.com/osrg/gobgp/v3 v3.19.0
github.com/pborman/uuid v1.2.1
github.com/pkg/sftp v1.13.6
github.com/pkg/xattr v0.4.9
github.com/robfig/cron/v3 v3.0.1
Expand Down Expand Up @@ -77,7 +77,6 @@ require (
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/renameio v1.0.1 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/gorilla/schema v1.2.0 // indirect
github.com/gorilla/securecookie v1.1.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
Expand Down
3 changes: 0 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/renameio v1.0.1 h1:Lh/jXZmvZxb0BBeSY5VKEfidcbcbenKjZFzM/q0fSeU=
github.com/google/renameio v1.0.1/go.mod h1:t/HQoYBZSsWSNK35C6CO/TpPLDVWvxOHboWUAweKUpk=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
Expand Down Expand Up @@ -497,8 +496,6 @@ github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6
github.com/osrg/gobgp/v3 v3.19.0 h1:SHjeu707EVp5h2LR8qLxDz/PzFU6oO+jhquGzGsigTI=
github.com/osrg/gobgp/v3 v3.19.0/go.mod h1:TszzyYD/31jXlljifRhxFEmPsITEloZmGU5CTN21W18=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw=
github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
Expand Down
4 changes: 2 additions & 2 deletions lxc-to-lxd/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"os/exec"
"strings"

"github.com/google/uuid"
"github.com/gorilla/websocket"
"github.com/pborman/uuid"

"github.com/canonical/lxd/lxd/migration"
"github.com/canonical/lxd/lxd/rsync"
Expand Down Expand Up @@ -51,7 +51,7 @@ func rsyncSend(conn *websocket.Conn, path string, rsyncArgs string) error {

// Spawn the rsync process.
func rsyncSendSetup(path string, rsyncArgs string) (*exec.Cmd, net.Conn, io.ReadCloser, error) {
auds := fmt.Sprintf("@lxc-to-lxd/%s", uuid.New())
auds := fmt.Sprintf("@lxc-to-lxd/%s", uuid.New().String())
if len(auds) > linux.ABSTRACT_UNIX_SOCK_LEN-1 {
auds = auds[:linux.ABSTRACT_UNIX_SOCK_LEN-1]
}
Expand Down
4 changes: 2 additions & 2 deletions lxd-migrate/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"os/exec"
"strings"

"github.com/google/uuid"
"github.com/gorilla/websocket"
"github.com/pborman/uuid"

"github.com/canonical/lxd/lxd/migration"
"github.com/canonical/lxd/lxd/rsync"
Expand Down Expand Up @@ -54,7 +54,7 @@ func rsyncSend(ctx context.Context, conn *websocket.Conn, path string, rsyncArgs

// Spawn the rsync process.
func rsyncSendSetup(ctx context.Context, path string, rsyncArgs string, instanceType api.InstanceType) (*exec.Cmd, net.Conn, io.ReadCloser, error) {
auds := fmt.Sprintf("@lxd-migrate/%s", uuid.New())
auds := fmt.Sprintf("@lxd-migrate/%s", uuid.New().String())
if len(auds) > linux.ABSTRACT_UNIX_SOCK_LEN-1 {
auds = auds[:linux.ABSTRACT_UNIX_SOCK_LEN-1]
}
Expand Down
6 changes: 5 additions & 1 deletion lxd/api_1.0.go
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,11 @@ func doApi10UpdateTriggers(d *Daemon, nodeChanged, clusterChanged map[string]str
if oidcIssuer == "" || oidcClientID == "" {
d.oidcVerifier = nil
} else {
d.oidcVerifier = oidc.NewVerifier(oidcIssuer, oidcClientID, oidcAudience)
var err error
d.oidcVerifier, err = oidc.NewVerifier(oidcIssuer, oidcClientID, oidcAudience)
if err != nil {
return fmt.Errorf("Failed creating verifier: %w", err)
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions lxd/apparmor/rsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"text/template"

"github.com/pborman/uuid"
"github.com/google/uuid"

"github.com/canonical/lxd/lxd/revert"
"github.com/canonical/lxd/lxd/sys"
Expand Down Expand Up @@ -130,7 +130,7 @@ func rsyncProfileLoad(sysOS *sys.OS, sourcePath string, dstPath string) (string,
defer revert.Fail()

// Generate a temporary profile name.
name := profileName("rsync", uuid.New())
name := profileName("rsync", uuid.New().String())
profilePath := filepath.Join(aaPath, "profiles", name)

// Generate the profile
Expand Down
14 changes: 9 additions & 5 deletions lxd/auth/oidc/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"time"

"github.com/pborman/uuid"
"github.com/google/uuid"
"github.com/zitadel/oidc/v2/pkg/client"
"github.com/zitadel/oidc/v2/pkg/client/rp"
httphelper "github.com/zitadel/oidc/v2/pkg/http"
Expand Down Expand Up @@ -145,7 +145,7 @@ func (o *Verifier) Login(w http.ResponseWriter, r *http.Request) {
return
}

handler := rp.AuthURLHandler(func() string { return uuid.New() }, provider, rp.WithURLParam("audience", o.audience))
handler := rp.AuthURLHandler(func() string { return uuid.New().String() }, provider, rp.WithURLParam("audience", o.audience))
handler(w, r)
}

Expand Down Expand Up @@ -296,10 +296,14 @@ func getAccessTokenVerifier(issuer string) (op.AccessTokenVerifier, error) {
}

// NewVerifier returns a Verifier.
func NewVerifier(issuer string, clientid string, audience string) *Verifier {
cookieKey := []byte(uuid.New())[0:16]
func NewVerifier(issuer string, clientid string, audience string) (*Verifier, error) {
cookieKey, err := uuid.New().MarshalBinary()
roosterfish marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return nil, fmt.Errorf("Failed to create UUID: %w", err)
}

verifier := &Verifier{issuer: issuer, clientID: clientid, audience: audience, cookieKey: cookieKey}
verifier.accessTokenVerifier, _ = getAccessTokenVerifier(issuer)

return verifier
return verifier, nil
}
4 changes: 2 additions & 2 deletions lxd/bgp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"strconv"
"sync"

"github.com/google/uuid"
bgpAPI "github.com/osrg/gobgp/v3/api"
bgpPacket "github.com/osrg/gobgp/v3/pkg/packet/bgp"
bgpServer "github.com/osrg/gobgp/v3/pkg/server"
"github.com/pborman/uuid"
"google.golang.org/protobuf/types/known/anypb"

"github.com/canonical/lxd/lxd/revert"
Expand Down Expand Up @@ -304,7 +304,7 @@ func (s *Server) addPrefix(subnet net.IPNet, nexthop net.IP, owner string) error
}
} else {
// Generate a dummy UUID.
pathUUID = uuid.New()
pathUUID = uuid.New().String()
}

// Add path to the map.
Expand Down
5 changes: 4 additions & 1 deletion lxd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,10 @@ func (d *Daemon) init() error {

// Setup OIDC authentication.
if oidcIssuer != "" && oidcClientID != "" {
d.oidcVerifier = oidc.NewVerifier(oidcIssuer, oidcClientID, oidcAudience)
d.oidcVerifier, err = oidc.NewVerifier(oidcIssuer, oidcClientID, oidcAudience)
if err != nil {
return err
}
}

// Setup BGP listener.
Expand Down
4 changes: 2 additions & 2 deletions lxd/db/warnings.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"time"

"github.com/pborman/uuid"
"github.com/google/uuid"

"github.com/canonical/lxd/lxd/db/cluster"
"github.com/canonical/lxd/lxd/db/warningtype"
Expand Down Expand Up @@ -93,7 +93,7 @@ func (c *Cluster) UpsertWarning(nodeName string, projectName string, entityTypeC
Project: projectName,
EntityTypeCode: entityTypeCode,
EntityID: entityID,
UUID: uuid.New(),
UUID: uuid.New().String(),
TypeCode: typeCode,
Status: warningtype.StatusNew,
FirstSeenDate: now,
Expand Down
4 changes: 2 additions & 2 deletions lxd/device/gpu_mdev.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"path/filepath"
"sync"

"github.com/pborman/uuid"
"github.com/google/uuid"

deviceConfig "github.com/canonical/lxd/lxd/device/config"
pcidev "github.com/canonical/lxd/lxd/device/pci"
Expand Down Expand Up @@ -124,7 +124,7 @@ func (d *gpuMdev) startVM() (*deviceConfig.RunConfig, error) {

// Create the vGPU.
if mdevUUID == "" || !shared.PathExists(fmt.Sprintf("/sys/bus/pci/devices/%s/%s", pciAddress, mdevUUID)) {
mdevUUID = uuid.New()
mdevUUID = uuid.New().String()

err = os.WriteFile(filepath.Join(fmt.Sprintf("/sys/bus/pci/devices/%s/mdev_supported_types/%s/create", pciAddress, d.config["mdev"])), []byte(mdevUUID), 0200)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions lxd/events/devlxdEvents.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"time"

"github.com/pborman/uuid"
"github.com/google/uuid"

"github.com/canonical/lxd/shared"
"github.com/canonical/lxd/shared/api"
Expand Down Expand Up @@ -40,7 +40,7 @@ func (s *DevLXDServer) AddListener(instanceID int, connection EventListenerConne
EventListenerConnection: connection,
messageTypes: messageTypes,
done: cancel.New(context.Background()),
id: uuid.New(),
id: uuid.New().String(),
},
instanceID: instanceID,
}
Expand Down
4 changes: 2 additions & 2 deletions lxd/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"time"

"github.com/pborman/uuid"
"github.com/google/uuid"

"github.com/canonical/lxd/lxd/auth"
"github.com/canonical/lxd/shared"
Expand Down Expand Up @@ -82,7 +82,7 @@ func (s *Server) AddListener(projectName string, allProjects bool, projectPermis
EventListenerConnection: connection,
messageTypes: messageTypes,
done: cancel.New(context.Background()),
id: uuid.New(),
id: uuid.New().String(),
recvFunc: recvFunc,
},

Expand Down
4 changes: 2 additions & 2 deletions lxd/firewall/drivers/drivers_nftables.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
"text/template"

"github.com/pborman/uuid"
"github.com/google/uuid"

"github.com/canonical/lxd/lxd/project"
"github.com/canonical/lxd/shared"
Expand Down Expand Up @@ -97,7 +97,7 @@ func (d Nftables) Compat() (bool, error) {
}

// Check that nftables works at all (some kernels let you list ruleset despite missing support).
testTable := fmt.Sprintf("lxd_test_%s", uuid.New())
testTable := fmt.Sprintf("lxd_test_%s", uuid.New().String())

_, err = shared.RunCommandCLocale("nft", "create", "table", testTable)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions lxd/instance/drivers/driver_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strings"
"time"

"github.com/pborman/uuid"
"github.com/google/uuid"

"github.com/canonical/lxd/lxd/backup"
"github.com/canonical/lxd/lxd/db"
Expand Down Expand Up @@ -1185,7 +1185,7 @@ func (d *common) getRootDiskDevice() (string, map[string]string, error) {

// resetInstanceID generates a new UUID and puts it in volatile.
func (d *common) resetInstanceID() error {
err := d.VolatileSet(map[string]string{"volatile.cloud-init.instance-id": uuid.New()})
err := d.VolatileSet(map[string]string{"volatile.cloud-init.instance-id": uuid.New().String()})
if err != nil {
return fmt.Errorf("Failed to set volatile.cloud-init.instance-id: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions lxd/instance/drivers/driver_lxc.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (

"github.com/checkpoint-restore/go-criu/v6/crit"
"github.com/flosch/pongo2"
"github.com/google/uuid"
"github.com/gorilla/websocket"
liblxc "github.com/lxc/go-lxc"
"github.com/pborman/uuid"
"github.com/pkg/sftp"
"golang.org/x/sync/errgroup"
"golang.org/x/sys/unix"
Expand Down Expand Up @@ -2026,7 +2026,7 @@ func (d *lxc) startCommon() (string, []func() error, error) {
// Generate UUID if not present (do this before UpdateBackupFile() call).
instUUID := d.localConfig["volatile.uuid"]
if instUUID == "" {
instUUID = uuid.New()
instUUID = uuid.New().String()
volatileSet["volatile.uuid"] = instUUID
}

Expand Down
10 changes: 5 additions & 5 deletions lxd/instance/drivers/driver_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import (
"unsafe"

"github.com/flosch/pongo2"
"github.com/google/uuid"
"github.com/gorilla/websocket"
"github.com/kballard/go-shellquote"
"github.com/mdlayher/vsock"
"github.com/pborman/uuid"
"github.com/pkg/sftp"
"golang.org/x/sync/errgroup"
"golang.org/x/sys/unix"
Expand Down Expand Up @@ -1184,7 +1184,7 @@ func (d *qemu) start(stateful bool, op *operationlock.InstanceOperation) error {
// Generate UUID if not present (do this before UpdateBackupFile() call).
instUUID := d.localConfig["volatile.uuid"]
if instUUID == "" {
instUUID = uuid.New()
instUUID = uuid.New().String()
volatileSet["volatile.uuid"] = instUUID
}

Expand Down Expand Up @@ -7583,9 +7583,9 @@ func (d *qemu) nextVsockID() (uint32, *os.File, error) {
}

// Ignore the error from before and start to acquire a new Context ID.
instanceUUID := uuid.Parse(d.localConfig["volatile.uuid"])
if instanceUUID == nil {
return 0, nil, fmt.Errorf("Failed to parse instance UUID from volatile.uuid")
instanceUUID, err := uuid.Parse(d.localConfig["volatile.uuid"])
if err != nil {
return 0, nil, fmt.Errorf("Failed to parse instance UUID from volatile.uuid: %w", err)
}

r, err := util.GetStableRandomGenerator(instanceUUID.String())
Expand Down
8 changes: 4 additions & 4 deletions lxd/instance/instance_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"time"

"github.com/flosch/pongo2"
"github.com/google/uuid"
liblxc "github.com/lxc/go-lxc"
"github.com/pborman/uuid"

"github.com/canonical/lxd/client"
"github.com/canonical/lxd/lxd/backup"
Expand Down Expand Up @@ -743,7 +743,7 @@ func CreateInternal(s *state.State, args db.InstanceArgs, clearLogDir bool) (Ins
}

if args.Config["volatile.uuid"] == "" {
args.Config["volatile.uuid"] = uuid.New()
args.Config["volatile.uuid"] = uuid.New().String()
}

args.Config["volatile.uuid.generation"] = args.Config["volatile.uuid"]
Expand Down Expand Up @@ -772,7 +772,7 @@ func CreateInternal(s *state.State, args db.InstanceArgs, clearLogDir bool) (Ins
// Existing instances will keep using their instance name as instance-id to
// avoid triggering cloud-init on upgrade.
if args.Config["volatile.cloud-init.instance-id"] == "" {
args.Config["volatile.cloud-init.instance-id"] = uuid.New()
args.Config["volatile.cloud-init.instance-id"] = uuid.New().String()
}
}

Expand Down Expand Up @@ -1061,7 +1061,7 @@ func temporaryName(instUUID string) string {
func MoveTemporaryName(inst Instance) (string, error) {
instUUID := inst.LocalConfig()["volatile.uuid"]
if instUUID == "" {
instUUID = uuid.New()
instUUID = uuid.New().String()
err := inst.VolatileSet(map[string]string{"volatile.uuid": instUUID})
if err != nil {
return "", fmt.Errorf("Failed generating instance UUID: %w", err)
Expand Down
4 changes: 2 additions & 2 deletions lxd/instance_put.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"net/http"
"net/url"

"github.com/google/uuid"
"github.com/gorilla/mux"
"github.com/pborman/uuid"

"github.com/canonical/lxd/lxd/db"
"github.com/canonical/lxd/lxd/db/cluster"
Expand Down Expand Up @@ -226,7 +226,7 @@ func instanceSnapRestore(s *state.State, projectName string, name string, snap s
}

// Generate a new `volatile.uuid.generation` to differentiate this instance restored from a snapshot from the original instance.
source.LocalConfig()["volatile.uuid.generation"] = uuid.New()
source.LocalConfig()["volatile.uuid.generation"] = uuid.New().String()

err = inst.Restore(source, stateful)
if err != nil {
Expand Down
Loading
Loading