diff --git a/internal/cluster/hash/hash.go b/internal/cluster/hash/hash.go index 008bc4c..71b45ee 100644 --- a/internal/cluster/hash/hash.go +++ b/internal/cluster/hash/hash.go @@ -13,7 +13,7 @@ import ( func GetNodeHashFrom(labels map[string]string, taints []*corev1.Taint, unscheduleable bool) (string, error) { //add sorted labels labelsKeys := make([]string, 0) - for k, _ := range labels { + for k := range labels { labelsKeys = append(labelsKeys, k) } sort.Strings(labelsKeys) diff --git a/internal/models/projectaccountresourcerole.go b/internal/models/projectaccountresourcerole.go index 7ca8b07..a007fbe 100644 --- a/internal/models/projectaccountresourcerole.go +++ b/internal/models/projectaccountresourcerole.go @@ -20,7 +20,7 @@ type ProjectAccountResourcerole struct { OrganizationId uuid.UUID `bun:"organization_id,type:uuid"` PartnerId uuid.UUID `bun:"partner_id,type:uuid"` RoleId uuid.UUID `bun:"role_id,type:uuid"` - AccountId uuid.UUID `bun:"account_id,type:uuid"` + AccountId uuid.UUID `bun:"account_id,type:uuid"` ProjectId uuid.UUID `bun:"project_id,type:uuid"` Active bool `bun:"active,notnull"` } diff --git a/internal/models/role.go b/internal/models/role.go index 037e59d..811aac2 100644 --- a/internal/models/role.go +++ b/internal/models/role.go @@ -18,6 +18,6 @@ type Role struct { Trash bool `bun:"trash,notnull,default:false"` OrganizationId uuid.UUID `bun:"organization_id,type:uuid"` PartnerId uuid.UUID `bun:"partner_id,type:uuid"` - IsGlobal bool `bun:"is_global,notnull,default:true"` // does not matter + IsGlobal bool `bun:"is_global,notnull,default:true"` // does not matter Scope string `bun:"scope,notnull"` } diff --git a/pkg/hasher/hash.go b/pkg/hasher/hash.go index 64c0cf5..02cab29 100644 --- a/pkg/hasher/hash.go +++ b/pkg/hasher/hash.go @@ -121,7 +121,7 @@ func Add(o metav1.Object) error { func GetNodeHashFrom(labels map[string]string, taints []v1.Taint, unscheduleable bool) (string, error) { //add sorted labels labelsKeys := make([]string, 0) - for k, _ := range labels { + for k := range labels { labelsKeys = append(labelsKeys, k) } sort.Strings(labelsKeys) diff --git a/pkg/sentry/authz/generate/generate.go b/pkg/sentry/authz/generate/generate.go index e7f1bd5..ec681f2 100644 --- a/pkg/sentry/authz/generate/generate.go +++ b/pkg/sentry/authz/generate/generate.go @@ -1,3 +1,4 @@ +//go:build ignore // +build ignore package main diff --git a/pkg/service/test_utils.go b/pkg/service/test_utils.go index 40e43e7..3d2a00c 100644 --- a/pkg/service/test_utils.go +++ b/pkg/service/test_utils.go @@ -23,7 +23,6 @@ func performBasicAuthzChecks(t *testing.T, mazc mockAuthzClient, cpCount, dpCoun } } - func performBasicAuthProviderChecks(t *testing.T, ma mockAuthProvider, cCount, uCount, rCount, dCount int) { if len(ma.c) != cCount { t.Errorf("unexpected number of calls to Auth Provider Create; expctex '%v', got '%v'", cCount, len(ma.c)) diff --git a/proto/types/infrapb/v3/clusterconditiontype.enum.go b/proto/types/infrapb/v3/clusterconditiontype.enum.go index b40c61d..ad64e5c 100644 --- a/proto/types/infrapb/v3/clusterconditiontype.enum.go +++ b/proto/types/infrapb/v3/clusterconditiontype.enum.go @@ -30,13 +30,16 @@ func (e ClusterConditionType) MarshalJSON() ([]byte, error) { func (e *ClusterConditionType) UnmarshalJSON(b []byte) error { if b != nil { var length int - if len(b) > 1 { length = len(b) - 1 } else { length = len(b) } + if len(b) > 1 { + length = len(b) - 1 + } else { + length = len(b) + } *e = ClusterConditionType(ClusterConditionType_value[string(b[1:length])]) } return nil } // implement proto enum interface -func (e ClusterConditionType) IsEnum() { +func (e ClusterConditionType) IsEnum() { } - diff --git a/proto/types/infrapb/v3/clusternodestate.enum.go b/proto/types/infrapb/v3/clusternodestate.enum.go index 6792d0e..1025eec 100644 --- a/proto/types/infrapb/v3/clusternodestate.enum.go +++ b/proto/types/infrapb/v3/clusternodestate.enum.go @@ -1,10 +1,9 @@ - // Code generated by go generate; DO NOT EDIT. package infrav3 import ( - driver "database/sql/driver" bytes "bytes" + driver "database/sql/driver" ) // Scan converts database string to ClusterNodeState @@ -36,6 +35,5 @@ func (e *ClusterNodeState) UnmarshalJSON(b []byte) error { } // implement proto enum interface -func (e ClusterNodeState) IsEnum() { +func (e ClusterNodeState) IsEnum() { } - diff --git a/proto/types/infrapb/v3/clustersharemode.enum.go b/proto/types/infrapb/v3/clustersharemode.enum.go index 1987fac..2fce802 100644 --- a/proto/types/infrapb/v3/clustersharemode.enum.go +++ b/proto/types/infrapb/v3/clustersharemode.enum.go @@ -1,10 +1,9 @@ - // Code generated by go generate; DO NOT EDIT. package infrav3 import ( - driver "database/sql/driver" bytes "bytes" + driver "database/sql/driver" ) // Scan converts database string to ClusterShareMode @@ -36,6 +35,5 @@ func (e *ClusterShareMode) UnmarshalJSON(b []byte) error { } // implement proto enum interface -func (e ClusterShareMode) IsEnum() { +func (e ClusterShareMode) IsEnum() { } - diff --git a/proto/types/infrapb/v3/clustertokenstate.enum.go b/proto/types/infrapb/v3/clustertokenstate.enum.go index 588469d..e1f64bc 100644 --- a/proto/types/infrapb/v3/clustertokenstate.enum.go +++ b/proto/types/infrapb/v3/clustertokenstate.enum.go @@ -1,10 +1,9 @@ - // Code generated by go generate; DO NOT EDIT. package infrav3 import ( - driver "database/sql/driver" bytes "bytes" + driver "database/sql/driver" ) // Scan converts database string to ClusterTokenState @@ -36,6 +35,5 @@ func (e *ClusterTokenState) UnmarshalJSON(b []byte) error { } // implement proto enum interface -func (e ClusterTokenState) IsEnum() { +func (e ClusterTokenState) IsEnum() { } - diff --git a/proto/types/infrapb/v3/clustertokentype.enum.go b/proto/types/infrapb/v3/clustertokentype.enum.go index da89fe9..ca18dee 100644 --- a/proto/types/infrapb/v3/clustertokentype.enum.go +++ b/proto/types/infrapb/v3/clustertokentype.enum.go @@ -1,10 +1,9 @@ - // Code generated by go generate; DO NOT EDIT. package infrav3 import ( - driver "database/sql/driver" bytes "bytes" + driver "database/sql/driver" ) // Scan converts database string to ClusterTokenType @@ -36,6 +35,5 @@ func (e *ClusterTokenType) UnmarshalJSON(b []byte) error { } // implement proto enum interface -func (e ClusterTokenType) IsEnum() { +func (e ClusterTokenType) IsEnum() { } - diff --git a/proto/types/sentry/bootstrapagentmode.enum.go b/proto/types/sentry/bootstrapagentmode.enum.go index 729831c..d8144cb 100644 --- a/proto/types/sentry/bootstrapagentmode.enum.go +++ b/proto/types/sentry/bootstrapagentmode.enum.go @@ -1,10 +1,9 @@ - // Code generated by go generate; DO NOT EDIT. package sentry import ( - driver "database/sql/driver" bytes "bytes" + driver "database/sql/driver" ) // Scan converts database string to BootstrapAgentMode @@ -36,6 +35,5 @@ func (e *BootstrapAgentMode) UnmarshalJSON(b []byte) error { } // implement proto enum interface -func (e BootstrapAgentMode) IsEnum() { +func (e BootstrapAgentMode) IsEnum() { } - diff --git a/proto/types/sentry/bootstrapagentstate.enum.go b/proto/types/sentry/bootstrapagentstate.enum.go index edc0a81..07bb387 100644 --- a/proto/types/sentry/bootstrapagentstate.enum.go +++ b/proto/types/sentry/bootstrapagentstate.enum.go @@ -1,10 +1,9 @@ - // Code generated by go generate; DO NOT EDIT. package sentry import ( - driver "database/sql/driver" bytes "bytes" + driver "database/sql/driver" ) // Scan converts database string to BootstrapAgentState @@ -36,6 +35,5 @@ func (e *BootstrapAgentState) UnmarshalJSON(b []byte) error { } // implement proto enum interface -func (e BootstrapAgentState) IsEnum() { +func (e BootstrapAgentState) IsEnum() { } - diff --git a/proto/types/sentry/bootstrapagenttemplatetype.enum.go b/proto/types/sentry/bootstrapagenttemplatetype.enum.go index 7f51912..96b57fd 100644 --- a/proto/types/sentry/bootstrapagenttemplatetype.enum.go +++ b/proto/types/sentry/bootstrapagenttemplatetype.enum.go @@ -1,10 +1,9 @@ - // Code generated by go generate; DO NOT EDIT. package sentry import ( - driver "database/sql/driver" bytes "bytes" + driver "database/sql/driver" ) // Scan converts database string to BootstrapAgentTemplateType @@ -36,6 +35,5 @@ func (e *BootstrapAgentTemplateType) UnmarshalJSON(b []byte) error { } // implement proto enum interface -func (e BootstrapAgentTemplateType) IsEnum() { +func (e BootstrapAgentTemplateType) IsEnum() { } - diff --git a/proto/types/sentry/bootstrapagenttype.enum.go b/proto/types/sentry/bootstrapagenttype.enum.go index b0cf889..e42f1d8 100644 --- a/proto/types/sentry/bootstrapagenttype.enum.go +++ b/proto/types/sentry/bootstrapagenttype.enum.go @@ -1,10 +1,9 @@ - // Code generated by go generate; DO NOT EDIT. package sentry import ( - driver "database/sql/driver" bytes "bytes" + driver "database/sql/driver" ) // Scan converts database string to BootstrapAgentType @@ -36,6 +35,5 @@ func (e *BootstrapAgentType) UnmarshalJSON(b []byte) error { } // implement proto enum interface -func (e BootstrapAgentType) IsEnum() { +func (e BootstrapAgentType) IsEnum() { } - diff --git a/proto/types/sentry/bootstrapinfratype.enum.go b/proto/types/sentry/bootstrapinfratype.enum.go index d90078a..43b3b86 100644 --- a/proto/types/sentry/bootstrapinfratype.enum.go +++ b/proto/types/sentry/bootstrapinfratype.enum.go @@ -1,10 +1,9 @@ - // Code generated by go generate; DO NOT EDIT. package sentry import ( - driver "database/sql/driver" bytes "bytes" + driver "database/sql/driver" ) // Scan converts database string to BootstrapInfraType @@ -36,6 +35,5 @@ func (e *BootstrapInfraType) UnmarshalJSON(b []byte) error { } // implement proto enum interface -func (e BootstrapInfraType) IsEnum() { +func (e BootstrapInfraType) IsEnum() { } - diff --git a/proto/types/sentry/bootstraptemplatehosttype.enum.go b/proto/types/sentry/bootstraptemplatehosttype.enum.go index e231225..8e0ddff 100644 --- a/proto/types/sentry/bootstraptemplatehosttype.enum.go +++ b/proto/types/sentry/bootstraptemplatehosttype.enum.go @@ -1,10 +1,9 @@ - // Code generated by go generate; DO NOT EDIT. package sentry import ( - driver "database/sql/driver" bytes "bytes" + driver "database/sql/driver" ) // Scan converts database string to BootstrapTemplateHostType @@ -36,6 +35,5 @@ func (e *BootstrapTemplateHostType) UnmarshalJSON(b []byte) error { } // implement proto enum interface -func (e BootstrapTemplateHostType) IsEnum() { +func (e BootstrapTemplateHostType) IsEnum() { } - diff --git a/scripts/initialize/main.go b/scripts/initialize/main.go index 853a415..8f2304b 100644 --- a/scripts/initialize/main.go +++ b/scripts/initialize/main.go @@ -201,7 +201,7 @@ func main() { // should we directly interact with kratos and create a user with a password? _, err = us.Create(context.Background(), &userv3.User{ Metadata: &commonv3.Metadata{Name: *oae, Partner: *partner, Organization: *org, Description: "..."}, - Spec: &userv3.UserSpec{FirstName: *oafn, LastName: *oaln, ProjectNamespaceRoles: []*userv3.ProjectNamespaceRole{{Role: "ADMIN"}}}, + Spec: &userv3.UserSpec{FirstName: *oafn, LastName: *oaln, ProjectNamespaceRoles: []*userv3.ProjectNamespaceRole{{Role: "ADMIN"}}}, }) if err != nil {