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

Update to headscale v0.25.0 #604

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
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
13 changes: 10 additions & 3 deletions cmd/metal-api/internal/headscale/client.go
Original file line number Diff line number Diff line change
@@ -74,14 +74,21 @@ func (h *HeadscaleClient) GetControlPlaneAddress() string {
}

func (h *HeadscaleClient) UserExists(ctx context.Context, name string) bool {
req := &headscalev1.GetUserRequest{
req := &headscalev1.ListUsersRequest{
Name: name,
}
if _, err := h.client.GetUser(ctx, req); err != nil {
resp, err := h.client.ListUsers(ctx, req)
if err != nil {
return false
}
// Should only return one user.
for _, user := range resp.Users {
if user.Name == name {
return true
}
}

return true
return false
}

func (h *HeadscaleClient) CreateUser(ctx context.Context, name string) error {
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ require (
github.com/google/uuid v1.6.0
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.2.0
github.com/juanfont/headscale v0.23.0
github.com/juanfont/headscale v0.25.0
github.com/klauspost/connect-compress/v2 v2.0.0
github.com/looplab/fsm v1.0.2
github.com/metal-stack/go-ipam v1.14.8
@@ -134,7 +134,6 @@ require (
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
@@ -157,7 +156,7 @@ require (
github.com/spf13/pflag v1.0.6 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a // indirect
github.com/tailscale/hujson v0.0.0-20241010212012-29efb4a0184b // indirect
github.com/tklauser/go-sysconf v0.3.14 // indirect
github.com/tklauser/numcpus v0.9.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
@@ -192,11 +191,12 @@ require (
gopkg.in/cenkalti/backoff.v2 v2.2.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gorm.io/driver/postgres v1.5.9 // indirect
gorm.io/driver/postgres v1.5.11 // indirect
gorm.io/gorm v1.25.12 // indirect
modernc.org/libc v1.60.1 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.8.0 // indirect
modernc.org/sqlite v1.32.0 // indirect
tailscale.com v1.72.1 // indirect
modernc.org/sqlite v1.34.5 // indirect
tailscale.com v1.80.0 // indirect
zgo.at/zcache/v2 v2.1.0 // indirect
)
Loading
Loading