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

Incorrect application name is silently ignored #3

Closed
Zebradil opened this issue May 14, 2023 · 6 comments
Closed

Incorrect application name is silently ignored #3

Zebradil opened this issue May 14, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@Zebradil
Copy link
Member

No description provided.

@Zebradil Zebradil added the bug Something isn't working label May 14, 2023
@kbudde
Copy link
Member

kbudde commented Aug 13, 2023

@Zebradil what is this issue about?

@Zebradil
Copy link
Member Author

@kbudde It'a minor problem:

myks all MY_ENV MY_APP,NOT_EXISTS

doesn't complain about asking it to process a non-existing application. It is bad when you have a typo in the name, it is okay when you want to process an application, which doesn't exist in all target environments. So I thought to add a warning message at least.

@kbudde
Copy link
Member

kbudde commented Aug 14, 2023

Did some tests

1. providing subset of configured and existing apps (good)

=> works as expected

$ myks all envs/mykso/dev argocd,httpbingo
7:16AM INF [mykso-dev > httpbingo > sync] Synced
7:16AM INF [mykso-dev > httpbingo > helm] Helm chart rendered
7:16AM INF [mykso-dev > httpbingo > ytt] Local YTT rendered
7:16AM INF [mykso-dev > httpbingo > render] Completed
7:17AM INF [mykso-dev > argocd > sync] Synced
7:17AM INF [mykso-dev > argocd > ytt] Local YTT rendered
7:17AM INF [mykso-dev > argocd > render] Completed

2. providing a non configured, non existing app, e.g. a typo

=> exits with application not found

$ myks all envs/mykso/dev argocd,httpbingo,foo
7:17AM INF Setting log level to: info
7:17AM ERR [mykso-dev > init] Unable to initialize applications error="Application not found: foo"
7:17AM FTL Unable to initialize myks's globe error="failed to process item: Application not found: foo"

3. configure an app which does not exist -> configuration error (env-data.ytt.yaml)

=> Warning but no exit. I would propose to exit here as well. It's not just a typo it's a configuration error.

$ myks all envs/mykso/dev # or
$ myks all envs/mykso/dev foobar,argocd
7:23AM WRN [mykso-dev > init] Unable to initialize application error="application prototype does not exist" app=foobar dir=envs/mykso/dev
7:23AM INF [mykso-dev > argocd > sync] Synced
7:23AM INF [mykso-dev > argocd > ytt] Local YTT rendered
7:23AM INF [mykso-dev > argocd > render] Completed

4. configure an app only for one env and try to render multiple envs

=> exits with application not found. This is sad as this limits ondemand rendering of multiple envs a lot.

$ myks all envs/mykso argocd,onlyprod
7:29AM ERR [mykso-dev > init] Unable to initialize applications error="Application not found: onlyprod"
7:29AM FTL Unable to initialize myks's globe error="failed to process item: Application not found: onlyprod"

my conclusion:

  • changing 3. to exit is required
  • Improving 4. would be nice to have.

kbudde added a commit to kbudde/myks that referenced this issue Aug 19, 2023
Now it fails, if some configuration error happened (configured app does not exist).
Ignore missing applications if provided via commandline.
Might be a typo or the application is only configured for some envs.

fixed mykso#3
@kbudde
Copy link
Member

kbudde commented Aug 19, 2023

New behaviour with #52

# 1. providing subset of configured and existing apps (good)
$ myks all envs/mykso/dev argocd,httpbingo
9:32AM INF Setting log level to: info
9:32AM INF [mykso-dev > httpbingo > sync] Synced
9:32AM INF [mykso-dev > httpbingo > helm] Helm chart rendered
9:32AM INF [mykso-dev > httpbingo > ytt] Local ytt rendered
9:32AM INF [mykso-dev > httpbingo > render] Completed
9:32AM INF [mykso-dev > argocd > sync] Synced
9:32AM INF [mykso-dev > argocd > ytt] Local ytt rendered
9:32AM INF [mykso-dev > argocd > render] Completed

# 2. foo is provided via commandline but not configured for the env -> Warn and go on
$ myks all envs/mykso/dev argocd,httpbingo,foo
9:32AM INF Setting log level to: info
9:32AM WRN [mykso-dev > init] Application not found app=foo dir=envs/mykso/dev
9:32AM INF [mykso-dev > httpbingo > sync] Synced
9:32AM INF [mykso-dev > httpbingo > helm] Helm chart rendered
9:32AM INF [mykso-dev > httpbingo > ytt] Local ytt rendered
9:32AM INF [mykso-dev > httpbingo > render] Completed
9:32AM INF [mykso-dev > argocd > sync] Synced
9:32AM INF [mykso-dev > argocd > ytt] Local ytt rendered
9:32AM INF [mykso-dev > argocd > render] Completed

# 3. application foobar is configured in env-data but does not exist -> FTL
$ myks all envs/mykso/dev
9:33AM INF Setting log level to: info
9:33AM ERR [mykso-dev > init] Unable to initialize applications error="unable to initialize application foobar for env envs/mykso/dev. Err application prototype does not exist"
9:33AM FTL Unable to initialize myks\'s globe error="unable to initialize application foobar for env envs/mykso/dev. Err application prototype does not exist"

# 3b.  application foobar is configured in env-data but does not exist and it is provided via commandline -> It justs warns.
# issue: at the time of evaluation it's not clear if the app exists for another environmen. See #4
$ myks all envs/mykso/dev foobar,argocd
9:34AM INF Setting log level to: info
9:34AM WRN [mykso-dev > init] Unable to initialize application error="application prototype does not exist" app=foobar dir=envs/mykso/dev
9:34AM INF [mykso-dev > argocd > sync] Synced
9:34AM INF [mykso-dev > argocd > ytt] Local ytt rendered
9:34AM INF [mykso-dev > argocd > render] Completed

#4 render two envs. Provide an application which only exists for one. missing app is ignored.
# actually at this stage it cannot be checked easily if the application exists for another env
$ myks all envs/mykso argocd,only-prod
9:35AM INF Setting log level to: info
9:35AM WRN [mykso-dev > init] Application not found app=only-prod dir=envs/mykso/dev
9:35AM INF [mykso-prod > only-prod > sync] Synced
9:35AM INF [mykso-prod > only-prod > helm] Helm chart rendered
9:35AM INF [mykso-prod > only-prod > ytt] Local ytt rendered
9:35AM INF [mykso-prod > only-prod > render] Completed
9:35AM INF [mykso-dev > argocd > sync] Synced
9:35AM INF [mykso-dev > argocd > ytt] Local ytt rendered
9:35AM INF [mykso-dev > argocd > render] Completed
9:35AM INF [mykso-prod > argocd > sync] Synced
9:35AM INF [mykso-prod > argocd > ytt] Local ytt rendered
9:35AM INF [mykso-prod > argocd > render] Completed

@Zebradil
Copy link
Member Author

Awesome, thanks a lot!

The logic does make sense to me. To improve it further, we would need either to restructure the internal logic to be able to perform the validation step after the init process but before the rendering process or to make logging less noisy (it'd be cool to have it done in a similar way to how it does docker-compose — with multiple parallel progress bars). But for now, I think it's already good enough.

@Zebradil
Copy link
Member Author

Solved with #52

mykso-bot added a commit that referenced this issue Sep 19, 2023
# [1.3.0](v1.2.0...v1.3.0) (2023-09-19)

### Bug Fixes

* Add documentation the myks sync step ([#38](#38)) ([e61a10c](e61a10c)), closes [#37](#37)
* apply smart mode logic only to supported commands ([#83](#83)) ([2bc754f](2bc754f))
* argocd source plugin config type in schema ([520156d](520156d))
* cleanup vendir folder ([#90](#90)) ([a20df1a](a20df1a))
* consistent behavior on rendering ALL applications ([#79](#79)) ([2aab516](2aab516))
* correct sources for the global-ytt rendering step ([#50](#50)) ([5a0e4d7](5a0e4d7))
* create myks data schema file on init and on every run ([#84](#84)) ([976291e](976291e))
* data values of prototype of argocd app ([b5d7ff9](b5d7ff9))
* do not fail on absent rendered directory ([eaf1202](eaf1202))
* do not fail without vendir configs ([2f73cda](2f73cda))
* do not override ArgoCD defaults set by user ([#74](#74)) ([f2cf4ce](f2cf4ce)), closes [#70](#70)
* **docker:** do not build arm64, it is not supported ([3971ae7](3971ae7))
* **docker:** specify full image tag ([f3222e5](f3222e5))
* formatting ([fd65f05](fd65f05))
* generate ArgoCD secret only if enabled ([4b3ed11](4b3ed11))
* helm value file merge ([#33](#33)) ([3c9c0ea](3c9c0ea)), closes [#32](#32)
* init Globe core attributes earlier ([#85](#85)) ([20c48fd](20c48fd))
* log errors during vendir sync ([5dc1b5e](5dc1b5e))
* make render errors appear in the log with full error message ([c325da2](c325da2))
* process map keys instead of values ([3b86a03](3b86a03))
* reduce usage of pointers to cope with race conditions ([#88](#88)) ([d734933](d734933))
* search in the default envs directory ([ef4a75e](ef4a75e))
* skip helm rendering ([80a8eb5](80a8eb5))
* **smart-mode:** detect changes when myks root is in subdirectory ([0522b67](0522b67))
* update data-schema.ytt.yaml according to the latest Myks changes ([5ef9d34](5ef9d34))
* use ArgoCD application path relatively to git root ([92f0617](92f0617))

### Features

* add a finalizer to ArgoCD project CR ([acf67fd](acf67fd))
* add argocd-apps prototype ([6772744](6772744))
* add arm binaries ([a74d63e](a74d63e))
* add common overlays example to assets ([39965c5](39965c5))
* add example environment configs ([8edba12](8edba12))
* add flag to control parallelism ([#40](#40)) ([144f5fd](144f5fd))
* add git branch detection and refactor data schema ([05e41d4](05e41d4))
* add init command and a data schema file ([c11c27a](c11c27a))
* add prototypes in the init command ([f31471e](f31471e))
* add step for rendering ytt packages ([#36](#36)) ([d1078c6](d1078c6))
* Add vendir authentication via environment ([b0c50c2](b0c50c2))
* Add vendir sync caching ([24ff41c](24ff41c))
* Added docker image ([ae8988d](ae8988d))
* Added Smart Mode that Automatically detects changed Environment… ([#62](#62)) ([e404b6b](e404b6b))
* always write data-schema file ([fa83bee](fa83bee))
* ArgoCD support ([#41](#41)) ([e45d585](e45d585))
* configure ArgoCD Application finalizers and source.plugin ([#56](#56)) ([80940aa](80940aa))
* create initial .myks.yaml and print configs ([#87](#87)) ([215ccd3](215ccd3))
* detect additional and missing applications ([#89](#89)) ([2c7e101](2c7e101))
* do not convert git URL protocol ([2823eb6](2823eb6))
* dump configuration as ytt values ([af65436](af65436))
* fail on non existing apps ([#52](#52)) ([87aafa3](87aafa3)), closes [#3](#3)
* fine-grained ArgoCD project destination ([04d3b78](04d3b78))
* get git repo URL ([c9b726a](c9b726a))
* **helm:** add support for helm capabilities ([#48](#48)) ([1a13ee1](1a13ee1)), closes [#31](#31)
* **init:** allow overwriting of data ([#49](#49)) ([f3f5983](f3f5983))
* provide argocd-specific configuration with prototypes ([06e5e5c](06e5e5c))
* provide example default values for all environments ([0f9cab6](0f9cab6))
* Push images to docker hub and ghcr ([#65](#65)) ([10bdc63](10bdc63))
* Refactoring to make log output more intelligible. ([#39](#39)) ([71cd34c](71cd34c))
* **smart-mode:** configuration option for smart-mode base revision ([#95](#95)) ([4400184](4400184))
* **smart-mode:** precisely select envs and apps for processing ([#96](#96)) ([ffb47ad](ffb47ad))
* support multiple content items in vendir configs ([#92](#92)) ([fc50be0](fc50be0))
* tweak prefix logic on argo cr to allow for project names like "… ([#72](#72)) ([af01180](af01180))
* validate root directory ([f81b719](f81b719))
* vendir sync caching ([7279cc7](7279cc7))

### Performance Improvements

* **docker:** ignore not needed files ([3479804](3479804))
mykso-bot added a commit that referenced this issue Sep 19, 2023
# [2.0.0](v1.2.0...v2.0.0) (2023-09-19)

### Bug Fixes

* Add documentation the myks sync step ([#38](#38)) ([e61a10c](e61a10c)), closes [#37](#37)
* apply smart mode logic only to supported commands ([#83](#83)) ([2bc754f](2bc754f))
* argocd source plugin config type in schema ([520156d](520156d))
* cleanup vendir folder ([#90](#90)) ([a20df1a](a20df1a))
* consistent behavior on rendering ALL applications ([#79](#79)) ([2aab516](2aab516))
* correct sources for the global-ytt rendering step ([#50](#50)) ([5a0e4d7](5a0e4d7))
* create myks data schema file on init and on every run ([#84](#84)) ([976291e](976291e))
* data values of prototype of argocd app ([b5d7ff9](b5d7ff9))
* do not fail on absent rendered directory ([eaf1202](eaf1202))
* do not fail without vendir configs ([2f73cda](2f73cda))
* do not override ArgoCD defaults set by user ([#74](#74)) ([f2cf4ce](f2cf4ce)), closes [#70](#70)
* **docker:** do not build arm64, it is not supported ([3971ae7](3971ae7))
* **docker:** specify full image tag ([f3222e5](f3222e5))
* formatting ([fd65f05](fd65f05))
* generate ArgoCD secret only if enabled ([4b3ed11](4b3ed11))
* helm value file merge ([#33](#33)) ([3c9c0ea](3c9c0ea)), closes [#32](#32)
* init Globe core attributes earlier ([#85](#85)) ([20c48fd](20c48fd))
* log errors during vendir sync ([5dc1b5e](5dc1b5e))
* make render errors appear in the log with full error message ([c325da2](c325da2))
* process map keys instead of values ([3b86a03](3b86a03))
* reduce usage of pointers to cope with race conditions ([#88](#88)) ([d734933](d734933))
* search in the default envs directory ([ef4a75e](ef4a75e))
* skip helm rendering ([80a8eb5](80a8eb5))
* **smart-mode:** detect changes when myks root is in subdirectory ([0522b67](0522b67))
* update data-schema.ytt.yaml according to the latest Myks changes ([5ef9d34](5ef9d34))
* use ArgoCD application path relatively to git root ([92f0617](92f0617))

### Features

* add a finalizer to ArgoCD project CR ([acf67fd](acf67fd))
* add argocd-apps prototype ([6772744](6772744))
* add arm binaries ([a74d63e](a74d63e))
* add common overlays example to assets ([39965c5](39965c5))
* add example environment configs ([8edba12](8edba12))
* add flag to control parallelism ([#40](#40)) ([144f5fd](144f5fd))
* add git branch detection and refactor data schema ([05e41d4](05e41d4))
* add init command and a data schema file ([c11c27a](c11c27a))
* add prototypes in the init command ([f31471e](f31471e))
* add step for rendering ytt packages ([#36](#36)) ([d1078c6](d1078c6))
* Add vendir authentication via environment ([b0c50c2](b0c50c2))
* Add vendir sync caching ([24ff41c](24ff41c))
* Added docker image ([ae8988d](ae8988d))
* Added Smart Mode that Automatically detects changed Environment… ([#62](#62)) ([e404b6b](e404b6b))
* always write data-schema file ([fa83bee](fa83bee))
* ArgoCD support ([#41](#41)) ([e45d585](e45d585))
* configure ArgoCD Application finalizers and source.plugin ([#56](#56)) ([80940aa](80940aa))
* create initial .myks.yaml and print configs ([#87](#87)) ([215ccd3](215ccd3))
* detect additional and missing applications ([#89](#89)) ([2c7e101](2c7e101))
* do not convert git URL protocol ([2823eb6](2823eb6))
* dump configuration as ytt values ([af65436](af65436))
* fail on non existing apps ([#52](#52)) ([87aafa3](87aafa3)), closes [#3](#3)
* fine-grained ArgoCD project destination ([04d3b78](04d3b78))
* get git repo URL ([c9b726a](c9b726a))
* **helm:** add support for helm capabilities ([#48](#48)) ([1a13ee1](1a13ee1)), closes [#31](#31)
* **init:** allow overwriting of data ([#49](#49)) ([f3f5983](f3f5983))
* provide argocd-specific configuration with prototypes ([06e5e5c](06e5e5c))
* provide example default values for all environments ([0f9cab6](0f9cab6))
* Push images to docker hub and ghcr ([#65](#65)) ([10bdc63](10bdc63))
* Refactoring to make log output more intelligible. ([#39](#39)) ([71cd34c](71cd34c))
* release 2.0 ([b7b486d](b7b486d))
* **smart-mode:** configuration option for smart-mode base revision ([#95](#95)) ([4400184](4400184))
* **smart-mode:** precisely select envs and apps for processing ([#96](#96)) ([ffb47ad](ffb47ad))
* support multiple content items in vendir configs ([#92](#92)) ([fc50be0](fc50be0))
* tweak prefix logic on argo cr to allow for project names like "… ([#72](#72)) ([af01180](af01180))
* validate root directory ([f81b719](f81b719))
* vendir sync caching ([7279cc7](7279cc7))

### Performance Improvements

* **docker:** ignore not needed files ([3479804](3479804))

### BREAKING CHANGES

* release 2.0
This is an empty commit to trigger a major release.
mykso-bot added a commit that referenced this issue Sep 19, 2023
# [2.0.0](v1.2.0...v2.0.0) (2023-09-19)

### Bug Fixes

* Add documentation the myks sync step ([#38](#38)) ([e61a10c](e61a10c)), closes [#37](#37)
* apply smart mode logic only to supported commands ([#83](#83)) ([2bc754f](2bc754f))
* argocd source plugin config type in schema ([520156d](520156d))
* cleanup vendir folder ([#90](#90)) ([a20df1a](a20df1a))
* consistent behavior on rendering ALL applications ([#79](#79)) ([2aab516](2aab516))
* correct sources for the global-ytt rendering step ([#50](#50)) ([5a0e4d7](5a0e4d7))
* create myks data schema file on init and on every run ([#84](#84)) ([976291e](976291e))
* data values of prototype of argocd app ([b5d7ff9](b5d7ff9))
* do not fail on absent rendered directory ([eaf1202](eaf1202))
* do not fail without vendir configs ([2f73cda](2f73cda))
* do not override ArgoCD defaults set by user ([#74](#74)) ([f2cf4ce](f2cf4ce)), closes [#70](#70)
* **docker:** do not build arm64, it is not supported ([3971ae7](3971ae7))
* **docker:** specify full image tag ([f3222e5](f3222e5))
* formatting ([fd65f05](fd65f05))
* generate ArgoCD secret only if enabled ([4b3ed11](4b3ed11))
* helm value file merge ([#33](#33)) ([3c9c0ea](3c9c0ea)), closes [#32](#32)
* init Globe core attributes earlier ([#85](#85)) ([20c48fd](20c48fd))
* log errors during vendir sync ([5dc1b5e](5dc1b5e))
* make render errors appear in the log with full error message ([c325da2](c325da2))
* process map keys instead of values ([3b86a03](3b86a03))
* reduce usage of pointers to cope with race conditions ([#88](#88)) ([d734933](d734933))
* search in the default envs directory ([ef4a75e](ef4a75e))
* skip helm rendering ([80a8eb5](80a8eb5))
* **smart-mode:** detect changes when myks root is in subdirectory ([0522b67](0522b67))
* update data-schema.ytt.yaml according to the latest Myks changes ([5ef9d34](5ef9d34))
* use ArgoCD application path relatively to git root ([92f0617](92f0617))

### Features

* add a finalizer to ArgoCD project CR ([acf67fd](acf67fd))
* add argocd-apps prototype ([6772744](6772744))
* add arm binaries ([a74d63e](a74d63e))
* add common overlays example to assets ([39965c5](39965c5))
* add example environment configs ([8edba12](8edba12))
* add flag to control parallelism ([#40](#40)) ([144f5fd](144f5fd))
* add git branch detection and refactor data schema ([05e41d4](05e41d4))
* add init command and a data schema file ([c11c27a](c11c27a))
* add prototypes in the init command ([f31471e](f31471e))
* add step for rendering ytt packages ([#36](#36)) ([d1078c6](d1078c6))
* Add vendir authentication via environment ([b0c50c2](b0c50c2))
* Add vendir sync caching ([24ff41c](24ff41c))
* Added docker image ([ae8988d](ae8988d))
* Added Smart Mode that Automatically detects changed Environment… ([#62](#62)) ([e404b6b](e404b6b))
* always write data-schema file ([fa83bee](fa83bee))
* ArgoCD support ([#41](#41)) ([e45d585](e45d585))
* configure ArgoCD Application finalizers and source.plugin ([#56](#56)) ([80940aa](80940aa))
* create initial .myks.yaml and print configs ([#87](#87)) ([215ccd3](215ccd3))
* detect additional and missing applications ([#89](#89)) ([2c7e101](2c7e101))
* do not convert git URL protocol ([2823eb6](2823eb6))
* dump configuration as ytt values ([af65436](af65436))
* fail on non existing apps ([#52](#52)) ([87aafa3](87aafa3)), closes [#3](#3)
* fine-grained ArgoCD project destination ([04d3b78](04d3b78))
* get git repo URL ([c9b726a](c9b726a))
* **helm:** add support for helm capabilities ([#48](#48)) ([1a13ee1](1a13ee1)), closes [#31](#31)
* **init:** allow overwriting of data ([#49](#49)) ([f3f5983](f3f5983))
* provide argocd-specific configuration with prototypes ([06e5e5c](06e5e5c))
* provide example default values for all environments ([0f9cab6](0f9cab6))
* Push images to docker hub and ghcr ([#65](#65)) ([10bdc63](10bdc63))
* Refactoring to make log output more intelligible. ([#39](#39)) ([71cd34c](71cd34c))
* release 2.0 ([b7b486d](b7b486d))
* **smart-mode:** configuration option for smart-mode base revision ([#95](#95)) ([4400184](4400184))
* **smart-mode:** precisely select envs and apps for processing ([#96](#96)) ([ffb47ad](ffb47ad))
* support multiple content items in vendir configs ([#92](#92)) ([fc50be0](fc50be0))
* tweak prefix logic on argo cr to allow for project names like "… ([#72](#72)) ([af01180](af01180))
* validate root directory ([f81b719](f81b719))
* vendir sync caching ([7279cc7](7279cc7))

### Performance Improvements

* **docker:** ignore not needed files ([3479804](3479804))

### BREAKING CHANGES

* release 2.0
This is an empty commit to trigger a major release.
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
Development

No branches or pull requests

2 participants