mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 08:57:17 +00:00
parent
1c5fc0076e
commit
a724574ede
45 changed files with 57 additions and 57 deletions
2
Makefile
2
Makefile
|
|
@ -384,7 +384,7 @@ start-local: mod-vendor-local
|
|||
ARGOCD_E2E_TEST=false \
|
||||
goreman -f $(ARGOCD_PROCFILE) start ${ARGOCD_START}
|
||||
|
||||
# Runs pre-commit validaiton with the virtualized toolchain
|
||||
# Runs pre-commit validation with the virtualized toolchain
|
||||
.PHONY: pre-commit
|
||||
pre-commit: dep-ensure codegen build lint test
|
||||
|
||||
|
|
|
|||
|
|
@ -2511,7 +2511,7 @@
|
|||
},
|
||||
"repocredsRepoCredsResponse": {
|
||||
"type": "object",
|
||||
"title": "RepoCredsResponse is a resonse to most repository credentials requests"
|
||||
"title": "RepoCredsResponse is a response to most repository credentials requests"
|
||||
},
|
||||
"repositoryAppInfo": {
|
||||
"type": "object",
|
||||
|
|
@ -2615,7 +2615,7 @@
|
|||
"$ref": "#/definitions/repositoryKsonnetEnvironmentDestination"
|
||||
},
|
||||
"k8sVersion": {
|
||||
"description": "KubernetesVersion is the kubernetes version the targetted cluster is running on.",
|
||||
"description": "KubernetesVersion is the kubernetes version the targeted cluster is running on.",
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
|
|
@ -4590,7 +4590,7 @@
|
|||
},
|
||||
"syncOptions": {
|
||||
"type": "array",
|
||||
"title": "Options allow youe to specify whole app sync-options",
|
||||
"title": "Options allow you to specify whole app sync-options",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -569,7 +569,7 @@ func setAppSpecOptions(flags *pflag.FlagSet, spec *argoappv1.ApplicationSpec, ap
|
|||
}
|
||||
if flags.Changed("self-heal") {
|
||||
if spec.SyncPolicy == nil || spec.SyncPolicy.Automated == nil {
|
||||
log.Fatal("Cannot set --self-helf: application not configured with automatic sync")
|
||||
log.Fatal("Cannot set --self-heal: application not configured with automatic sync")
|
||||
}
|
||||
spec.SyncPolicy.Automated.SelfHeal = appOpts.selfHeal
|
||||
}
|
||||
|
|
|
|||
|
|
@ -549,7 +549,7 @@ func (ctrl *ApplicationController) processAppComparisonTypeQueueItem() (processN
|
|||
return
|
||||
}
|
||||
|
||||
// shouldbeDeleted returns whether a given resource obj should be deleted on cascade delete of application app
|
||||
// shouldBeDeleted returns whether a given resource obj should be deleted on cascade delete of application app
|
||||
func (ctrl *ApplicationController) shouldBeDeleted(app *appv1.Application, obj *unstructured.Unstructured) bool {
|
||||
return !kube.IsCRD(obj) && !isSelfReferencedApp(app, kube.GetObjectRef(obj))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -470,7 +470,7 @@ func TestFinalizeAppDeletion(t *testing.T) {
|
|||
assert.True(t, patched)
|
||||
}
|
||||
|
||||
// Ensure any stray resources irregulary labeled with instance label of app are not deleted upon deleting,
|
||||
// Ensure any stray resources irregularly labeled with instance label of app are not deleted upon deleting,
|
||||
// when app project restriction is in place
|
||||
{
|
||||
defaultProj := argoappv1.AppProject{
|
||||
|
|
|
|||
6
controller/cache/cache.go
vendored
6
controller/cache/cache.go
vendored
|
|
@ -188,9 +188,9 @@ var (
|
|||
}
|
||||
)
|
||||
|
||||
// skipAppRequeing checks if the object is an API type which we want to skip requeuing against.
|
||||
// skipAppRequeuing checks if the object is an API type which we want to skip requeuing against.
|
||||
// We ignore API types which have a high churn rate, and/or whose updates are irrelevant to the app
|
||||
func skipAppRequeing(key kube.ResourceKey) bool {
|
||||
func skipAppRequeuing(key kube.ResourceKey) bool {
|
||||
return ignoredRefreshResources[key.Group+"/"+key.Kind]
|
||||
}
|
||||
|
||||
|
|
@ -244,7 +244,7 @@ func (c *liveStateCache) getCluster(server string) (clustercache.ClusterCache, e
|
|||
continue
|
||||
}
|
||||
app := getApp(r, namespaceResources)
|
||||
if app == "" || skipAppRequeing(r.ResourceKey()) {
|
||||
if app == "" || skipAppRequeuing(r.ResourceKey()) {
|
||||
continue
|
||||
}
|
||||
toNotify[app] = isRootAppNode(r) || toNotify[app]
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ metadata:
|
|||
type: Opaque
|
||||
data:
|
||||
# TLS certificate and private key for API server (required).
|
||||
# Autogenerated with a self-signed ceritificate when keys are missing or invalid.
|
||||
# Autogenerated with a self-signed certificate when keys are missing or invalid.
|
||||
tls.crt:
|
||||
tls.key:
|
||||
|
||||
|
|
|
|||
|
|
@ -3146,7 +3146,7 @@
|
|||
"timeFrom": null,
|
||||
"timeRegions": [],
|
||||
"timeShift": null,
|
||||
"title": "Git Requets (ls-remote)",
|
||||
"title": "Git Requests (ls-remote)",
|
||||
"tooltip": {
|
||||
"shared": true,
|
||||
"sort": 2,
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ func getCustomResourceDefinitions() map[string]*extensionsobj.CustomResourceDefi
|
|||
|
||||
// We need to completely remove validation of problematic fields such as creationTimestamp,
|
||||
// which get marshalled to `null`, but are typed as as a `string` during Open API validation
|
||||
removeValidataion(un, "metadata.creationTimestamp")
|
||||
removeValidation(un, "metadata.creationTimestamp")
|
||||
|
||||
crd := toCRD(un)
|
||||
crd.Labels = map[string]string{
|
||||
|
|
@ -65,7 +65,7 @@ func deleteFile(path string) {
|
|||
checkErr(os.Remove(path))
|
||||
}
|
||||
|
||||
func removeValidataion(un *unstructured.Unstructured, path string) {
|
||||
func removeValidation(un *unstructured.Unstructured, path string) {
|
||||
schemaPath := []string{"spec", "validation", "openAPIV3Schema"}
|
||||
for _, part := range strings.Split(path, ".") {
|
||||
schemaPath = append(schemaPath, "properties", part)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ MOD_ROOT=${GOPATH}/pkg/mod
|
|||
|
||||
. ${PROJECT_ROOT}/hack/versions.sh
|
||||
|
||||
# protbuf tooling required to build .proto files from go annotations from k8s-like api types
|
||||
# protobuf tooling required to build .proto files from go annotations from k8s-like api types
|
||||
go build -i -o dist/go-to-protobuf ./vendor/k8s.io/code-generator/cmd/go-to-protobuf
|
||||
go build -i -o dist/protoc-gen-gogo ./vendor/k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/sh
|
||||
# This script is used as the commaned supplied to GIT_ASKPASS as a way to supply username/password
|
||||
# This script is used as the command supplied to GIT_ASKPASS as a way to supply username/password
|
||||
# credentials to git, without having to use git credentials helpers, or having on-disk config.
|
||||
case "$1" in
|
||||
Username*) echo "${GIT_USERNAME}" ;;
|
||||
|
|
|
|||
|
|
@ -572,7 +572,7 @@ spec:
|
|||
type: boolean
|
||||
type: object
|
||||
syncOptions:
|
||||
description: Options allow youe to specify whole app sync-options
|
||||
description: Options allow you to specify whole app sync-options
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
|
|
|
|||
|
|
@ -573,7 +573,7 @@ spec:
|
|||
type: boolean
|
||||
type: object
|
||||
syncOptions:
|
||||
description: Options allow youe to specify whole app sync-options
|
||||
description: Options allow you to specify whole app sync-options
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
|
|
|
|||
|
|
@ -573,7 +573,7 @@ spec:
|
|||
type: boolean
|
||||
type: object
|
||||
syncOptions:
|
||||
description: Options allow youe to specify whole app sync-options
|
||||
description: Options allow you to specify whole app sync-options
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
|
|
|
|||
|
|
@ -573,7 +573,7 @@ spec:
|
|||
type: boolean
|
||||
type: object
|
||||
syncOptions:
|
||||
description: Options allow youe to specify whole app sync-options
|
||||
description: Options allow you to specify whole app sync-options
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
|
|
|
|||
|
|
@ -573,7 +573,7 @@ spec:
|
|||
type: boolean
|
||||
type: object
|
||||
syncOptions:
|
||||
description: Options allow youe to specify whole app sync-options
|
||||
description: Options allow you to specify whole app sync-options
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ func (m *RepoCredsDeleteRequest) GetUrl() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
// RepoCredsResponse is a resonse to most repository credentials requests
|
||||
// RepoCredsResponse is a response to most repository credentials requests
|
||||
type RepoCredsResponse struct {
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
|
|
|
|||
|
|
@ -913,7 +913,7 @@ message SyncPolicy {
|
|||
// Automated will keep an application synced to the target revision
|
||||
optional SyncPolicyAutomated automated = 1;
|
||||
|
||||
// Options allow youe to specify whole app sync-options
|
||||
// Options allow you to specify whole app sync-options
|
||||
repeated string syncOptions = 2;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3177,7 +3177,7 @@ func schema_pkg_apis_application_v1alpha1_SyncPolicy(ref common.ReferenceCallbac
|
|||
},
|
||||
"syncOptions": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Options allow youe to specify whole app sync-options",
|
||||
Description: "Options allow you to specify whole app sync-options",
|
||||
Type: []string{"array"},
|
||||
Items: &spec.SchemaOrArray{
|
||||
Schema: &spec.Schema{
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ func (e Env) Environ() []string {
|
|||
return environ
|
||||
}
|
||||
|
||||
// does an operation similar to `envstubst` tool,
|
||||
// does an operation similar to `envsubst` tool,
|
||||
// but unlike envsubst it does not change missing names into empty string
|
||||
// see https://linux.die.net/man/1/envsubst
|
||||
func (e Env) Envsubst(s string) string {
|
||||
|
|
@ -540,7 +540,7 @@ func (o SyncOptions) HasOption(option string) bool {
|
|||
type SyncPolicy struct {
|
||||
// Automated will keep an application synced to the target revision
|
||||
Automated *SyncPolicyAutomated `json:"automated,omitempty" protobuf:"bytes,1,opt,name=automated"`
|
||||
// Options allow youe to specify whole app sync-options
|
||||
// Options allow you to specify whole app sync-options
|
||||
SyncOptions SyncOptions `json:"syncOptions,omitempty" protobuf:"bytes,2,opt,name=syncOptions"`
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ const (
|
|||
MaxGRPCMessageSize = 100 * 1024 * 1024
|
||||
)
|
||||
|
||||
// Clientset represets repository server api clients
|
||||
// Clientset represents repository server api clients
|
||||
type Clientset interface {
|
||||
NewRepoServerClient() (io.Closer, RepoServerServiceClient, error)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -760,7 +760,7 @@ func (m *KustomizeAppSpec) GetImages() []string {
|
|||
type KsonnetEnvironment struct {
|
||||
// Name is the user defined name of an environment
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
// KubernetesVersion is the kubernetes version the targetted cluster is running on.
|
||||
// KubernetesVersion is the kubernetes version the targeted cluster is running on.
|
||||
K8SVersion string `protobuf:"bytes,2,opt,name=k8sVersion,proto3" json:"k8sVersion,omitempty"`
|
||||
// Destination stores the cluster address that this environment points to.
|
||||
Destination *KsonnetEnvironmentDestination `protobuf:"bytes,4,opt,name=destination,proto3" json:"destination,omitempty"`
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ message KustomizeAppSpec {
|
|||
message KsonnetEnvironment {
|
||||
// Name is the user defined name of an environment
|
||||
string name = 1;
|
||||
// KubernetesVersion is the kubernetes version the targetted cluster is running on.
|
||||
// KubernetesVersion is the kubernetes version the targeted cluster is running on.
|
||||
string k8sVersion = 2;
|
||||
// Destination stores the cluster address that this environment points to.
|
||||
KsonnetEnvironmentDestination destination = 4;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ end
|
|||
|
||||
if obj.status ~= nil and obj.status.certificateStatus == "Active" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "All ceritificates are active"
|
||||
hs.message = "All certificates are active"
|
||||
return hs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@ tests:
|
|||
inputPath: testdata/failed.yaml
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "All ceritificates are active"
|
||||
message: "All certificates are active"
|
||||
inputPath: testdata/active.yaml
|
||||
|
|
|
|||
|
|
@ -844,7 +844,7 @@ func (s *Server) PatchResource(ctx context.Context, q *application.ApplicationRe
|
|||
}, nil
|
||||
}
|
||||
|
||||
// DeleteResource deletes a specificed resource
|
||||
// DeleteResource deletes a specified resource
|
||||
func (s *Server) DeleteResource(ctx context.Context, q *application.ApplicationResourceDeleteRequest) (*application.ApplicationResponse, error) {
|
||||
resourceRequest := &application.ApplicationResourceRequest{
|
||||
Name: q.Name,
|
||||
|
|
|
|||
|
|
@ -459,14 +459,14 @@ p, role:admin, projects, update, *, allow`)
|
|||
t.Run("TestAddWildcardSource", func(t *testing.T) {
|
||||
|
||||
proj := existingProj.DeepCopy()
|
||||
wildSouceRepo := "*"
|
||||
proj.Spec.SourceRepos = append(proj.Spec.SourceRepos, wildSouceRepo)
|
||||
wildSourceRepo := "*"
|
||||
proj.Spec.SourceRepos = append(proj.Spec.SourceRepos, wildSourceRepo)
|
||||
|
||||
projectServer := NewServer("default", fake.NewSimpleClientset(), apps.NewSimpleClientset(proj), enforcer, util.NewKeyLock(), nil, policyEnf)
|
||||
request := &project.ProjectUpdateRequest{Project: proj}
|
||||
updatedProj, err := projectServer.Update(context.Background(), request)
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, wildSouceRepo, updatedProj.Spec.SourceRepos[1])
|
||||
assert.Equal(t, wildSourceRepo, updatedProj.Spec.SourceRepos[1])
|
||||
})
|
||||
|
||||
t.Run("TestCreateRolePolicySuccessfully", func(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ message RepoCredsDeleteRequest {
|
|||
string url = 1;
|
||||
}
|
||||
|
||||
// RepoCredsResponse is a resonse to most repository credentials requests
|
||||
// RepoCredsResponse is a response to most repository credentials requests
|
||||
message RepoCredsResponse {}
|
||||
|
||||
// RepoCreateRequest is a request for creating repository credentials config
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ func (redis *redisStateStorage) get(key string) (int, error) {
|
|||
}
|
||||
|
||||
// NewLoginRateLimiter creates a function which enforces max number of concurrent login requests.
|
||||
// Function returns closer that should be closed when loging request has completed or error if number
|
||||
// Function returns closer that should be closed when logging request has completed or error if number
|
||||
// of incomplete requests exceeded max number.
|
||||
func NewLoginRateLimiter(storage stateStorage, maxNumber int) func() (util.Closer, error) {
|
||||
runLocked := func(callback func() error) error {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ sonar.host.url=https://sonarcloud.io
|
|||
# Exclude following set of patterns from coverage analysis
|
||||
sonar.coverage.exclusions=**/*.pb.go,**/*.pb.gw.go,**/mocks/**,**/*.ts*,**/vendor/**,**/openapi_generated.go,**/*_test.go,**/*_generated*,test/**,pkg/client/**,pkg/apiclient/**
|
||||
|
||||
# Exlcude following set of patterns from code analysis
|
||||
# Exclude following set of patterns from code analysis
|
||||
sonar.go.exclusions=**/vendor/**,*/*.pb.go,**/*_test.go,**/*.pb.gw.go,**/mocks/**,**/openapi_generated.go,**/*_generated*.go
|
||||
|
||||
# Exclude following set of patterns from duplication detection
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ func TestKubeVersion(t *testing.T) {
|
|||
And(func(app *Application) {
|
||||
kubeVersion := FailOnErr(Run(".", "kubectl", "-n", DeploymentNamespace(), "get", "cm", "my-map",
|
||||
"-o", "jsonpath={.data.kubeVersion}")).(string)
|
||||
// Capabiliets.KubeVersion defaults to 1.9.0, we assume here you are running a later version
|
||||
// Capabilities.KubeVersion defaults to 1.9.0, we assume here you are running a later version
|
||||
assert.Equal(t, GetVersions().ServerVersion.Format("v%s.%s.0"), kubeVersion)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import (
|
|||
. "github.com/argoproj/argo-cd/test/e2e/fixture/app"
|
||||
)
|
||||
|
||||
// when you selectively sync, only seleceted resources should be synced, but the app will be out of sync
|
||||
// when you selectively sync, only selected resources should be synced, but the app will be out of sync
|
||||
func TestSelectiveSync(t *testing.T) {
|
||||
Given(t).
|
||||
Path("guestbook").
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ $logoNegativePath: 'assets/images/argo.png';
|
|||
padding: 20px 0 80px;
|
||||
}
|
||||
|
||||
&__box-outter {
|
||||
&__box-outer {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
overflow: hidden;
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ class PolicyWrapper extends React.Component<PolicyProps, any> {
|
|||
<input
|
||||
className='argo-field'
|
||||
list='permission'
|
||||
value={this.getPermision()}
|
||||
value={this.getPermission()}
|
||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
this.setPermission(e.target.value);
|
||||
}}
|
||||
|
|
@ -175,7 +175,7 @@ class PolicyWrapper extends React.Component<PolicyProps, any> {
|
|||
this.props.fieldApi.setValue(fields.join());
|
||||
}
|
||||
|
||||
private getPermision(): string {
|
||||
private getPermission(): string {
|
||||
const fields = (this.props.fieldApi.getValue() as string).split(',');
|
||||
if (fields.length !== 6) {
|
||||
return '';
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestRefreshApp(t *testing.T) {
|
|||
appIf := appClientset.ArgoprojV1alpha1().Applications("default")
|
||||
_, err := RefreshApp(appIf, "test-app", argoappv1.RefreshTypeNormal)
|
||||
assert.Nil(t, err)
|
||||
// For some reason, the fake Application inferface doesn't reflect the patch status after Patch(),
|
||||
// For some reason, the fake Application interface doesn't reflect the patch status after Patch(),
|
||||
// so can't verify it was set in unit tests.
|
||||
//_, ok := newApp.Annotations[common.AnnotationKeyRefresh]
|
||||
//assert.True(t, ok)
|
||||
|
|
@ -111,7 +111,7 @@ func TestContainsSyncResource(t *testing.T) {
|
|||
|
||||
for _, table := range tables {
|
||||
if out := ContainsSyncResource(table.u.GetName(), table.u.GroupVersionKind(), table.rr); out != table.expected {
|
||||
t.Errorf("Expected %t for slice %+v conains resource %+v; instead got %t", table.expected, table.rr, table.u, out)
|
||||
t.Errorf("Expected %t for slice %+v contains resource %+v; instead got %t", table.expected, table.rr, table.u, out)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -525,7 +525,7 @@ func TestValidatePermissions(t *testing.T) {
|
|||
},
|
||||
}
|
||||
db := &dbmocks.ArgoDB{}
|
||||
db.On("GetCluster", context.Background(), spec.Destination.Server).Return(nil, fmt.Errorf("Unknown error occured"))
|
||||
db.On("GetCluster", context.Background(), spec.Destination.Server).Return(nil, fmt.Errorf("Unknown error occurred"))
|
||||
_, err := ValidatePermissions(context.Background(), &spec, &proj, db)
|
||||
assert.Error(t, err)
|
||||
})
|
||||
|
|
|
|||
6
util/cache/redis_test.go
vendored
6
util/cache/redis_test.go
vendored
|
|
@ -17,13 +17,13 @@ func TestRedisSetCache(t *testing.T) {
|
|||
defer mr.Close()
|
||||
assert.NotNil(t, mr)
|
||||
|
||||
t.Run("Successfull set", func(t *testing.T) {
|
||||
t.Run("Successful set", func(t *testing.T) {
|
||||
client := NewRedisCache(redis.NewClient(&redis.Options{Addr: mr.Addr()}), 60*time.Second)
|
||||
err = client.Set(&Item{Key: "foo", Object: "bar"})
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
|
||||
t.Run("Successfull get", func(t *testing.T) {
|
||||
t.Run("Successful get", func(t *testing.T) {
|
||||
var res string
|
||||
client := NewRedisCache(redis.NewClient(&redis.Options{Addr: mr.Addr()}), 10*time.Second)
|
||||
err = client.Get("foo", &res)
|
||||
|
|
@ -31,7 +31,7 @@ func TestRedisSetCache(t *testing.T) {
|
|||
assert.Equal(t, res, "bar")
|
||||
})
|
||||
|
||||
t.Run("Successfull delete", func(t *testing.T) {
|
||||
t.Run("Successful delete", func(t *testing.T) {
|
||||
client := NewRedisCache(redis.NewClient(&redis.Options{Addr: mr.Addr()}), 10*time.Second)
|
||||
err = client.Delete("foo")
|
||||
assert.NoError(t, err)
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ func MatchHostName(hostname, pattern string) bool {
|
|||
return match
|
||||
}
|
||||
|
||||
// Convinience wrapper around SSHFingerprintSHA256
|
||||
// Convenience wrapper around SSHFingerprintSHA256
|
||||
func SSHFingerprintSHA256FromString(key string) string {
|
||||
pubKey, _, _, _, err := ssh.ParseAuthorizedKey([]byte(key))
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -455,7 +455,7 @@ func TestGetTLSCertificateDataPath(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func TestGetSSHKnownHostseDataPath(t *testing.T) {
|
||||
func TestGetSSHKnownHostsDataPath(t *testing.T) {
|
||||
t.Run("Get default path", func(t *testing.T) {
|
||||
os.Setenv(common.EnvVarSSHDataPath, "")
|
||||
p := GetSSHKnownHostsDataPath()
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ type ArgoDB interface {
|
|||
// DeleteRepoCredentials deletes a repository credential set from config
|
||||
DeleteRepositoryCredentials(ctx context.Context, name string) error
|
||||
|
||||
// ListRepoCerticifates lists all configured certificates
|
||||
// ListRepoCertificates lists all configured certificates
|
||||
ListRepoCertificates(ctx context.Context, selector *CertificateListSelector) (*appv1.RepositoryCertificateList, error)
|
||||
// CreateRepoCertificate creates a new certificate entry
|
||||
CreateRepoCertificate(ctx context.Context, certificate *appv1.RepositoryCertificateList, upsert bool) (*appv1.RepositoryCertificateList, error)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
resources:
|
||||
- ./deployment.yaml
|
||||
- ./statefullset.yaml
|
||||
- ./statefulset.yaml
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ const (
|
|||
// * is backed by a kubernetes config map
|
||||
// * has a predefined RBAC model
|
||||
// * supports a built-in policy
|
||||
// * supports a user-defined bolicy
|
||||
// * supports a user-defined policy
|
||||
// * supports a custom JWT claims enforce function
|
||||
type Enforcer struct {
|
||||
*casbin.Enforcer
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ func TestLoginRateLimiter(t *testing.T) {
|
|||
}
|
||||
|
||||
storage.attempts = map[string]LoginAttempts{}
|
||||
// Failed counter should have been reseted, should validate immediately
|
||||
// Failed counter should have been reset, should validate immediately
|
||||
{
|
||||
err := mgr.VerifyUsernamePassword("admin", "password")
|
||||
assert.NoError(t, err)
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ func TestSaveRepositories(t *testing.T) {
|
|||
assert.ElementsMatch(t, repos, []Repository{{URL: "http://foo"}})
|
||||
}
|
||||
|
||||
func TestSaveRepositoresNoConfigMap(t *testing.T) {
|
||||
func TestSaveRepositoriesNoConfigMap(t *testing.T) {
|
||||
kubeClient := fake.NewSimpleClientset()
|
||||
settingsManager := NewSettingsManager(context.Background(), kubeClient, "default")
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ func getTLSVersionByString(version string) (uint16, error) {
|
|||
return 0, fmt.Errorf("%s is not valid TLS version", version)
|
||||
}
|
||||
|
||||
// Parse colon seperated string representation of TLS cipher suites into array of values usable by crypto/tls
|
||||
// Parse colon separated string representation of TLS cipher suites into array of values usable by crypto/tls
|
||||
func getTLSCipherSuitesByString(cipherSuites string) ([]uint16, error) {
|
||||
suiteMap := make(map[string]uint16)
|
||||
for _, s := range tls.CipherSuites() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue