1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 20:35:25 +02:00

fix(app): add github action for linting and formatting [EE-2344] (#6356)

This commit is contained in:
Chaim Lev-Ari 2022-01-17 07:53:32 +02:00 committed by GitHub
parent 34cc8ea96a
commit 1b1a50d6b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
313 changed files with 2685 additions and 3873 deletions

View file

@ -34,10 +34,10 @@ func (store *Store) Init() error {
AutoCreateUsers: true,
TLSConfig: portainer.TLSConfiguration{},
SearchSettings: []portainer.LDAPSearchSettings{
portainer.LDAPSearchSettings{},
{},
},
GroupSearchSettings: []portainer.LDAPGroupSearchSettings{
portainer.LDAPGroupSearchSettings{},
{},
},
},
OAuthSettings: portainer.OAuthSettings{},

View file

@ -95,7 +95,7 @@ func createEdgeClient(endpoint *portainer.Endpoint, signatureService portainer.D
if err != nil {
return nil, err
}
endpointURL := fmt.Sprintf("http://127.0.0.1:%d", tunnel.Port)
return client.NewClientWithOpts(

View file

@ -33,7 +33,7 @@ func (s StringSet) List() []string {
list := make([]string, s.Len())
i := 0
for k, _ := range s {
for k := range s {
list[i] = k
i++
}

View file

@ -4,9 +4,9 @@ import (
"errors"
httperror "github.com/portainer/libhttp/error"
"github.com/portainer/libhttp/request"
portainer "github.com/portainer/portainer/api"
"strconv"
"strings"
portainer "github.com/portainer/portainer/api"
"net/http"
)

View file

@ -21,7 +21,7 @@ type registryConfigurePayload struct {
// Password used to authenticate against this registry. required when Authentication is true
Password string `example:"registry_password"`
// ECR region
Region string
Region string
// Use TLS
TLS bool `example:"true"`
// Skip the verification of the server TLS certificate

View file

@ -25,13 +25,13 @@ type registryUpdatePayload struct {
// Username used to authenticate against this registry. Required when Authentication is true
Username *string `example:"registry_user"`
// Password used to authenticate against this registry. required when Authentication is true
Password *string `example:"registry_password"`
Password *string `example:"registry_password"`
// Quay data
Quay *portainer.QuayRegistryData
Quay *portainer.QuayRegistryData
// Registry access control
RegistryAccesses *portainer.RegistryAccesses `json:",omitempty"`
// ECR data
Ecr *portainer.EcrData `json:",omitempty"`
Ecr *portainer.EcrData `json:",omitempty"`
}
func (payload *registryUpdatePayload) Validate(r *http.Request) error {

View file

@ -17,7 +17,7 @@ import (
type webhookCreatePayload struct {
ResourceID string
EndpointID int
RegistryID portainer.RegistryID
RegistryID portainer.RegistryID
WebhookType int
}

View file

@ -80,13 +80,13 @@ func (handler *Handler) executeServiceWebhook(
}
service.Spec.TaskTemplate.ForceUpdate++
var imageName = strings.Split(service.Spec.TaskTemplate.ContainerSpec.Image, "@sha")[0]
if imageTag != "" {
var tagIndex = strings.LastIndex(imageName, ":")
if tagIndex == -1 {
tagIndex = len(imageName)
tagIndex = len(imageName)
}
service.Spec.TaskTemplate.ContainerSpec.Image = imageName[:tagIndex] + ":" + imageTag
} else {

View file

@ -12,4 +12,4 @@ func (transport *baseTransport) proxyDeploymentsRequest(request *http.Request, n
default:
return transport.executeKubernetesRequest(request)
}
}
}

View file

@ -12,4 +12,4 @@ func (transport *baseTransport) proxyPodsRequest(request *http.Request, namespac
default:
return transport.executeKubernetesRequest(request)
}
}
}

View file

@ -14,4 +14,4 @@ func (transport *baseTransport) refreshRegistry(request *http.Request, namespace
err = registryutils.RefreshEcrSecret(cli, transport.endpoint, transport.dataStore, namespace)
return
}
}

View file

@ -101,4 +101,4 @@ func Test_FilterByExcludeIDs(t *testing.T) {
tt.asserts(t, output)
})
}
}
}

View file

@ -50,7 +50,7 @@ func (factory *ClientFactory) GetInstanceID() (instanceID string) {
}
// Remove the cached kube client so a new one can be created
func (factory *ClientFactory) RemoveKubeClient(endpointID portainer.EndpointID) {
func (factory *ClientFactory) RemoveKubeClient(endpointID portainer.EndpointID) {
factory.endpointClients.Remove(strconv.Itoa(int(endpointID)))
}

View file

@ -16,8 +16,8 @@ import (
const (
secretDockerConfigKey = ".dockerconfigjson"
labelRegistryType = "io.portainer.kubernetes.registry.type"
annotationRegistryID = "portainer.io/registry.id"
labelRegistryType = "io.portainer.kubernetes.registry.type"
annotationRegistryID = "portainer.io/registry.id"
)
type (