Skip to content

Add application validation#111

Merged
jessesuen merged 1 commit intoargoproj:masterfrom
jessesuen:app-validation
Apr 20, 2018
Merged

Add application validation#111
jessesuen merged 1 commit intoargoproj:masterfrom
jessesuen:app-validation

Conversation

@jessesuen
Copy link
Member

When adding an application, the API server will now validate:

  • the git repository is accessible
  • the git path contains a valid app.yaml
  • the specified environment exists
  • the referenced cluster has been added to ArgoCD

@jessesuen jessesuen self-assigned this Apr 20, 2018
@jessesuen jessesuen requested review from alexmt and merenbach April 20, 2018 20:34
Copy link
Contributor

@merenbach merenbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just a couple minor concerns regarding DRY and bigger-than-one's-head methods. :-D

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if dividing this method into separate methods called from here might help improve future maintainability (and maybe even unit testability).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do agree in principle, but I generally prefer to do something like that on an as-needed basis to avoid function sprawl. For now the only callers that need this are application add and update, and they just want to validate the app as a whole, instead of validating different aspects.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a function in util/cli/config.go that unmarshals local files and has unit tests. Wondering if it might be useful here for DRY. (Please see util/cli/config_test.go, cmd/argocd/commands/app.go, and util/localconfig/localconfig.go for usage examples.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pointer, fixed.

@jessesuen jessesuen force-pushed the app-validation branch 2 times, most recently from dc62cb8 to caf94f3 Compare April 20, 2018 22:57
@jessesuen jessesuen merged commit b24e478 into argoproj:master Apr 20, 2018
@jessesuen jessesuen deleted the app-validation branch September 4, 2018 20:58
alexec pushed a commit that referenced this pull request Apr 24, 2019
sujeilyfonseca added a commit to sujeilyfonseca/argo-cd that referenced this pull request Oct 26, 2023
Created a STARTER_TEAM.md file to comply with InnerSource requirements.

Contributes to: ibm-saas-platform/workitems#4250

Signed-off-by: Sujeily Fonseca <sujeily.fonseca@ibm.com>
sujeilyfonseca added a commit to sujeilyfonseca/argo-cd that referenced this pull request Oct 29, 2023
Created a STARTER_TEAM.md file to comply with InnerSource requirements.

Contributes to: ibm-saas-platform/workitems#4250

Signed-off-by: Sujeily Fonseca <sujeily.fonseca@ibm.com>
sujeilyfonseca added a commit to sujeilyfonseca/argo-cd that referenced this pull request Mar 4, 2024
Created a STARTER_TEAM.md file to comply with InnerSource requirements.

Contributes to: ibm-saas-platform/workitems#4250

Signed-off-by: Sujeily Fonseca <sujeily.fonseca@ibm.com>
sujeilyfonseca added a commit to sujeilyfonseca/argo-cd that referenced this pull request Apr 26, 2024
Created a STARTER_TEAM.md file to comply with InnerSource requirements.

Contributes to: ibm-saas-platform/workitems#4250

Signed-off-by: Sujeily Fonseca <sujeily.fonseca@ibm.com>
sujeilyfonseca added a commit to sujeilyfonseca/argo-cd that referenced this pull request Jun 7, 2024
Created a STARTER_TEAM.md file to comply with InnerSource requirements.

Contributes to: ibm-saas-platform/workitems#4250

Signed-off-by: Sujeily Fonseca <sujeily.fonseca@ibm.com>
sujeilyfonseca added a commit to sujeilyfonseca/argo-cd that referenced this pull request Jun 19, 2024
Created a STARTER_TEAM.md file to comply with InnerSource requirements.

Contributes to: ibm-saas-platform/workitems#4250

Signed-off-by: Sujeily Fonseca <sujeily.fonseca@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants