Skip to content

Commit

Permalink
Merge branch 'argoproj:master' into add-warning-duplicated-secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
doxsch authored Jan 4, 2024
2 parents 17cec19 + d595550 commit feffa8a
Show file tree
Hide file tree
Showing 24 changed files with 861 additions and 702 deletions.
1 change: 1 addition & 0 deletions USERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [IBM](https://www.ibm.com/)
1. [Ibotta](https://home.ibotta.com)
1. [IITS-Consulting](https://iits-consulting.de)
1. [IllumiDesk](https://www.illumidesk.com)
1. [imaware](https://imaware.health)
1. [Indeed](https://indeed.com)
1. [Index Exchange](https://www.indexexchange.com/)
Expand Down
3 changes: 3 additions & 0 deletions assets/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -8499,6 +8499,9 @@
"format": "int64",
"title": "ID is an auto incrementing identifier of the RevisionHistory"
},
"initiatedBy": {
"$ref": "#/definitions/v1alpha1OperationInitiator"
},
"revision": {
"type": "string",
"title": "Revision holds the revision the sync was performed against"
Expand Down
13 changes: 12 additions & 1 deletion controller/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,16 @@ func useDiffCache(noCache bool, manifestInfos []*apiclient.ManifestResponse, sou
return true
}

func (m *appStateManager) persistRevisionHistory(app *v1alpha1.Application, revision string, source v1alpha1.ApplicationSource, revisions []string, sources []v1alpha1.ApplicationSource, hasMultipleSources bool, startedAt metav1.Time) error {
func (m *appStateManager) persistRevisionHistory(
app *v1alpha1.Application,
revision string,
source v1alpha1.ApplicationSource,
revisions []string,
sources []v1alpha1.ApplicationSource,
hasMultipleSources bool,
startedAt metav1.Time,
initiatedBy v1alpha1.OperationInitiator,
) error {
var nextID int64
if len(app.Status.History) > 0 {
nextID = app.Status.History.LastRevisionHistory().ID + 1
Expand All @@ -893,6 +902,7 @@ func (m *appStateManager) persistRevisionHistory(app *v1alpha1.Application, revi
ID: nextID,
Sources: sources,
Revisions: revisions,
InitiatedBy: initiatedBy,
})
} else {
app.Status.History = append(app.Status.History, v1alpha1.RevisionHistory{
Expand All @@ -901,6 +911,7 @@ func (m *appStateManager) persistRevisionHistory(app *v1alpha1.Application, revi
DeployStartedAt: &startedAt,
ID: nextID,
Source: source,
InitiatedBy: initiatedBy,
})
}

Expand Down
5 changes: 3 additions & 2 deletions controller/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"

"github.com/argoproj/argo-cd/v2/common"
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
argoappv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/argoproj/argo-cd/v2/reposerver/apiclient"
"github.com/argoproj/argo-cd/v2/test"
Expand Down Expand Up @@ -838,7 +839,7 @@ func Test_appStateManager_persistRevisionHistory(t *testing.T) {
app.Spec.RevisionHistoryLimit = &i
}
addHistory := func() {
err := manager.persistRevisionHistory(app, "my-revision", argoappv1.ApplicationSource{}, []string{}, []argoappv1.ApplicationSource{}, false, metav1.Time{})
err := manager.persistRevisionHistory(app, "my-revision", argoappv1.ApplicationSource{}, []string{}, []argoappv1.ApplicationSource{}, false, metav1.Time{}, v1alpha1.OperationInitiator{})
assert.NoError(t, err)
}
addHistory()
Expand Down Expand Up @@ -874,7 +875,7 @@ func Test_appStateManager_persistRevisionHistory(t *testing.T) {
assert.Len(t, app.Status.History, 9)

metav1NowTime := metav1.NewTime(time.Now())
err := manager.persistRevisionHistory(app, "my-revision", argoappv1.ApplicationSource{}, []string{}, []argoappv1.ApplicationSource{}, false, metav1NowTime)
err := manager.persistRevisionHistory(app, "my-revision", argoappv1.ApplicationSource{}, []string{}, []argoappv1.ApplicationSource{}, false, metav1NowTime, v1alpha1.OperationInitiator{})
assert.NoError(t, err)
assert.Equal(t, app.Status.History.LastRevisionHistory().DeployStartedAt, &metav1NowTime)
}
Expand Down
2 changes: 1 addition & 1 deletion controller/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ func (m *appStateManager) SyncAppState(app *v1alpha1.Application, state *v1alpha
logEntry.WithField("duration", time.Since(start)).Info("sync/terminate complete")

if !syncOp.DryRun && len(syncOp.Resources) == 0 && state.Phase.Successful() {
err := m.persistRevisionHistory(app, compareResult.syncStatus.Revision, source, compareResult.syncStatus.Revisions, compareResult.syncStatus.ComparedTo.Sources, app.Spec.HasMultipleSources(), state.StartedAt)
err := m.persistRevisionHistory(app, compareResult.syncStatus.Revision, source, compareResult.syncStatus.Revisions, compareResult.syncStatus.ComparedTo.Sources, app.Spec.HasMultipleSources(), state.StartedAt, state.Operation.InitiatedBy)
if err != nil {
state.Phase = common.OperationError
state.Message = fmt.Sprintf("failed to record sync to history: %v", err)
Expand Down
17 changes: 16 additions & 1 deletion docs/developer-guide/contributors-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and the [toolchain guide](toolchain-guide.md).

### Install Go

<https://go.dev/doc/install/>

Install version 1.18 or newer (Verify version by running `go version`)

### Clone the Argo CD repo
Expand All @@ -23,16 +25,29 @@ git clone https://github.com/argoproj/argo-cd.git

<https://docs.docker.com/engine/install/>

### Install or Upgrade `kind` (Optional - Should work with any local cluster)
### Install or Upgrade a Tool for Running Local Clusters (e.g. kind or minikube)

#### Installation guide for kind:

<https://kind.sigs.k8s.io/docs/user/quick-start/>

#### Installation guide for minikube:

<https://minikube.sigs.k8s.io/docs/start/>

### Start Your Local Cluster

For example, if you are using kind:
```shell
kind create cluster
```

Or, if you are using minikube:

```shell
minikube start
```

### Install Argo CD

```shell
Expand Down
8 changes: 2 additions & 6 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@ This will create a new namespace, `argocd`, where Argo CD services and applicati
The installation manifests include `ClusterRoleBinding` resources that reference `argocd` namespace. If you are installing Argo CD into a different
namespace then make sure to update the namespace reference.

If you are not interested in UI, SSO, multi-cluster features then you can install [core](operator-manual/installation.md#core) Argo CD components only:

```bash
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/core-install.yaml
```
!!! tip
If you are not interested in UI, SSO, and multi-cluster features, then you can install only the [core](operator-manual/core/#installing) Argo CD components.

This default installation will have a self-signed certificate and cannot be accessed without a bit of extra work.
Do one of:
Expand Down
2 changes: 1 addition & 1 deletion docs/operator-manual/notifications/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ metadata:
name: argocd-cmd-params-cm
data:
application.namespaces: app-team-one, app-team-two
notificationscontroller.selfservice.enabled: true
notificationscontroller.selfservice.enabled: "true"
```
To use this feature, you can deploy configmap named `argocd-notifications-cm` and possibly a secret `argocd-notifications-secret` in the namespace where the Argo CD application lives.
Expand Down
2 changes: 1 addition & 1 deletion docs/operator-manual/notifications/triggers.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The trigger defines the condition when the notification should be sent. The definition includes name, condition
and notification templates reference. The condition is a predicate expression that returns true if the notification
should be sent. The trigger condition evaluation is powered by [antonmedv/expr](https://github.com/antonmedv/expr).
The condition language syntax is described at [Language-Definition.md](https://github.com/antonmedv/expr/blob/master/docs/Language-Definition.md).
The condition language syntax is described at [language-definition.md](https://github.com/antonmedv/expr/blob/master/docs/language-definition.md).

The trigger is configured in the `argocd-notifications-cm` ConfigMap. For example the following trigger sends a notification
when application sync status changes to `Unknown` using the `app-sync-status` template:
Expand Down
5 changes: 5 additions & 0 deletions docs/operator-manual/upgrading/2.10-2.11.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# v2.10 to 2.11

## initiatedBy added in Application CRD

In order to address [argoproj/argo-cd#16612](https://github.com/argoproj/argo-cd/issues/16612), initiatedBy has been added in the Application CRD.
1 change: 1 addition & 0 deletions docs/user-guide/resource_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ metadata:
argocd.argoproj.io/hook: PostSync
argocd.argoproj.io/hook-delete-policy: HookSucceeded
```
Multiple hook delete policies can be specified as a comma separated list.

The following policies define when the hook will be deleted.

Expand Down
13 changes: 13 additions & 0 deletions manifests/core-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1726,6 +1726,19 @@ spec:
description: ID is an auto incrementing identifier of the RevisionHistory
format: int64
type: integer
initiatedBy:
description: InitiatedBy contains information about who initiated
the operations
properties:
automated:
description: Automated is set to true if operation was initiated
automatically by the application controller.
type: boolean
username:
description: Username contains the name of a user who started
operation
type: string
type: object
revision:
description: Revision holds the revision the sync was performed
against
Expand Down
13 changes: 13 additions & 0 deletions manifests/crds/application-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,19 @@ spec:
description: ID is an auto incrementing identifier of the RevisionHistory
format: int64
type: integer
initiatedBy:
description: InitiatedBy contains information about who initiated
the operations
properties:
automated:
description: Automated is set to true if operation was initiated
automatically by the application controller.
type: boolean
username:
description: Username contains the name of a user who started
operation
type: string
type: object
revision:
description: Revision holds the revision the sync was performed
against
Expand Down
13 changes: 13 additions & 0 deletions manifests/ha/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1726,6 +1726,19 @@ spec:
description: ID is an auto incrementing identifier of the RevisionHistory
format: int64
type: integer
initiatedBy:
description: InitiatedBy contains information about who initiated
the operations
properties:
automated:
description: Automated is set to true if operation was initiated
automatically by the application controller.
type: boolean
username:
description: Username contains the name of a user who started
operation
type: string
type: object
revision:
description: Revision holds the revision the sync was performed
against
Expand Down
13 changes: 13 additions & 0 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1726,6 +1726,19 @@ spec:
description: ID is an auto incrementing identifier of the RevisionHistory
format: int64
type: integer
initiatedBy:
description: InitiatedBy contains information about who initiated
the operations
properties:
automated:
description: Automated is set to true if operation was initiated
automatically by the application controller.
type: boolean
username:
description: Username contains the name of a user who started
operation
type: string
type: object
revision:
description: Revision holds the revision the sync was performed
against
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ nav:
- operator-manual/server-commands/additional-configuration-method.md
- Upgrading:
- operator-manual/upgrading/overview.md
- operator-manual/upgrading/2.10-2.11.md
- operator-manual/upgrading/2.9-2.10.md
- operator-manual/upgrading/2.8-2.9.md
- operator-manual/upgrading/2.7-2.8.md
Expand Down
Loading

0 comments on commit feffa8a

Please sign in to comment.