mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-21 18:18:48 +01:00
Compare commits
20 Commits
hydrator-c
...
v2.1.0-rc2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b067879892 | ||
|
|
ab2bbc2201 | ||
|
|
a93649419b | ||
|
|
15c361e525 | ||
|
|
a5ba98ff61 | ||
|
|
18ddf1f839 | ||
|
|
4e8b9b85b8 | ||
|
|
34b3139309 | ||
|
|
4410803b11 | ||
|
|
83b272e125 | ||
|
|
4f967eaa5a | ||
|
|
13cdf01506 | ||
|
|
d84822ea88 | ||
|
|
a524a3b4d9 | ||
|
|
9419c11c1d | ||
|
|
12a4475176 | ||
|
|
662567b8fd | ||
|
|
6b14f909e9 | ||
|
|
a92c24094e | ||
|
|
307de9555d |
@@ -1821,16 +1821,20 @@ func NewApplicationRollbackCommand(clientOpts *argocdclient.ClientOptions) *cobr
|
||||
timeout uint
|
||||
)
|
||||
var command = &cobra.Command{
|
||||
Use: "rollback APPNAME ID",
|
||||
Short: "Rollback application to a previous deployed version by History ID",
|
||||
Use: "rollback APPNAME [ID]",
|
||||
Short: "Rollback application to a previous deployed version by History ID, omitted will Rollback to the previous version",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
if len(args) != 2 {
|
||||
if len(args) == 0 {
|
||||
c.HelpFunc()(c, args)
|
||||
os.Exit(1)
|
||||
}
|
||||
appName := args[0]
|
||||
depID, err := strconv.Atoi(args[1])
|
||||
errors.CheckError(err)
|
||||
var err error
|
||||
depID := -1
|
||||
if len(args) > 1 {
|
||||
depID, err = strconv.Atoi(args[1])
|
||||
errors.CheckError(err)
|
||||
}
|
||||
acdClient := argocdclient.NewClientOrDie(clientOpts)
|
||||
conn, appIf := acdClient.NewApplicationClientOrDie()
|
||||
defer argoio.Close(conn)
|
||||
@@ -1838,19 +1842,27 @@ func NewApplicationRollbackCommand(clientOpts *argocdclient.ClientOptions) *cobr
|
||||
app, err := appIf.Get(ctx, &applicationpkg.ApplicationQuery{Name: &appName})
|
||||
errors.CheckError(err)
|
||||
var depInfo *argoappv1.RevisionHistory
|
||||
for _, di := range app.Status.History {
|
||||
if di.ID == int64(depID) {
|
||||
depInfo = &di
|
||||
break
|
||||
if depID == -1 {
|
||||
l := len(app.Status.History)
|
||||
if l < 2 {
|
||||
log.Fatalf("Application '%s' should have at least two successful deployments", app.ObjectMeta.Name)
|
||||
}
|
||||
depInfo = &app.Status.History[l-2]
|
||||
} else {
|
||||
for _, di := range app.Status.History {
|
||||
if di.ID == int64(depID) {
|
||||
depInfo = &di
|
||||
break
|
||||
}
|
||||
}
|
||||
if depInfo == nil {
|
||||
log.Fatalf("Application '%s' does not have deployment id '%d' in history\n", app.ObjectMeta.Name, depID)
|
||||
}
|
||||
}
|
||||
if depInfo == nil {
|
||||
log.Fatalf("Application '%s' does not have deployment id '%d' in history\n", app.ObjectMeta.Name, depID)
|
||||
}
|
||||
|
||||
_, err = appIf.Rollback(ctx, &applicationpkg.ApplicationRollbackRequest{
|
||||
Name: &appName,
|
||||
ID: int64(depID),
|
||||
ID: depInfo.ID,
|
||||
Prune: prune,
|
||||
})
|
||||
errors.CheckError(err)
|
||||
|
||||
@@ -60,6 +60,9 @@ func NewRepoCredsAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Comma
|
||||
|
||||
# Add credentials with GitHub App authentication to use for all repositories under https://ghe.example.com/repos
|
||||
argocd repocreds add https://ghe.example.com/repos/ --github-app-id 1 --github-app-installation-id 2 --github-app-private-key-path test.private-key.pem --github-app-enterprise-base-url https://ghe.example.com/api/v3
|
||||
|
||||
# Add credentials with helm oci registry so that these oci registry urls do not need to be added as repos individually.
|
||||
argocd repocreds add localhost:5000/myrepo --enable-oci --type helm
|
||||
`
|
||||
|
||||
var command = &cobra.Command{
|
||||
|
||||
@@ -28,7 +28,7 @@ kubectl create namespace argocd
|
||||
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/core-install.yaml
|
||||
```
|
||||
|
||||
Use `argocd login --k8s-api` to [configure](./user-guide/commands/argocd_login.md) CLI access and skip steps 3-5.
|
||||
Use `argocd login --core` to [configure](./user-guide/commands/argocd_login.md) CLI access and skip steps 3-5.
|
||||
|
||||
## 2. Download Argo CD CLI
|
||||
|
||||
|
||||
@@ -69,5 +69,5 @@ RUN apt-get update && \
|
||||
chmod +x /usr/local/bin/sops
|
||||
|
||||
# Switch back to non-root user
|
||||
USER argocd
|
||||
USER 999
|
||||
```
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# Installation
|
||||
|
||||
Argo CD has two type of installations: multi-tennant and core.
|
||||
Argo CD has two type of installations: multi-tenant and core.
|
||||
|
||||
## Multi-Tenant
|
||||
|
||||
The multi-tenant installation is the most common way to install Argo CD. This type of installation is typically used to service multiple application developer teams
|
||||
in the organization and maintained by a platform team.
|
||||
|
||||
The end-users can access Argo CD via API server using Web UI or `argocd` CLI. The `argocd` has to be configured using `argocd login <server-host>` command
|
||||
The end-users can access Argo CD via the API server using the Web UI or `argocd` CLI. The `argocd` CLI has to be configured using `argocd login <server-host>` command
|
||||
(learn more [here](../user-guide/commands/argocd_login.md)).
|
||||
|
||||
Two types of installation manifests are provided:
|
||||
@@ -18,7 +18,7 @@ Not recommended for production use. This type of installation is typically used
|
||||
|
||||
* [install.yaml](https://github.com/argoproj/argo-cd/blob/master/manifests/install.yaml) - Standard Argo CD installation with cluster-admin access. Use this
|
||||
manifest set if you plan to use Argo CD to deploy applications in the same cluster that Argo CD runs
|
||||
in (i.e. kubernetes.svc.default). Will still be able to deploy to external clusters with inputted
|
||||
in (i.e. kubernetes.svc.default). It will still be able to deploy to external clusters with inputted
|
||||
credentials.
|
||||
|
||||
* [namespace-install.yaml](https://github.com/argoproj/argo-cd/blob/master/manifests/namespace-install.yaml) - Installation of Argo CD which requires only
|
||||
@@ -26,11 +26,11 @@ Not recommended for production use. This type of installation is typically used
|
||||
need Argo CD to deploy applications in the same cluster that Argo CD runs in, and will rely solely
|
||||
on inputted cluster credentials. An example of using this set of manifests is if you run several
|
||||
Argo CD instances for different teams, where each instance will be deploying applications to
|
||||
external clusters. Will still be possible to deploy to the same cluster (kubernetes.svc.default)
|
||||
external clusters. It will still be possible to deploy to the same cluster (kubernetes.svc.default)
|
||||
with inputted credentials (i.e. `argocd cluster add <CONTEXT> --in-cluster --namespace <YOUR NAMESPACE>`).
|
||||
|
||||
> Note: Argo CD CRDs are not included into [namespace-install.yaml](https://github.com/argoproj/argo-cd/blob/master/manifests/namespace-install.yaml).
|
||||
> and have to be installed separately. The CRD manifests are located in [manifests/crds](https://github.com/argoproj/argo-cd/blob/master/manifests/crds) directory.
|
||||
> and have to be installed separately. The CRD manifests are located in the [manifests/crds](https://github.com/argoproj/argo-cd/blob/master/manifests/crds) directory.
|
||||
> Use the following command to install them:
|
||||
> ```bash
|
||||
> kubectl apply -k https://github.com/argoproj/argo-cd/manifests/crds\?ref\=stable
|
||||
@@ -38,7 +38,7 @@ Not recommended for production use. This type of installation is typically used
|
||||
|
||||
### High Availability:
|
||||
|
||||
High Availability installation is recommended for production use. Bundle includes the same components but tunned for high availability and resiliency.
|
||||
High Availability installation is recommended for production use. This bundle includes the same components but tuned for high availability and resiliency.
|
||||
|
||||
* [ha/install.yaml](https://github.com/argoproj/argo-cd/blob/master/manifests/ha/install.yaml) - the same as install.yaml but with multiple replicas for
|
||||
supported components.
|
||||
@@ -49,10 +49,16 @@ High Availability installation is recommended for production use. Bundle include
|
||||
## Core
|
||||
|
||||
The core installation is most suitable for cluster administrators who indepently use Argo CD and don't need multi-tenancy features. This installation
|
||||
includes less components and easier to setup. The bundle does not include API server, UI as well as install non-HA light-weight version of each component.
|
||||
includes fewer components and is easier to setup. The bundle does not include the API server or UI, and installs the lightweight (non-HA) version of each component.
|
||||
|
||||
The end-users need Kubernetes access to manage Argo CD. The `argocd` CLI has to be configured using `argocd login --k8s-api` command. The Web UI is also
|
||||
available and can be started using `argocd admin dashboard` command.
|
||||
The end-users need Kubernetes access to manage Argo CD. The `argocd` CLI has to be configured using the following commands:
|
||||
|
||||
```bash
|
||||
kubectl config set-context --current --namespace=argocd # change current kube context to argocd namespace
|
||||
argocd login --core
|
||||
```
|
||||
|
||||
The Web UI is also available and can be started using the `argocd admin dashboard` command.
|
||||
|
||||
Installation manifests are available at [core-install.yaml](https://github.com/argoproj/argo-cd/blob/master/manifests/core-install.yaml).
|
||||
|
||||
@@ -74,4 +80,4 @@ resources:
|
||||
## Helm
|
||||
|
||||
The Argo CD can be installed using [Helm](https://helm.sh/). The Helm chart is currently community maintained and available at
|
||||
[argo-helm/charts/argo-cd](https://github.com/argoproj/argo-helm/tree/master/charts/argo-cd).
|
||||
[argo-helm/charts/argo-cd](https://github.com/argoproj/argo-helm/tree/master/charts/argo-cd).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Upgraded Kustomize Version
|
||||
|
||||
Note that bundled Kustomize has been upgraded to v4.1.2. Some of the flags are changed in Kustomize V4.
|
||||
Note that bundled Kustomize has been upgraded to v4.2.0. Some of the flags are changed in Kustomize V4.
|
||||
For example flag name `load_restrictor` is changed in Kustomize v4+. It is changed from `--load_restrictor=none` to `--load-restrictor LoadRestrictionsNone`.
|
||||
|
||||
## Replacing `--app-resync` flag with `timeout.reconciliation` setting
|
||||
@@ -23,4 +23,23 @@ and [argocd-repo-creds.yaml](../argocd-repo-creds.yaml).
|
||||
|
||||
## The `argocd-util` CLI commands merged into `argocd admin`
|
||||
|
||||
The `argocd-util` CLI commands are available under `argocd admin` and the `argocd-util` binary is no longer available.
|
||||
The `argocd-util` CLI commands are available under `argocd admin` and the `argocd-util` binary is no longer available.
|
||||
|
||||
## Replace runtime system user while [BYOI](https://argoproj.github.io/argo-cd/operator-manual/custom_tools/#byoi-build-your-own-image)
|
||||
|
||||
Runtime system user should to be changed from `argocd` to `999`, as shown below.
|
||||
|
||||
```dockerfile
|
||||
FROM argoproj/argocd:latest
|
||||
|
||||
# Switch to root for the ability to perform install
|
||||
USER root
|
||||
|
||||
# Something custom here
|
||||
RUN apt-get update
|
||||
|
||||
# Switch back to non-root user
|
||||
|
||||
# deprecated: USER argocd
|
||||
USER 999
|
||||
```
|
||||
|
||||
@@ -79,7 +79,7 @@ argocd app [flags]
|
||||
* [argocd app patch](argocd_app_patch.md) - Patch application
|
||||
* [argocd app patch-resource](argocd_app_patch-resource.md) - Patch resource in an application
|
||||
* [argocd app resources](argocd_app_resources.md) - List resource of application
|
||||
* [argocd app rollback](argocd_app_rollback.md) - Rollback application to a previous deployed version by History ID
|
||||
* [argocd app rollback](argocd_app_rollback.md) - Rollback application to a previous deployed version by History ID, omitted will Rollback to the previous version
|
||||
* [argocd app set](argocd_app_set.md) - Set application parameters
|
||||
* [argocd app sync](argocd_app_sync.md) - Sync an application to its target state
|
||||
* [argocd app terminate-op](argocd_app_terminate-op.md) - Terminate running operation of an application
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
## argocd app rollback
|
||||
|
||||
Rollback application to a previous deployed version by History ID
|
||||
Rollback application to a previous deployed version by History ID, omitted will Rollback to the previous version
|
||||
|
||||
```
|
||||
argocd app rollback APPNAME ID [flags]
|
||||
argocd app rollback APPNAME [ID] [flags]
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
@@ -21,6 +21,9 @@ argocd repocreds add REPOURL [flags]
|
||||
# Add credentials with GitHub App authentication to use for all repositories under https://ghe.example.com/repos
|
||||
argocd repocreds add https://ghe.example.com/repos/ --github-app-id 1 --github-app-installation-id 2 --github-app-private-key-path test.private-key.pem --github-app-enterprise-base-url https://ghe.example.com/api/v3
|
||||
|
||||
# Add credentials with helm oci registry so that these oci registry urls do not need to be added as repos individually.
|
||||
argocd repocreds add localhost:5000/myrepo --enable-oci --type helm
|
||||
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
4efb7d0dadba7fab5191c680fcb342c2b6f252f230019cf9cffd5e4b0cad1d12 kustomize_4.1.2_linux_amd64.tar.gz
|
||||
@@ -1 +0,0 @@
|
||||
d4b0ababb06d7208b439c48c5dadf979433f062ee7131203f6a94ce1159c9d5e kustomize_4.1.2_linux_arm64.tar.gz
|
||||
@@ -0,0 +1 @@
|
||||
220dd03dcda8e45dc50e4e42b2d71882cbc4c05e0ed863513e67930ecad939eb kustomize_4.2.0_linux_amd64.tar.gz
|
||||
@@ -0,0 +1 @@
|
||||
33f2cf3b5db64c09560c187224e9d29452fde2b7f00f85941604fc75d9769e4a kustomize_4.2.0_linux_arm64.tar.gz
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
set -eux -o pipefail
|
||||
|
||||
KUSTOMIZE_VERSION=4.1.2 "$(dirname $0)/../install.sh" helm2-linux jq-linux kustomize-linux protoc-linux swagger-linux
|
||||
KUSTOMIZE_VERSION=4.2.0 "$(dirname $0)/../install.sh" helm2-linux jq-linux kustomize-linux protoc-linux swagger-linux
|
||||
|
||||
@@ -14,6 +14,6 @@ jq_version=1.6
|
||||
ksonnet_version=0.13.1
|
||||
kubectl_version=1.17.8
|
||||
kubectx_version=0.6.3
|
||||
kustomize4_version=4.1.2
|
||||
kustomize4_version=4.2.0
|
||||
protoc_version=3.7.1
|
||||
swagger_version=0.19.0
|
||||
|
||||
@@ -5,7 +5,7 @@ kind: Kustomization
|
||||
images:
|
||||
- name: quay.io/argoproj/argocd
|
||||
newName: quay.io/argoproj/argocd
|
||||
newTag: latest
|
||||
newTag: v2.1.0-rc2
|
||||
resources:
|
||||
- ./application-controller
|
||||
- ./dex
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- ../crds
|
||||
- ../cluster-rbac
|
||||
- ../base/config
|
||||
- ../base/application-controller
|
||||
- ../base/repo-server
|
||||
|
||||
@@ -11,7 +11,7 @@ patchesStrategicMerge:
|
||||
images:
|
||||
- name: quay.io/argoproj/argocd
|
||||
newName: quay.io/argoproj/argocd
|
||||
newTag: latest
|
||||
newTag: v2.1.0-rc2
|
||||
resources:
|
||||
- ../../base/application-controller
|
||||
- ../../base/dex
|
||||
|
||||
@@ -3684,7 +3684,7 @@ spec:
|
||||
- -n
|
||||
- /usr/local/bin/argocd
|
||||
- /shared/argocd-dex
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.1.0-rc2
|
||||
imagePullPolicy: Always
|
||||
name: copyutil
|
||||
volumeMounts:
|
||||
@@ -3895,7 +3895,7 @@ spec:
|
||||
key: reposerver.default.cache.expiration
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.1.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
@@ -4138,7 +4138,7 @@ spec:
|
||||
key: server.default.cache.expiration
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.1.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
@@ -4334,7 +4334,7 @@ spec:
|
||||
key: controller.default.cache.expiration
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.1.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
|
||||
@@ -1071,7 +1071,7 @@ spec:
|
||||
- -n
|
||||
- /usr/local/bin/argocd
|
||||
- /shared/argocd-dex
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.1.0-rc2
|
||||
imagePullPolicy: Always
|
||||
name: copyutil
|
||||
volumeMounts:
|
||||
@@ -1282,7 +1282,7 @@ spec:
|
||||
key: reposerver.default.cache.expiration
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.1.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
@@ -1525,7 +1525,7 @@ spec:
|
||||
key: server.default.cache.expiration
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.1.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
@@ -1721,7 +1721,7 @@ spec:
|
||||
key: controller.default.cache.expiration
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.1.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
|
||||
@@ -3049,7 +3049,7 @@ spec:
|
||||
- -n
|
||||
- /usr/local/bin/argocd
|
||||
- /shared/argocd-dex
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.1.0-rc2
|
||||
imagePullPolicy: Always
|
||||
name: copyutil
|
||||
volumeMounts:
|
||||
@@ -3224,7 +3224,7 @@ spec:
|
||||
key: reposerver.default.cache.expiration
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.1.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
@@ -3463,7 +3463,7 @@ spec:
|
||||
key: server.default.cache.expiration
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.1.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
@@ -3653,7 +3653,7 @@ spec:
|
||||
key: controller.default.cache.expiration
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.1.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
|
||||
@@ -436,7 +436,7 @@ spec:
|
||||
- -n
|
||||
- /usr/local/bin/argocd
|
||||
- /shared/argocd-dex
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.1.0-rc2
|
||||
imagePullPolicy: Always
|
||||
name: copyutil
|
||||
volumeMounts:
|
||||
@@ -611,7 +611,7 @@ spec:
|
||||
key: reposerver.default.cache.expiration
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.1.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
@@ -850,7 +850,7 @@ spec:
|
||||
key: server.default.cache.expiration
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.1.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
@@ -1040,7 +1040,7 @@ spec:
|
||||
key: controller.default.cache.expiration
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.1.0-rc2
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
|
||||
@@ -38,6 +38,7 @@ $header: 120px;
|
||||
position: fixed;
|
||||
top: $header + 100px;
|
||||
right: 60px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
&__refreshing-label {
|
||||
|
||||
@@ -304,9 +304,7 @@ export class PodView extends React.Component<PodViewProps> {
|
||||
}
|
||||
|
||||
const statusByKey = new Map<string, ResourceStatus>();
|
||||
if (this.props.app) {
|
||||
this.props.app.status.resources.forEach(res => statusByKey.set(nodeKey(res), res));
|
||||
}
|
||||
this.props.app.status?.resources?.forEach(res => statusByKey.set(nodeKey(res), res));
|
||||
(tree.nodes || []).forEach((rnode: ResourceTreeNode) => {
|
||||
// make sure each node has not null/undefined parentRefs field
|
||||
rnode.parentRefs = rnode.parentRefs || [];
|
||||
|
||||
@@ -23,7 +23,7 @@ export const ApplicationResourcesDiff = (props: ApplicationResourcesDiffProps) =
|
||||
b: state.predictedLiveState ? jsYaml.safeDump(state.predictedLiveState, {indent: 2}) : '',
|
||||
hook: state.hook,
|
||||
// doubles as sort order
|
||||
name: (state.group || '') + '/' + state.kind + '/' + state.namespace + '/' + state.name
|
||||
name: (state.group || '') + '/' + state.kind + '/' + (state.namespace ? state.namespace + '/' : '') + state.name
|
||||
};
|
||||
})
|
||||
.filter(i => !i.hook)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
$height: 16px;
|
||||
$border-width: 2px;
|
||||
margin: 0px;
|
||||
width: 80%;
|
||||
width: 100%;
|
||||
height: $height;
|
||||
display: flex;
|
||||
border-radius: 25px;
|
||||
|
||||
@@ -60,6 +60,13 @@ export const Filter = (props: FilterProps) => {
|
||||
}
|
||||
}, [values]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (props.selected.length === 0) {
|
||||
setValues({} as {[label: string]: boolean});
|
||||
setInput('');
|
||||
}
|
||||
}, [props.selected.length]);
|
||||
|
||||
return (
|
||||
<div className={classNames('filter', {'filter--wrap': props.wrap})}>
|
||||
<div className='filter__header'>
|
||||
|
||||
@@ -324,6 +324,10 @@ export function renderResourceMenu(
|
||||
} else {
|
||||
const isRoot = resource.root && nodeKey(resource.root) === nodeKey(resource);
|
||||
const items: MenuItem[] = [
|
||||
{
|
||||
title: 'Details',
|
||||
action: () => appContext.apis.navigation.goto('.', {node: nodeKey(resource)})
|
||||
},
|
||||
...((isRoot && [
|
||||
{
|
||||
title: 'Sync',
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
.paginate {
|
||||
position: relative;
|
||||
height: 25px;
|
||||
|
||||
|
||||
@media (max-width: map-get($breakpoints, medium)) {
|
||||
& {
|
||||
@@ -23,11 +21,9 @@
|
||||
}
|
||||
|
||||
&__paginator {
|
||||
ul {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
display: inline-block;
|
||||
padding: 0;
|
||||
margin-bottom: 0;
|
||||
|
||||
li {
|
||||
display: inline-block;
|
||||
@@ -50,15 +46,7 @@
|
||||
}
|
||||
|
||||
&__size-menu {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
right: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
margin-left: auto;
|
||||
li {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {DataLoader, DropDownMenu} from 'argo-ui';
|
||||
|
||||
// import {ApplicationStatusBar} from '../../../applications/components/applications-list/applications-status-bar';
|
||||
import * as React from 'react';
|
||||
import ReactPaginate from 'react-paginate';
|
||||
import {services} from '../../services';
|
||||
@@ -30,35 +29,37 @@ export function Paginate<T>({page, onPageChange, children, data, emptyState, pre
|
||||
|
||||
function paginator() {
|
||||
return (
|
||||
<React.Fragment>
|
||||
{pageCount > 1 && (
|
||||
<ReactPaginate
|
||||
containerClassName='paginate__paginator'
|
||||
forcePage={page}
|
||||
pageCount={pageCount}
|
||||
pageRangeDisplayed={5}
|
||||
marginPagesDisplayed={2}
|
||||
onPageChange={item => onPageChange(item.selected)}
|
||||
/>
|
||||
)}
|
||||
<div className='paginate__size-menu'>
|
||||
{header || <div />}
|
||||
<DropDownMenu
|
||||
anchor={() => (
|
||||
<a>
|
||||
Items per page: {pageSize === -1 ? 'all' : pageSize} <i className='fa fa-caret-down' />
|
||||
</a>
|
||||
)}
|
||||
items={[5, 10, 15, 20, -1].map(count => ({
|
||||
title: count === -1 ? 'all' : count.toString(),
|
||||
action: () => {
|
||||
pref.pageSizes[preferencesKey] = count;
|
||||
services.viewPreferences.updatePreferences(pref);
|
||||
}
|
||||
}))}
|
||||
/>
|
||||
<div style={{marginBottom: '0.5em'}}>
|
||||
<div style={{display: 'flex', alignItems: 'start', marginBottom: '0.5em'}}>
|
||||
{pageCount > 1 && (
|
||||
<ReactPaginate
|
||||
containerClassName='paginate__paginator'
|
||||
forcePage={page}
|
||||
pageCount={pageCount}
|
||||
pageRangeDisplayed={5}
|
||||
marginPagesDisplayed={2}
|
||||
onPageChange={item => onPageChange(item.selected)}
|
||||
/>
|
||||
)}
|
||||
<div className='paginate__size-menu'>
|
||||
<DropDownMenu
|
||||
anchor={() => (
|
||||
<a>
|
||||
Items per page: {pageSize === -1 ? 'all' : pageSize} <i className='fa fa-caret-down' />
|
||||
</a>
|
||||
)}
|
||||
items={[5, 10, 15, 20, -1].map(count => ({
|
||||
title: count === -1 ? 'all' : count.toString(),
|
||||
action: () => {
|
||||
pref.pageSizes[preferencesKey] = count;
|
||||
services.viewPreferences.updatePreferences(pref);
|
||||
}
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
{header}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1669,7 +1669,7 @@ are-we-there-yet@~1.1.2:
|
||||
|
||||
"argo-ui@git+https://github.com/argoproj/argo-ui.git":
|
||||
version "1.0.0"
|
||||
resolved "git+https://github.com/argoproj/argo-ui.git#e72b3655abe21c16a12ca82369d90209fa1f05d9"
|
||||
resolved "git+https://github.com/argoproj/argo-ui.git#672a3a329ec7f9e99304880555fc08aba692cc16"
|
||||
dependencies:
|
||||
"@fortawesome/fontawesome-free" "^5.8.1"
|
||||
"@tippy.js/react" "^2.1.2"
|
||||
|
||||
@@ -586,7 +586,7 @@ func GetGlobalProjects(proj *argoappv1.AppProject, projLister applicationsv1.App
|
||||
}
|
||||
}
|
||||
if !matchMe {
|
||||
break
|
||||
continue
|
||||
}
|
||||
//If proj is a match for this global project setting, then it is its global project
|
||||
globalProj, err := projLister.AppProjects(proj.Namespace).Get(gp.ProjectName)
|
||||
|
||||
@@ -758,3 +758,89 @@ func TestFilterByName(t *testing.T) {
|
||||
assert.Len(t, res, 0)
|
||||
})
|
||||
}
|
||||
|
||||
func TestGetGlobalProjects(t *testing.T) {
|
||||
t.Run("Multiple global projects", func(t *testing.T) {
|
||||
namespace := "default"
|
||||
|
||||
cm := corev1.ConfigMap{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "argocd-cm",
|
||||
Namespace: test.FakeArgoCDNamespace,
|
||||
Labels: map[string]string{
|
||||
"app.kubernetes.io/part-of": "argocd",
|
||||
},
|
||||
},
|
||||
Data: map[string]string{
|
||||
"globalProjects": `
|
||||
- projectName: default-x
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- key: is-x
|
||||
operator: Exists
|
||||
- projectName: default-non-x
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- key: is-x
|
||||
operator: DoesNotExist
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
||||
defaultX := &argoappv1.AppProject{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "default-x", Namespace: namespace},
|
||||
Spec: argoappv1.AppProjectSpec{
|
||||
ClusterResourceWhitelist: []metav1.GroupKind{
|
||||
{Group: "*", Kind: "*"},
|
||||
},
|
||||
ClusterResourceBlacklist: []metav1.GroupKind{
|
||||
{Kind: "Volume"},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
defaultNonX := &argoappv1.AppProject{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "default-non-x", Namespace: namespace},
|
||||
Spec: argoappv1.AppProjectSpec{
|
||||
ClusterResourceBlacklist: []metav1.GroupKind{
|
||||
{Group: "*", Kind: "*"},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
isX := &argoappv1.AppProject{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "is-x",
|
||||
Namespace: namespace,
|
||||
Labels: map[string]string{
|
||||
"is-x": "yep",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
isNoX := &argoappv1.AppProject{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "is-no-x", Namespace: namespace},
|
||||
}
|
||||
|
||||
projClientset := appclientset.NewSimpleClientset(defaultX, defaultNonX, isX, isNoX)
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
indexers := cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}
|
||||
informer := v1alpha1.NewAppProjectInformer(projClientset, namespace, 0, indexers)
|
||||
go informer.Run(ctx.Done())
|
||||
cache.WaitForCacheSync(ctx.Done(), informer.HasSynced)
|
||||
|
||||
kubeClient := fake.NewSimpleClientset(&cm)
|
||||
settingsMgr := settings.NewSettingsManager(context.Background(), kubeClient, test.FakeArgoCDNamespace)
|
||||
|
||||
projLister := applisters.NewAppProjectLister(informer.GetIndexer())
|
||||
|
||||
xGlobalProjects := GetGlobalProjects(isX, projLister, settingsMgr)
|
||||
assert.Len(t, xGlobalProjects, 1)
|
||||
assert.Equal(t, xGlobalProjects[0].Name, "default-x")
|
||||
|
||||
nonXGlobalProjects := GetGlobalProjects(isNoX, projLister, settingsMgr)
|
||||
assert.Len(t, nonXGlobalProjects, 1)
|
||||
assert.Equal(t, nonXGlobalProjects[0].Name, "default-non-x")
|
||||
})
|
||||
}
|
||||
|
||||
@@ -162,6 +162,7 @@ func SetLogLevel(logLevel string) {
|
||||
level, err := log.ParseLevel(text.FirstNonEmpty(logLevel, log.InfoLevel.String()))
|
||||
errors.CheckError(err)
|
||||
os.Setenv(common.EnvLogLevel, level.String())
|
||||
log.SetLevel(level)
|
||||
}
|
||||
|
||||
// SetGLogLevel set the glog level for the k8s go-client
|
||||
|
||||
Reference in New Issue
Block a user