Compare commits

...

6 Commits

Author SHA1 Message Date
github-actions[bot]
0ee33e52dd Bump version to 2.7.9 (#14674)
Signed-off-by: GitHub <noreply@github.com>
Co-authored-by: crenshaw-dev <crenshaw-dev@users.noreply.github.com>
2023-07-24 13:08:24 -04:00
gcp-cherry-pick-bot[bot]
ba44ddb9a1 fix: webhook handler fails to refresh when alternate application namespaces are configured (#13976) (#14653)
* fix: Add failing test for webhooks in all namespaces

This adds a failing test that properly exercises this functionality over
all namespaces. The issue with the code that is under test is that it
does not pass the namespace correctly to the patch of the application,
resulting in the patch not taking place in the correct namespace



* fix: queue webhook refresh for apps in all namespaces

This passes the test in the previous commit, to ensure that webhooks
correctly refresh applications across all namespaces.



* fix: Use existing NamespacedName type

Use the existing type instead of a custom type



---------

Signed-off-by: Nikolas Skoufis <nskoufis@seek.com.au>
Co-authored-by: Nik Skoufis <n.skoufis@gmail.com>
2023-07-21 14:31:07 -04:00
gcp-cherry-pick-bot[bot]
8249eddf75 docs(deep-links): Fix link to pkg.go.dev to not return 404 (#14595) (#14640)
Signed-off-by: Håkon Solbjørg <hakon@solbj.org>
Co-authored-by: Håkon Solbjørg <hakon@solbj.org>
2023-07-21 10:20:39 -04:00
gcp-cherry-pick-bot[bot]
0d24330298 docs: Skip export keyword in notification docs (#14633) (#14643)
This change does three things:

1. It removes the `export` keyword. It's not required since the example
   executes a script where the variables are evaluated as an inline
   string. One could even argue that there is a slight security issue
   with using `export` here, since that will expose the credentials to
   all applications started in the current context.
2. It adds a space (` `) before the `PASSWORD` variable. This will keep
   it out of the user's Bash history by default. See [HISTIGNORE][bash].
3. Add a newline for clarity.

[bash]: https://www.gnu.org/software/bash/manual/bash.html#index-HISTIGNORE

Signed-off-by: Andreas Lindhé <andreas@lindhe.io>
Co-authored-by: Andreas Lindhé <lindhe@users.noreply.github.com>
2023-07-21 10:17:29 -04:00
Zadkiel Aharonian
53eeed06b0 fix(ui): correctly align status column in application resource list (#14618)
Signed-off-by: Zadkiel Aharonian <hello@zadkiel.fr>
2023-07-21 09:51:23 -04:00
gcp-cherry-pick-bot[bot]
f1bfa8c655 fix(ui): Fix Destination Cluster URL/Name Drop down not updating destination field (#13813) (#14216) (#14627)
* fix(ui): Fix Destination Cluster URL/Name Drop down not updating destination field (fixes #13813)



* Address linting errors



---------

Signed-off-by: Kyle Purkiss <kyle.purkiss@procore.com>
Co-authored-by: Kyle Purkiss <kyle.purkiss@procore.com>
2023-07-20 14:54:28 -04:00
15 changed files with 63 additions and 57 deletions

View File

@@ -1 +1 @@
2.7.8
2.7.9

View File

@@ -21,7 +21,7 @@ Each link in the list has five subfields:
1. `title`: title/tag that will be displayed in the UI corresponding to that link
2. `url`: the actual URL where the deep link will redirect to, this field can be templated to use data from the
corresponding application, project or resource objects (depending on where it is located). This uses [text/template](pkg.go.dev/text/template) pkg for templating
corresponding application, project or resource objects (depending on where it is located). This uses [text/template](https://pkg.go.dev/text/template) pkg for templating
3. `description` (optional): a description for what the deep link is about
4. `icon.class` (optional): a font-awesome icon class to be used when displaying the links in dropdown menus
5. `if` (optional): a conditional statement that results in either `true` or `false`, it also has access to the same

View File

@@ -17,8 +17,9 @@ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/st
* Add Email username and password token to `argocd-notifications-secret` secret
```bash
export EMAIL_USER=<your-username>
export PASSWORD=<your-password>
EMAIL_USER=<your-username>
PASSWORD=<your-password>
kubectl apply -n argocd -f - << EOF
apiVersion: v1
kind: Secret

View File

@@ -5,7 +5,7 @@ kind: Kustomization
images:
- name: quay.io/argoproj/argocd
newName: quay.io/argoproj/argocd
newTag: v2.7.8
newTag: v2.7.9
resources:
- ./application-controller
- ./dex

View File

@@ -16706,7 +16706,7 @@ spec:
key: applicationsetcontroller.enable.progressive.syncs
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -16968,7 +16968,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -17020,7 +17020,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -17233,7 +17233,7 @@ spec:
key: controller.kubectl.parallelism.limit
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -12,4 +12,4 @@ resources:
images:
- name: quay.io/argoproj/argocd
newName: quay.io/argoproj/argocd
newTag: v2.7.8
newTag: v2.7.9

View File

@@ -12,7 +12,7 @@ patches:
images:
- name: quay.io/argoproj/argocd
newName: quay.io/argoproj/argocd
newTag: v2.7.8
newTag: v2.7.9
resources:
- ../../base/application-controller
- ../../base/applicationset-controller

View File

@@ -17927,7 +17927,7 @@ spec:
key: applicationsetcontroller.enable.progressive.syncs
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -18037,7 +18037,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -18094,7 +18094,7 @@ spec:
containers:
- args:
- /usr/local/bin/argocd-notifications
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -18399,7 +18399,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -18451,7 +18451,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -18733,7 +18733,7 @@ spec:
key: server.enable.proxy.extension
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -18978,7 +18978,7 @@ spec:
key: controller.kubectl.parallelism.limit
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -1587,7 +1587,7 @@ spec:
key: applicationsetcontroller.enable.progressive.syncs
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -1697,7 +1697,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -1754,7 +1754,7 @@ spec:
containers:
- args:
- /usr/local/bin/argocd-notifications
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -2059,7 +2059,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -2111,7 +2111,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -2393,7 +2393,7 @@ spec:
key: server.enable.proxy.extension
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -2638,7 +2638,7 @@ spec:
key: controller.kubectl.parallelism.limit
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -17044,7 +17044,7 @@ spec:
key: applicationsetcontroller.enable.progressive.syncs
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -17154,7 +17154,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -17211,7 +17211,7 @@ spec:
containers:
- args:
- /usr/local/bin/argocd-notifications
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -17468,7 +17468,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -17520,7 +17520,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -17795,7 +17795,7 @@ spec:
key: server.enable.proxy.extension
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -18035,7 +18035,7 @@ spec:
key: controller.kubectl.parallelism.limit
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -704,7 +704,7 @@ spec:
key: applicationsetcontroller.enable.progressive.syncs
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -814,7 +814,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -871,7 +871,7 @@ spec:
containers:
- args:
- /usr/local/bin/argocd-notifications
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -1128,7 +1128,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -1180,7 +1180,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -1455,7 +1455,7 @@ spec:
key: server.enable.proxy.extension
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -1695,7 +1695,7 @@ spec:
key: controller.kubectl.parallelism.limit
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.7.8
image: quay.io/argoproj/argocd:v2.7.9
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -108,15 +108,24 @@ export const ApplicationCreatePanel = (props: {
const [explicitPathType, setExplicitPathType] = React.useState<{path: string; type: models.AppSourceType}>(null);
const [destFormat, setDestFormat] = React.useState('URL');
const [retry, setRetry] = React.useState(false);
const app = deepMerge(DEFAULT_APP, props.app || {});
React.useEffect(() => {
if (app?.spec?.destination?.name && app.spec.destination.name !== '') {
setDestFormat('NAME');
} else {
setDestFormat('URL');
}
}, []);
function normalizeTypeFields(formApi: FormApi, type: models.AppSourceType) {
const app = formApi.getFormState().values;
const appToNormalize = formApi.getFormState().values;
for (const item of appTypes) {
if (item.type !== type) {
delete app.spec.source[item.field];
delete appToNormalize.spec.source[item.field];
}
}
formApi.setAllValues(app);
formApi.setAllValues(appToNormalize);
}
return (
@@ -132,16 +141,10 @@ export const ApplicationCreatePanel = (props: {
}>
{({projects, clusters, reposInfo}) => {
const repos = reposInfo.map(info => info.repo).sort();
const app = deepMerge(DEFAULT_APP, props.app || {});
const repoInfo = reposInfo.find(info => info.repo === app.spec.source.repoURL);
if (repoInfo) {
normalizeAppSource(app, repoInfo.type || 'git');
}
if (app?.spec?.destination?.name && app.spec.destination.name !== '') {
setDestFormat('NAME');
} else {
setDestFormat('URL');
}
return (
<div className='application-create-panel'>
{(yamlMode && (

View File

@@ -24,7 +24,7 @@ export const ApplicationResourceList = ({
<div className='columns small-1 xxxlarge-1' />
<div className='columns small-2 xxxlarge-2'>NAME</div>
<div className='columns small-2 xxxlarge-2'>GROUP/KIND</div>
<div className='columns small-1 xxxlarge-2'>SYNC ORDER</div>
<div className='columns small-1 xxxlarge-1'>SYNC ORDER</div>
<div className='columns small-2 xxxlarge-2'>NAMESPACE</div>
<div className='columns small-2 xxxlarge-2'>CREATED AT</div>
<div className='columns small-2 xxxlarge-2'>STATUS</div>
@@ -62,7 +62,7 @@ export const ApplicationResourceList = ({
)}
</div>
<div className='columns small-2 xxxlarge-2'>{[res.group, res.kind].filter(item => !!item).join('/')}</div>
<div className='columns small-1 xxxlarge-2'>{res.syncWave || '-'}</div>
<div className='columns small-1 xxxlarge-1'>{res.syncWave || '-'}</div>
<div className='columns small-2 xxxlarge-2'>{res.namespace}</div>
<div className='columns small-2 xxxlarge-2'>{res.createdAt}</div>
<div className='columns small-2 xxxlarge-2'>

View File

@@ -264,7 +264,8 @@ func (a *ArgoCDWebhookHandler) HandleEvent(payload interface{}) {
for _, source := range app.Spec.GetSources() {
if sourceRevisionHasChanged(source, revision, touchedHead) && sourceUsesURL(source, webURL, repoRegexp) {
if appFilesHaveChanged(&app, changedFiles) {
_, err = argo.RefreshApp(appIf, app.ObjectMeta.Name, v1alpha1.RefreshTypeNormal)
namespacedAppInterface := a.appClientset.ArgoprojV1alpha1().Applications(app.ObjectMeta.Namespace)
_, err = argo.RefreshApp(namespacedAppInterface, app.ObjectMeta.Name, v1alpha1.RefreshTypeNormal)
if err != nil {
log.Warnf("Failed to refresh app '%s' for controller reprocessing: %v", app.ObjectMeta.Name, err)
continue

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"io"
"k8s.io/apimachinery/pkg/types"
"net/http"
"net/http/httptest"
"os"
@@ -149,10 +150,10 @@ func TestGitHubCommitEvent_MultiSource_Refresh(t *testing.T) {
func TestGitHubCommitEvent_AppsInOtherNamespaces(t *testing.T) {
hook := test.NewGlobal()
patchedApps := make([]string, 0, 3)
patchedApps := make([]types.NamespacedName, 0, 3)
reaction := func(action kubetesting.Action) (handled bool, ret runtime.Object, err error) {
patchAction := action.(kubetesting.PatchAction)
patchedApps = append(patchedApps, patchAction.GetName())
patchedApps = append(patchedApps, types.NamespacedName{Name: patchAction.GetName(), Namespace: patchAction.GetNamespace()})
return true, nil, nil
}
@@ -231,10 +232,10 @@ func TestGitHubCommitEvent_AppsInOtherNamespaces(t *testing.T) {
assert.Contains(t, logMessages, "Requested app 'app-to-refresh-in-globbed-namespace' refresh")
assert.NotContains(t, logMessages, "Requested app 'app-to-ignore' refresh")
assert.Contains(t, patchedApps, "app-to-refresh-in-default-namespace")
assert.Contains(t, patchedApps, "app-to-refresh-in-exact-match-namespace")
assert.Contains(t, patchedApps, "app-to-refresh-in-globbed-namespace")
assert.NotContains(t, patchedApps, "app-to-ignore")
assert.Contains(t, patchedApps, types.NamespacedName{Name: "app-to-refresh-in-default-namespace", Namespace: "argocd"})
assert.Contains(t, patchedApps, types.NamespacedName{Name: "app-to-refresh-in-exact-match-namespace", Namespace: "end-to-end-tests"})
assert.Contains(t, patchedApps, types.NamespacedName{Name: "app-to-refresh-in-globbed-namespace", Namespace: "app-team-two"})
assert.NotContains(t, patchedApps, types.NamespacedName{Name: "app-to-ignore", Namespace: "kube-system"})
assert.Len(t, patchedApps, 3)
hook.Reset()