Compare commits

...

20 Commits

Author SHA1 Message Date
argo-bot
b067879892 Bump version to 2.1.0-rc2 2021-08-03 17:00:32 +00:00
argo-bot
ab2bbc2201 Bump version to 2.1.0-rc2 2021-08-03 17:00:06 +00:00
Remington Breeze
a93649419b fix(ui): Bump argo-ui to hide filter suggestions on enter and show on typing (#6891)
* fix(ui): Bump argo-ui to hide filter suggestions on enter and show on typing

Signed-off-by: Remington Breeze <remington@breeze.software>

* remove unneccessary yarn.lock changes

Signed-off-by: Remington Breeze <remington@breeze.software>
2021-08-03 09:45:26 -07:00
Remington Breeze
15c361e525 fix(ui): Add View Details option to resource actions menu (#6893)
Signed-off-by: Remington Breeze <remington@breeze.software>
2021-08-03 09:45:21 -07:00
Jan-Otto Kröpke
a5ba98ff61 fix: upgrade to kustomize 4.2.0 (#6861)
Signed-off-by: Jan-Otto Kröpke <joe@adorsys.de>
2021-08-03 09:45:16 -07:00
May Zhang
18ddf1f839 fix: add documentation for using argocd repocreds with --enable-coi and --type helm (#6890)
Signed-off-by: May Zhang <may_zhang@intuit.com>
2021-08-03 09:45:12 -07:00
Jun
4e8b9b85b8 feat: Rollback command support omit history id (#6863)
Signed-off-by: junnplus <junnplus@gmail.com>
2021-08-03 09:45:03 -07:00
Remington Breeze
34b3139309 fix(ui): Incorrect path for non-namespaced resources (#6895)
Signed-off-by: Remington Breeze <remington@breeze.software>
2021-08-03 09:44:58 -07:00
Remington Breeze
4410803b11 fix(ui): Page navigation no longer visible with status bar (#6888)
Signed-off-by: Remington Breeze <remington@breeze.software>
2021-08-03 09:44:50 -07:00
Alexander Matyushentsev
83b272e125 fix: make sure orphaned filter checkbox is clickable (#6886)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2021-08-03 09:44:44 -07:00
woshicai
4f967eaa5a fix: docs about custom image user #6851 (#6872)
* fix: docs about custom image user, change it from argocd to 999

Signed-off-by: Charles Cai <charles.cai@sap.com>

* update: docs for upgrading version

Signed-off-by: Charles Cai <charles.cai@sap.com>

Co-authored-by: Charles Cai <charles.cai@sap.com>
2021-08-03 09:44:38 -07:00
Joe Bowbeer
13cdf01506 docs: installation.md (#6860)
Signed-off-by: Joe Bowbeer <joe.bowbeer@gmail.com>
2021-08-03 09:44:32 -07:00
Yi Cai
d84822ea88 fix: Project filter selector does not get unset upon clear filters #6750 (#6866)
Signed-off-by: ciiay <yicai@redhat.com>
2021-08-03 09:44:25 -07:00
Remington Breeze
a524a3b4d9 fix(ui): Prevent UI crash if app status or resources is empty (#6858) 2021-07-30 10:03:55 -07:00
Alexander Matyushentsev
9419c11c1d fix: util.cli.SetLogLevel should update global log level (#6852)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2021-07-29 13:02:07 -07:00
Alexander Matyushentsev
12a4475176 fix: include cluster level RBAC into argocd-core manifests (#6854)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2021-07-29 12:49:53 -07:00
Klaus Dorninger
662567b8fd fix: #6844 multiple global projects can be configured (#6845)
Signed-off-by: Klaus Dorninger <github@dornimaug.org>
2021-07-29 11:08:01 -07:00
Alexander Matyushentsev
6b14f909e9 fix: core installation must include CRD definitions (#6841)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2021-07-28 16:30:42 -07:00
argo-bot
a92c24094e Bump version to 2.1.0-rc1 2021-07-28 22:24:09 +00:00
argo-bot
307de9555d Bump version to 2.1.0-rc1 2021-07-28 22:23:55 +00:00
36 changed files with 2849 additions and 105 deletions

View File

@@ -1 +1 @@
2.1.0
2.1.0-rc2

View File

@@ -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)

View File

@@ -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{

View File

@@ -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

View File

@@ -69,5 +69,5 @@ RUN apt-get update && \
chmod +x /usr/local/bin/sops
# Switch back to non-root user
USER argocd
USER 999
```

View File

@@ -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).

View File

@@ -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
```

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -1 +0,0 @@
4efb7d0dadba7fab5191c680fcb342c2b6f252f230019cf9cffd5e4b0cad1d12 kustomize_4.1.2_linux_amd64.tar.gz

View File

@@ -1 +0,0 @@
d4b0ababb06d7208b439c48c5dadf979433f062ee7131203f6a94ce1159c9d5e kustomize_4.1.2_linux_arm64.tar.gz

View File

@@ -0,0 +1 @@
220dd03dcda8e45dc50e4e42b2d71882cbc4c05e0ed863513e67930ecad939eb kustomize_4.2.0_linux_amd64.tar.gz

View File

@@ -0,0 +1 @@
33f2cf3b5db64c09560c187224e9d29452fde2b7f00f85941604fc75d9769e4a kustomize_4.2.0_linux_arm64.tar.gz

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -2,6 +2,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../crds
- ../cluster-rbac
- ../base/config
- ../base/application-controller
- ../base/repo-server

View File

@@ -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

View File

@@ -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:

View File

@@ -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:

View File

@@ -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:

View File

@@ -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:

View File

@@ -38,6 +38,7 @@ $header: 120px;
position: fixed;
top: $header + 100px;
right: 60px;
z-index: 1;
}
&__refreshing-label {

View File

@@ -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 || [];

View File

@@ -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)

View File

@@ -4,7 +4,7 @@
$height: 16px;
$border-width: 2px;
margin: 0px;
width: 80%;
width: 100%;
height: $height;
display: flex;
border-radius: 25px;

View File

@@ -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'>

View File

@@ -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',

View File

@@ -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;
}

View File

@@ -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>
);
}

View File

@@ -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"

View File

@@ -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)

View File

@@ -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")
})
}

View File

@@ -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