argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.6k stars 5.36k forks source link

Absence of source and sources in Application cause an unavailability of web interface, which shows stacktrace #19765

Open BoyFromDubai opened 1 month ago

BoyFromDubai commented 1 month ago

Checklist:

Describe the bug When you create an application without source and sources the Web UI is not accessible, showing the stacktrace

To Reproduce Deploy smth like this

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: smth
  namespace: argocd
spec:
  destination:
    namespace: xxx
    name: in-cluster
  project: default

Expected behavior

An existence of sources or source must be validated or just give to an app an unknown status in the WebUI

Screenshots image

Version

v2.11.2

But tested in v2.12.x also, and if I'm not mistaken, the same issue exists

lsq645599166 commented 1 week ago

In the web ui,using the yaml above,it'll throw an error of "source is required". image

I wonder if it would be more convenient to limit spec.source field to be required in the CRD.

BoyFromDubai commented 1 week ago

Yes, but there is an alternative which is “sources” for using multiple sources within one app. That’s why “required” was not used in CRD I suppose

lsq645599166 commented 1 week ago

Oh sorry, I forgot this situation

lsq645599166 commented 1 week ago

how about oneOf, we can require source/sources at least one required

refer: https://kubernetes.io/blog/2019/06/20/crd-structural-schema/#structural-schema

BoyFromDubai commented 1 week ago

Maybe, sounds suitable But I’m not good at CRDs actually