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

Fix storage backend ID for TypeInstance from nested workflow #706

Merged
merged 3 commits into from
May 4, 2022

Conversation

mkuziemko
Copy link

@mkuziemko mkuziemko commented Apr 20, 2022

Description

Changes proposed in this pull request:

  • fix storage backend ID for TypeInstance from nested workflow

There was incorrect backend mapping - we find it by the name of output Type Instance relation which is ok where there is no nested workflow. In the nested workflow, we need to find it by the name of the artifact.

Testing

  1. Checkout this PR
  2. Create cluster using DISABLE_MONITORING_INSTALLATION=true USE_TEST_SETUP=true make dev-cluster
  3. Change manifests source to my branch with no backend for psql:
kubectl set env deploy/capact-hub-public -n capact-system -c hub-public-populator MANIFESTS_SOURCES="github.com/mkuziemko/hub-manifests?ref=lost_bid"
  1. Install Helm Storage and Mattermost
  2. Verify uploaded TypeInstaces.

Related issue(s)

@mkuziemko mkuziemko added bug Something isn't working area/engine Relates to Engine labels Apr 20, 2022
@mszostok mszostok self-assigned this Apr 23, 2022
@mszostok
Copy link
Member

I saw you branch with manifests changes, unfortunately it doesn't cover the whole story. Here is a valid fix to our manifests: https://github.com/capactio/hub-manifests/compare/main...mszostok:test-706?expand=1

I tested that with your change, and unfortunately I got such error:

Cannot render given action: while rendering Action: while adding TypeInstances to graph: while resolving backend ID for "mattermost-install-install-db-postgres-install-helm-install-helm-release": cannot find backend storage for specified "helm-release-storage" alias (will retry - 13/15) 

Please let me know if you need more info about my setup.

@mkuziemko
Copy link
Author

Good point 👍

We don't need the alias for these manifests as we don't use it in the main workflow. I updated my fork.

The above error was caused by:

typeInstancesBackends, err := r.policyEnforcedCli.ListTypeInstancesBackendsBasedOnPolicy(ctx, rootimpl.Rule, rootimpl.Revision)

In the rendering we are checking if we have:

if step.CapactAction != nil {

based on which we are searching implementation and rules but for the looking of the backends, we passed always the ,,root" implementation which does not work for nested workflows.

Thus, when you removed the aliases from the Mattermost manifests, it couldn't resolve the backend.

Anyway, I verified it one more time installing Postgres and then the Mattermost, and it works.

@@ -0,0 +1,165 @@
---
Copy link
Author

Choose a reason for hiding this comment

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

I took the newest manifests and add a v2 prefix. I created issue to mitigate/track this problem.

Copy link
Member

@mszostok mszostok left a comment

Choose a reason for hiding this comment

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

I tested single psql and mattermost + psql. Both work as expected. Good job 🚀

Please submit a PR with manifest fixes too.

@mkuziemko mkuziemko merged commit dd61711 into capactio:main May 4, 2022
@mkuziemko mkuziemko deleted the lost_backend branch May 4, 2022 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/engine Relates to Engine bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants