Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
c00fb83d29 chore(deps): bump docker/login-action from 4.0.0 to 4.1.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](b45d80f862...4907a6ddec)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 4.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-03 03:12:48 +00:00
13 changed files with 94 additions and 64 deletions

View File

@@ -113,7 +113,7 @@ jobs:
echo 'EOF' >> $GITHUB_ENV
- name: Login to Quay.io
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
registry: quay.io
username: ${{ secrets.quay_username }}
@@ -121,7 +121,7 @@ jobs:
if: ${{ inputs.quay_image_name && inputs.push }}
- name: Login to GitHub Container Registry
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
registry: ghcr.io
username: ${{ secrets.ghcr_username }}
@@ -129,7 +129,7 @@ jobs:
if: ${{ inputs.ghcr_image_name && inputs.push }}
- name: Login to dockerhub Container Registry
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
username: ${{ secrets.docker_username }}
password: ${{ secrets.docker_password }}

View File

@@ -662,7 +662,8 @@ func TestAutoSync(t *testing.T) {
func TestAutoSyncEnabledSetToTrue(t *testing.T) {
app := newFakeApp()
app.Spec.SyncPolicy.Automated = &v1alpha1.SyncPolicyAutomated{Enabled: new(true)}
enable := true
app.Spec.SyncPolicy.Automated = &v1alpha1.SyncPolicyAutomated{Enabled: &enable}
ctrl := newFakeController(t.Context(), &fakeData{apps: []runtime.Object{app}}, nil)
syncStatus := v1alpha1.SyncStatus{
Status: v1alpha1.SyncStatusCodeOutOfSync,
@@ -788,7 +789,8 @@ func TestSkipAutoSync(t *testing.T) {
// Verify we skip when auto-sync is disabled
t.Run("AutoSyncEnableFieldIsSetFalse", func(t *testing.T) {
app := newFakeApp()
app.Spec.SyncPolicy.Automated = &v1alpha1.SyncPolicyAutomated{Enabled: new(false)}
enable := false
app.Spec.SyncPolicy.Automated = &v1alpha1.SyncPolicyAutomated{Enabled: &enable}
ctrl := newFakeController(t.Context(), &fakeData{apps: []runtime.Object{app}}, nil)
syncStatus := v1alpha1.SyncStatus{
Status: v1alpha1.SyncStatusCodeOutOfSync,

View File

@@ -1,8 +1,7 @@
# Submitting PRs
## Prerequisites
1. [Development Environment](development-environment.md)
1. [Development Environment](development-environment.md)
2. [Toolchain Guide](toolchain-guide.md)
3. [Development Cycle](development-cycle.md)
@@ -22,10 +21,10 @@ If you need guidance with submitting a PR, or have any other questions regarding
## Before Submitting a PR
1. Rebase your branch against upstream master:
1. Rebase your branch against upstream main:
```shell
git fetch upstream
git rebase upstream/master
git rebase upstream/main
```
2. Run pre-commit checks:

8
go.mod
View File

@@ -34,7 +34,7 @@ require (
github.com/fsnotify/fsnotify v1.9.0
github.com/gfleury/go-bitbucket-v1 v0.0.0-20240917142304-df385efaac68
// DO NOT BUMP UNTIL go-git/go-git#1551 is fixed
github.com/go-git/go-git/v5 v5.17.1
github.com/go-git/go-git/v5 v5.14.0
github.com/go-jose/go-jose/v4 v4.1.4
github.com/go-logr/logr v1.4.3
github.com/go-openapi/loads v0.23.3
@@ -161,7 +161,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/sso v1.30.14 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.18 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.41.10
github.com/aws/smithy-go v1.24.3
github.com/aws/smithy-go v1.24.2
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
@@ -186,8 +186,8 @@ require (
github.com/go-errors/errors v1.5.1 // indirect
github.com/go-fed/httpsig v1.1.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.8.0 // indirect
github.com/go-jose/go-jose/v3 v3.0.5 // indirect
github.com/go-git/go-billy/v5 v5.6.2 // indirect
github.com/go-jose/go-jose/v3 v3.0.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.24.3 // indirect
github.com/go-openapi/errors v0.22.7 // indirect

13
go.sum
View File

@@ -156,8 +156,8 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.18 h1:mP49nTpfKtpXLt5SLn8Uv8z
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.18/go.mod h1:YO8TrYtFdl5w/4vmjL8zaBSsiNp3w0L1FfKVKenZT7w=
github.com/aws/aws-sdk-go-v2/service/sts v1.41.10 h1:p8ogvvLugcR/zLBXTXrTkj0RYBUdErbMnAFFp12Lm/U=
github.com/aws/aws-sdk-go-v2/service/sts v1.41.10/go.mod h1:60dv0eZJfeVXfbT1tFJinbHrDfSJ2GZl4Q//OSSNAVw=
github.com/aws/smithy-go v1.24.3 h1:XgOAaUgx+HhVBoP4v8n6HCQoTRDhoMghKqw4LNHsDNg=
github.com/aws/smithy-go v1.24.3/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
github.com/aws/smithy-go v1.24.2 h1:FzA3bu/nt/vDvmnkg+R8Xl46gmzEDam6mZ1hzmwXFng=
github.com/aws/smithy-go v1.24.2/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
@@ -304,19 +304,15 @@ github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66D
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UNbRM=
github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU=
github.com/go-git/go-billy/v5 v5.8.0 h1:I8hjc3LbBlXTtVuFNJuwYuMiHvQJDq1AT6u4DwDzZG0=
github.com/go-git/go-billy/v5 v5.8.0/go.mod h1:RpvI/rw4Vr5QA+Z60c6d6LXH0rYJo0uD5SqfmrrheCY=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII=
github.com/go-git/go-git/v5 v5.14.0 h1:/MD3lCrGjCen5WfEAzKg00MJJffKhC8gzS80ycmCi60=
github.com/go-git/go-git/v5 v5.14.0/go.mod h1:Z5Xhoia5PcWA3NF8vRLURn9E5FRhSl7dGj9ItW3Wk5k=
github.com/go-git/go-git/v5 v5.17.1 h1:WnljyxIzSj9BRRUlnmAU35ohDsjRK0EKmL0evDqi5Jk=
github.com/go-git/go-git/v5 v5.17.1/go.mod h1:pW/VmeqkanRFqR6AljLcs7EA7FbZaN5MQqO7oZADXpo=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-jose/go-jose/v3 v3.0.5 h1:BLLJWbC4nMZOfuPVxoZIxeYsn6Nl2r1fITaJ78UQlVQ=
github.com/go-jose/go-jose/v3 v3.0.5/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ=
github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA=
github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8=
github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA=
github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
@@ -1008,6 +1004,7 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/crypto v0.0.0-20190422183909-d864b10871cd/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=

View File

@@ -24,7 +24,8 @@ func TestNSAutoSyncSelfHealDisabled(t *testing.T) {
When().
// app should be auto-synced once created
CreateFromFile(func(app *Application) {
app.Spec.SyncPolicy = &SyncPolicy{Automated: &SyncPolicyAutomated{SelfHeal: new(false)}}
selfHeal := false
app.Spec.SyncPolicy = &SyncPolicy{Automated: &SyncPolicyAutomated{SelfHeal: &selfHeal}}
}).
Then().
Expect(SyncStatusIs(SyncStatusCodeSynced)).
@@ -52,8 +53,9 @@ func TestNSAutoSyncSelfHealEnabled(t *testing.T) {
When().
// app should be auto-synced once created
CreateFromFile(func(app *Application) {
selfHeal := true
app.Spec.SyncPolicy = &SyncPolicy{
Automated: &SyncPolicyAutomated{SelfHeal: new(true)},
Automated: &SyncPolicyAutomated{SelfHeal: &selfHeal},
Retry: &RetryStrategy{Limit: 0},
}
}).

View File

@@ -23,7 +23,8 @@ func TestAutoSyncSelfHealDisabled(t *testing.T) {
When().
// app should be auto-synced once created
CreateFromFile(func(app *Application) {
app.Spec.SyncPolicy = &SyncPolicy{Automated: &SyncPolicyAutomated{SelfHeal: new(false)}}
selfHeal := false
app.Spec.SyncPolicy = &SyncPolicy{Automated: &SyncPolicyAutomated{SelfHeal: &selfHeal}}
}).
Then().
Expect(SyncStatusIs(SyncStatusCodeSynced)).
@@ -50,8 +51,9 @@ func TestAutoSyncSelfHealEnabled(t *testing.T) {
When().
// app should be auto-synced once created
CreateFromFile(func(app *Application) {
selfHeal := true
app.Spec.SyncPolicy = &SyncPolicy{
Automated: &SyncPolicyAutomated{SelfHeal: new(true)},
Automated: &SyncPolicyAutomated{SelfHeal: &selfHeal},
Retry: &RetryStrategy{Limit: 0},
}
}).
@@ -192,8 +194,9 @@ func TestAutoSyncAllowEmptyCanBeDisabled(t *testing.T) {
Path(guestbookPath).
When().
CreateFromFile(func(app *Application) {
allowEmpty := true
app.Spec.SyncPolicy = &SyncPolicy{
Automated: &SyncPolicyAutomated{AllowEmpty: new(true)},
Automated: &SyncPolicyAutomated{AllowEmpty: &allowEmpty},
}
}).
Then().

View File

@@ -615,6 +615,26 @@ func TestTemplatePatch(t *testing.T) {
},
}
templatePatch := `{
"metadata": {
"annotations": {
{{- range $k, $v := .annotations }}
"{{ $k }}": "{{ $v }}"
{{- end }}
}
},
{{- if .createNamespace }}
"spec": {
"syncPolicy": {
"syncOptions": [
"CreateNamespace=true"
]
}
}
{{- end }}
}
`
var expectedAppNewNamespace *v1alpha1.Application
var expectedAppNewMetadata *v1alpha1.Application
@@ -638,25 +658,7 @@ func TestTemplatePatch(t *testing.T) {
},
},
},
TemplatePatch: new(`{
"metadata": {
"annotations": {
{{- range $k, $v := .annotations }}
"{{ $k }}": "{{ $v }}"
{{- end }}
}
},
{{- if .createNamespace }}
"spec": {
"syncPolicy": {
"syncOptions": [
"CreateNamespace=true"
]
}
}
{{- end }}
}
`),
TemplatePatch: &templatePatch,
Generators: []v1alpha1.ApplicationSetGenerator{
{
List: &v1alpha1.ListGenerator{
@@ -876,8 +878,9 @@ func TestSyncPolicyCreateUpdate(t *testing.T) {
appset.Spec.Template.Labels = map[string]string{
"label-key": "label-value",
}
applicationsSyncPolicy := v1alpha1.ApplicationsSyncPolicyCreateUpdate
appset.Spec.SyncPolicy = &v1alpha1.ApplicationSetSyncPolicy{
ApplicationsSync: new(v1alpha1.ApplicationsSyncPolicyCreateUpdate),
ApplicationsSync: &applicationsSyncPolicy,
}
}).Then().Expect(ApplicationsExist([]v1alpha1.Application{*expectedAppNewMetadata})).
@@ -973,8 +976,9 @@ func TestSyncPolicyCreateDelete(t *testing.T) {
Update(func(appset *v1alpha1.ApplicationSet) {
appset.Spec.Template.Annotations = map[string]string{"annotation-key": "annotation-value"}
appset.Spec.Template.Labels = map[string]string{"label-key": "label-value"}
applicationsSyncPolicy := v1alpha1.ApplicationsSyncPolicyCreateDelete
appset.Spec.SyncPolicy = &v1alpha1.ApplicationSetSyncPolicy{
ApplicationsSync: new(v1alpha1.ApplicationsSyncPolicyCreateDelete),
ApplicationsSync: &applicationsSyncPolicy,
}
}).Then().Expect(ApplicationsExist([]v1alpha1.Application{*expectedAppNewNamespace})).
@@ -1071,8 +1075,9 @@ func TestSyncPolicyCreateOnly(t *testing.T) {
Update(func(appset *v1alpha1.ApplicationSet) {
appset.Spec.Template.Annotations = map[string]string{"annotation-key": "annotation-value"}
appset.Spec.Template.Labels = map[string]string{"label-key": "label-value"}
applicationsSyncPolicy := v1alpha1.ApplicationsSyncPolicyCreateOnly
appset.Spec.SyncPolicy = &v1alpha1.ApplicationSetSyncPolicy{
ApplicationsSync: new(v1alpha1.ApplicationsSyncPolicyCreateOnly),
ApplicationsSync: &applicationsSyncPolicy,
}
}).Then().Expect(ApplicationsExist([]v1alpha1.Application{*expectedAppNewNamespace})).
@@ -1329,6 +1334,9 @@ func TestSimpleSCMProviderGenerator(t *testing.T) {
},
}
// Because you can't &"".
repoMatch := "argo-cd"
Given(t).
// Create an SCMProviderGenerator-based ApplicationSet
When().Create(v1alpha1.ApplicationSet{
@@ -1357,7 +1365,7 @@ func TestSimpleSCMProviderGenerator(t *testing.T) {
},
Filters: []v1alpha1.SCMProviderGeneratorFilter{
{
RepositoryMatch: new("argo-cd"),
RepositoryMatch: &repoMatch,
},
},
},
@@ -1398,6 +1406,9 @@ func TestSimpleSCMProviderGeneratorGoTemplate(t *testing.T) {
},
}
// Because you can't &"".
repoMatch := "argo-cd"
Given(t).
// Create an SCMProviderGenerator-based ApplicationSet
When().Create(v1alpha1.ApplicationSet{
@@ -1427,7 +1438,7 @@ func TestSimpleSCMProviderGeneratorGoTemplate(t *testing.T) {
},
Filters: []v1alpha1.SCMProviderGeneratorFilter{
{
RepositoryMatch: new("argo-cd"),
RepositoryMatch: &repoMatch,
},
},
},
@@ -1462,6 +1473,9 @@ func TestSCMProviderGeneratorSCMProviderNotAllowed(t *testing.T) {
},
}
// Because you can't &"".
repoMatch := "argo-cd"
ctx := Given(t)
// Create an SCMProviderGenerator-based ApplicationSet
ctx.When().Create(v1alpha1.ApplicationSet{
@@ -1491,7 +1505,7 @@ func TestSCMProviderGeneratorSCMProviderNotAllowed(t *testing.T) {
},
Filters: []v1alpha1.SCMProviderGeneratorFilter{
{
RepositoryMatch: new("argo-cd"),
RepositoryMatch: &repoMatch,
},
},
},
@@ -1707,6 +1721,9 @@ func TestSimpleSCMProviderGeneratorTokenRefStrictOk(t *testing.T) {
},
}
// Because you can't &"".
repoMatch := "argo-cd"
Given(t).
And(func() {
_, err := utils.GetE2EFixtureK8sClient(t).KubeClientset.CoreV1().Secrets(fixture.TestNamespace()).Create(t.Context(), &corev1.Secret{
@@ -1755,7 +1772,7 @@ func TestSimpleSCMProviderGeneratorTokenRefStrictOk(t *testing.T) {
},
Filters: []v1alpha1.SCMProviderGeneratorFilter{
{
RepositoryMatch: new("argo-cd"),
RepositoryMatch: &repoMatch,
},
},
},
@@ -1806,6 +1823,9 @@ func TestSimpleSCMProviderGeneratorTokenRefStrictKo(t *testing.T) {
},
}
// Because you can't &"".
repoMatch := "argo-cd"
ctx := Given(t)
ctx.And(func() {
_, err := utils.GetE2EFixtureK8sClient(t).KubeClientset.CoreV1().Secrets(fixture.TestNamespace()).Create(t.Context(), &corev1.Secret{
@@ -1855,7 +1875,7 @@ func TestSimpleSCMProviderGeneratorTokenRefStrictKo(t *testing.T) {
},
Filters: []v1alpha1.SCMProviderGeneratorFilter{
{
RepositoryMatch: new("argo-cd"),
RepositoryMatch: &repoMatch,
},
},
},

View File

@@ -14,6 +14,8 @@ import (
"github.com/argoproj/argo-cd/v3/pkg/apis/application"
)
var tenSec = int64(10)
func TestSimpleClusterDecisionResourceGeneratorExternalNamespace(t *testing.T) {
externalNamespace := string(utils.ArgoCDExternalNamespace)
@@ -294,7 +296,7 @@ func TestSimpleClusterDecisionResourceGeneratorAddingCluster(t *testing.T) {
ClusterDecisionResource: &v1alpha1.DuckTypeGenerator{
ConfigMapRef: "my-configmap",
Name: "my-placementdecision",
RequeueAfterSeconds: new(int64(10)),
RequeueAfterSeconds: &tenSec,
},
},
},
@@ -387,7 +389,7 @@ func TestSimpleClusterDecisionResourceGeneratorDeletingClusterSecret(t *testing.
ClusterDecisionResource: &v1alpha1.DuckTypeGenerator{
ConfigMapRef: "my-configmap",
Name: "my-placementdecision",
RequeueAfterSeconds: new(int64(10)),
RequeueAfterSeconds: &tenSec,
},
},
},
@@ -488,7 +490,7 @@ func TestSimpleClusterDecisionResourceGeneratorDeletingClusterFromResource(t *te
ClusterDecisionResource: &v1alpha1.DuckTypeGenerator{
ConfigMapRef: "my-configmap",
Name: "my-placementdecision",
RequeueAfterSeconds: new(int64(10)),
RequeueAfterSeconds: &tenSec,
},
},
},

View File

@@ -199,7 +199,7 @@ func (a *Actions) CreateMultiSourceAppFromFile(flags ...string) *Actions {
},
SyncPolicy: &v1alpha1.SyncPolicy{
Automated: &v1alpha1.SyncPolicyAutomated{
SelfHeal: new(true),
SelfHeal: func() *bool { b := true; return &b }(),
},
},
},

View File

@@ -129,7 +129,8 @@ func TestAnnotatedTagInStatusSyncRevision(t *testing.T) {
// Create Application targeting annotated-tag, with automatedSync: true
CreateFromFile(func(app *Application) {
app.Spec.Source.TargetRevision = "annotated-tag"
app.Spec.SyncPolicy = &SyncPolicy{Automated: &SyncPolicyAutomated{Prune: new(true), SelfHeal: new(false)}}
prune, selfHeal := true, false
app.Spec.SyncPolicy = &SyncPolicy{Automated: &SyncPolicyAutomated{Prune: &prune, SelfHeal: &selfHeal}}
}).
Then().
Expect(SyncStatusIs(SyncStatusCodeSynced)).
@@ -164,7 +165,8 @@ func TestAutomatedSelfHealingAgainstAnnotatedTag(t *testing.T) {
// App should be auto-synced once created
CreateFromFile(func(app *Application) {
app.Spec.Source.TargetRevision = "annotated-tag"
app.Spec.SyncPolicy = &SyncPolicy{Automated: &SyncPolicyAutomated{Prune: new(true), SelfHeal: new(false)}}
prune, selfHeal := true, false
app.Spec.SyncPolicy = &SyncPolicy{Automated: &SyncPolicyAutomated{Prune: &prune, SelfHeal: &selfHeal}}
}).
Then().
ExpectConsistently(SyncStatusIs(SyncStatusCodeSynced), WaitDuration, time.Second*10).
@@ -216,7 +218,8 @@ func TestAutomatedSelfHealingAgainstLightweightTag(t *testing.T) {
// App should be auto-synced once created
CreateFromFile(func(app *Application) {
app.Spec.Source.TargetRevision = "annotated-tag"
app.Spec.SyncPolicy = &SyncPolicy{Automated: &SyncPolicyAutomated{Prune: new(true), SelfHeal: new(false)}}
prune, selfHeal := true, false
app.Spec.SyncPolicy = &SyncPolicy{Automated: &SyncPolicyAutomated{Prune: &prune, SelfHeal: &selfHeal}}
}).
Then().
ExpectConsistently(SyncStatusIs(SyncStatusCodeSynced), WaitDuration, time.Second*10).

View File

@@ -131,7 +131,8 @@ func TestSyncWithStatusIgnored(t *testing.T) {
}))
}).
CreateFromFile(func(app *Application) {
app.Spec.SyncPolicy = &SyncPolicy{Automated: &SyncPolicyAutomated{SelfHeal: new(true)}}
selfHeal := true
app.Spec.SyncPolicy = &SyncPolicy{Automated: &SyncPolicyAutomated{SelfHeal: &selfHeal}}
}).
Then().
Expect(SyncStatusIs(SyncStatusCodeSynced)).
@@ -180,7 +181,8 @@ func TestSyncWithSkipHook(t *testing.T) {
Path(guestbookPath).
When().
CreateFromFile(func(app *Application) {
app.Spec.SyncPolicy = &SyncPolicy{Automated: &SyncPolicyAutomated{SelfHeal: new(true)}}
selfHeal := true
app.Spec.SyncPolicy = &SyncPolicy{Automated: &SyncPolicyAutomated{SelfHeal: &selfHeal}}
}).
Then().
Expect(SyncStatusIs(SyncStatusCodeSynced)).

View File

@@ -1009,8 +1009,8 @@ func TestExecuteResourceActionWithParams(t *testing.T) {
params := []*applicationpkg.ResourceActionParameters{
{
Name: new("replicas"),
Value: new("3"),
Name: func() *string { s := "replicas"; return &s }(),
Value: func() *string { s := "3"; return &s }(),
},
}