mirror of
https://github.com/paralus/paralus.git
synced 2026-08-24 15:47:19 +00:00
Format all packages using go fmt
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user