Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Badge not found when app name contains a dot #15507

Closed
pepe9012 opened this issue Sep 14, 2023 · 2 comments · Fixed by #17580
Closed

Badge not found when app name contains a dot #15507

pepe9012 opened this issue Sep 14, 2023 · 2 comments · Fixed by #17580
Labels
bug Something isn't working

Comments

@pepe9012
Copy link

pepe9012 commented Sep 14, 2023

Describe the bug

Application badge is not found, if app name contains dot (.).

Should be related to the changes in v2.8.4 #15468

To Reproduce

  1. Use argocd v2.8.4
  2. Create Application which containes dot (.) in it's name, e.g.: test.app
  3. Call https://ARGOCD_URL/api/badge?name=test.app&revision=true (answer will be 400 not found)

Expected behavior

Application name can contains dots, and badge will work as it did in previous releases.

Version

v2.8.4

@pepe9012 pepe9012 added the bug Something isn't working label Sep 14, 2023
@KouWakai
Copy link

KouWakai commented Sep 16, 2023

In the change made in #15468, it now throws an error if the Application name contains dots.

This change is implemented at line 119 of argo-cd/server/badge/badge.go.

if errs := validation.NameIsDNSLabel(strings.ToLower(p), false); len(p) > 0 && len(errs) != 0 {

The parameter name is validated using NameIsDNSLabel to ensure it adheres to the DNS 1123 label specification.
If the name contains dot,it returns [must not contain dots]

However, as @pepe9012 mentioned, Application names can contain dots, which does not adhere to the DNS specification at a stand point of an applicaition name

ishitasequeira pushed a commit that referenced this issue Mar 23, 2024
* fix: invalid badge validation

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* use util methods

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* rfc accept both lower and upper

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* fix unit test affecting each other with var modification

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

---------

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Co-authored-by: Jann Fischer <jann@mistrust.net>
lyda pushed a commit to lyda/argo-cd that referenced this issue Mar 28, 2024
* fix: invalid badge validation

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* use util methods

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* rfc accept both lower and upper

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* fix unit test affecting each other with var modification

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

---------

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Co-authored-by: Jann Fischer <jann@mistrust.net>
Signed-off-by: Kevin Lyda <kevin@lyda.ie>
mkieweg pushed a commit to mkieweg/argo-cd that referenced this issue Jun 11, 2024
* fix: invalid badge validation

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* use util methods

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* rfc accept both lower and upper

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* fix unit test affecting each other with var modification

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

---------

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Co-authored-by: Jann Fischer <jann@mistrust.net>
Hariharasuthan99 pushed a commit to AmadeusITGroup/argo-cd that referenced this issue Jun 16, 2024
* fix: invalid badge validation

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* use util methods

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* rfc accept both lower and upper

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* fix unit test affecting each other with var modification

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

---------

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Co-authored-by: Jann Fischer <jann@mistrust.net>
@zeusal
Copy link
Contributor

zeusal commented Jul 10, 2024

Hello,

Sorry for writing here, but I have ArgoCD v2.10.7+b060053 and I have APPs of APPs with the following structure:

Root APP called: test-app -> https://ARGOCD_URL/api/badge?name=test-app&revision=true
First child APP called: test-app.hello-world -> https://ARGOCD_URL/api/badge?name=test-app.hello-world&revision=true -> 400 status code

Then, when I try to access the label of the root app I see it, but in the child APP, I can't see it.

Both applications are in the same namespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants