Revert "[relay] Update GO version and QUIC version (#4736)" (#5055)

This reverts commit 8722b79799.
This commit is contained in:
Maycon Santos
2026-01-07 21:02:20 +03:00
committed by GitHub
parent 8722b79799
commit 24df442198
78 changed files with 341 additions and 312 deletions

View File

@@ -1006,7 +1006,7 @@ func (am *DefaultAccountManager) isCacheFresh(ctx context.Context, accountUsers
for user, loggedInOnce := range accountUsers {
if datum, ok := userDataMap[user]; ok {
// check if the matching user data has a pending invite and if the user has logged in once, forcing the cache to be refreshed
if datum.AppMetadata.WTPendingInvite != nil && *datum.AppMetadata.WTPendingInvite && loggedInOnce == true { //nolint
if datum.AppMetadata.WTPendingInvite != nil && *datum.AppMetadata.WTPendingInvite && loggedInOnce == true { //nolint:gosimple
log.WithContext(ctx).Infof("user %s has a pending invite and has logged in once, cache invalid", user)
return false
}

View File

@@ -753,7 +753,7 @@ func TestAccountManager_SetOrUpdateDomain(t *testing.T) {
t.Fatalf("expected to create an account for a user %s", userId)
}
if account.Domain != domain {
if account != nil && account.Domain != domain {
t.Errorf("setting account domain failed, expected %s, got %s", domain, account.Domain)
}
@@ -768,7 +768,7 @@ func TestAccountManager_SetOrUpdateDomain(t *testing.T) {
t.Fatalf("expected to get an account for a user %s", userId)
}
if account.Domain != domain {
if account != nil && account.Domain != domain {
t.Errorf("updating domain. expected %s got %s", domain, account.Domain)
}
}

View File

@@ -46,7 +46,7 @@ func initPostureChecksTestData(postureChecks ...*posture.Checks) *postureChecksH
testPostureChecks[postureChecks.ID] = postureChecks
if err := postureChecks.Validate(); err != nil {
return nil, status.Errorf(status.InvalidArgument, "%v", err) //nolint
return nil, status.Errorf(status.InvalidArgument, "%s", err.Error()) //nolint
}
return postureChecks, nil

View File

@@ -1,4 +1,5 @@
//go:build benchmark
// +build benchmark
package benchmarks

View File

@@ -1,4 +1,5 @@
//go:build benchmark
// +build benchmark
package benchmarks

View File

@@ -1,4 +1,5 @@
//go:build benchmark
// +build benchmark
package benchmarks

View File

@@ -1,4 +1,5 @@
//go:build integration
// +build integration
package integration

View File

@@ -121,7 +121,7 @@ func NewPocketIdManager(config PocketIdClientConfig, appMetrics telemetry.AppMet
func (p *PocketIdManager) request(ctx context.Context, method, resource string, query *url.Values, body string) ([]byte, error) {
var MethodsWithBody = []string{http.MethodPost, http.MethodPut}
if !slices.Contains(MethodsWithBody, method) && body != "" {
return nil, fmt.Errorf("body provided to unsupported method: %s", method)
return nil, fmt.Errorf("Body provided to unsupported method: %s", method)
}
reqURL := fmt.Sprintf("%s/api/%s", p.managementEndpoint, resource)
@@ -301,7 +301,7 @@ func (p *PocketIdManager) CreateUser(ctx context.Context, email, name, accountID
if p.appMetrics != nil {
p.appMetrics.IDPMetrics().CountCreateUser()
}
pending := true
var pending bool = true
ret := &UserData{
Email: email,
Name: name,

View File

@@ -357,7 +357,7 @@ func (zm *ZitadelManager) CreateUser(ctx context.Context, email, name, accountID
return nil, err
}
pending := true
var pending bool = true
ret := &UserData{
Email: email,
Name: name,

View File

@@ -393,7 +393,7 @@ func CreateIndexIfNotExists[T any](ctx context.Context, db *gorm.DB, indexName s
return fmt.Errorf("failed to parse model schema: %w", err)
}
tableName := stmt.Schema.Table
dialect := db.Name()
dialect := db.Dialector.Name()
if db.Migrator().HasIndex(&model, indexName) {
log.WithContext(ctx).Infof("index %s already exists on table %s", indexName, tableName)

View File

@@ -20,7 +20,7 @@ import (
const domainPattern = `^(?i)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*[*.a-z]{1,}$`
var errInvalidDomainName = errors.New("invalid domain name")
var invalidDomainName = errors.New("invalid domain name")
// GetNameServerGroup gets a nameserver group object from account and nameserver group IDs
func (am *DefaultAccountManager) GetNameServerGroup(ctx context.Context, accountID, userID, nsGroupID string) (*nbdns.NameServerGroup, error) {
@@ -314,7 +314,7 @@ func validateDomain(domain string) error {
_, valid := dns.IsDomainName(domain)
if !valid {
return errInvalidDomainName
return invalidDomainName
}
return nil

View File

@@ -158,7 +158,7 @@ func arePostureCheckChangesAffectPeers(ctx context.Context, transaction store.St
// validatePostureChecks validates the posture checks.
func validatePostureChecks(ctx context.Context, transaction store.Store, accountID string, postureChecks *posture.Checks) error {
if err := postureChecks.Validate(); err != nil {
return status.Errorf(status.InvalidArgument, "%v", err.Error()) //nolint
return status.Errorf(status.InvalidArgument, "%s", err.Error()) //nolint
}
// If the posture check already has an ID, verify its existence in the store.

View File

@@ -997,10 +997,9 @@ func TestGetAccount_ComprehensiveFieldValidation(t *testing.T) {
// Find posture checks by ID
var pc1, pc2 *posture.Checks
for _, pc := range retrievedAccount.PostureChecks {
switch pc.ID {
case postureCheckID1:
if pc.ID == postureCheckID1 {
pc1 = pc
case postureCheckID2:
} else if pc.ID == postureCheckID2 {
pc2 = pc
}
}

View File

@@ -30,6 +30,7 @@ import (
"github.com/netbirdio/netbird/management/server/types"
"github.com/netbirdio/netbird/management/server/util"
nbroute "github.com/netbirdio/netbird/route"
route2 "github.com/netbirdio/netbird/route"
"github.com/netbirdio/netbird/shared/management/status"
"github.com/netbirdio/netbird/util/crypt"
)
@@ -109,12 +110,12 @@ func runLargeTest(t *testing.T, store Store) {
AccountID: account.Id,
}
account.Users[user.Id] = user
route := &nbroute.Route{
ID: nbroute.ID(fmt.Sprintf("network-id-%d", n)),
route := &route2.Route{
ID: route2.ID(fmt.Sprintf("network-id-%d", n)),
Description: "base route",
NetID: nbroute.NetID(fmt.Sprintf("network-id-%d", n)),
NetID: route2.NetID(fmt.Sprintf("network-id-%d", n)),
Network: netip.MustParsePrefix(netIP.String() + "/24"),
NetworkType: nbroute.IPv4Network,
NetworkType: route2.IPv4Network,
Metric: 9999,
Masquerade: false,
Enabled: true,
@@ -688,7 +689,7 @@ func TestMigrate(t *testing.T) {
require.NoError(t, err, "Failed to insert Gob data")
type route struct {
nbroute.Route
route2.Route
Network netip.Prefix `gorm:"serializer:gob"`
PeerGroups []string `gorm:"serializer:gob"`
}
@@ -697,7 +698,7 @@ func TestMigrate(t *testing.T) {
rt := &route{
Network: prefix,
PeerGroups: []string{"group1", "group2"},
Route: nbroute.Route{ID: "route1"},
Route: route2.Route{ID: "route1"},
}
err = store.(*SqlStore).db.Save(rt).Error
@@ -713,7 +714,7 @@ func TestMigrate(t *testing.T) {
require.NoError(t, err, "Failed to delete Gob data")
prefix = netip.MustParsePrefix("12.0.0.0/24")
nRT := &nbroute.Route{
nRT := &route2.Route{
Network: prefix,
ID: "route2",
Peer: "peer-id",
@@ -3543,13 +3544,13 @@ func TestSqlStore_SaveRoute(t *testing.T) {
accountID := "bf1c8084-ba50-4ce7-9439-34653001fc3b"
route := &nbroute.Route{
route := &route2.Route{
ID: "route-id",
AccountID: accountID,
Network: netip.MustParsePrefix("10.10.0.0/16"),
NetID: "netID",
PeerGroups: []string{"routeA"},
NetworkType: nbroute.IPv4Network,
NetworkType: route2.IPv4Network,
Masquerade: true,
Metric: 9999,
Enabled: true,

View File

@@ -1,4 +1,5 @@
//go:build !ios
// +build !ios
package testutil

View File

@@ -1,4 +1,5 @@
//go:build ios
// +build ios
package testutil