-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
PreSync hooks failing due to missing namespace even though CreateNamespace=true is set #4753
Comments
I tried the following steps and could not reproduce it.
|
@mayzhang2000 thank you for looking into this. I tried your code with our local installation and I still see the problem. If I'm reading the log correctly ArgoCD's order of execution is Secret -> Namespace -> Pod and this fails in the first step because the namespace doesn't exist yet. If I create the namespace beforehand it says So what is the difference between your installation and mine? I'll upgrade to Full logs showing the problem (creating the app with
|
I can also reproduce the problem with
Version info (I only upgraded the server components):
|
@elemental-lf I think this is because your resources actually contain a
I think the |
@mayzhang2000 Is this behaviour intended? I think it would make sense to auto-create the name space despite there being a dedicated |
@jannfis I used the example by mayzhang2000 as is and there is no dedicated Namespace resource in it. There is just a Pod and a Secret resource. |
@mayzhang2000 I just tried with current master (commit hash 9ee0d2c) and the problem does not occur there. And I'd guess that this PR is the reason: argoproj/gitops-engine#159. EDIT: Fix was introduced into ArgoCD via #4563. |
@elemental-lf Ah, yeah, you're right. Thanks. Behaviour has changed with the PRs you linked. They will be part of v1.8. @mayzhang2000 Please ignore my previous comment then. :) |
Is it ok for you to close this issue then, @elemental-lf ? |
Yes, thak you! |
Checklist:
argocd version
.Describe the bug
I've observed that
PreSync
hooks are failing if the namespace doesn't exist even thoughCreateNamespace=true
is set. In the case described below synchronization of the application fails in aPreSync
hook with an error message ofnamespaces "beta" not found
.If I create the namespace in question the execution of the hooks proceeds.
This bug is actually in https://github.com/argoproj/gitops-engine/ but I wasn't sure if I should open the issue here or there.
To Reproduce
I'm trying to install a Helm chart which includes some resources with the
helm.sh/hook: pre-install,pre-upgrade
annotation set:The namespace doesn't exist but the application has
CreateNamespace=true
set and some other synchronization options set:Expected behavior
ArgoCD should create the namespace before running
PreSync
hooks.Version
Logs
The text was updated successfully, but these errors were encountered: