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

BUG: deploying kustomizationRefs fails when resources are not ordered correctly #568

Closed
rbjorklin opened this issue May 29, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@rbjorklin
Copy link

rbjorklin commented May 29, 2024

First of all: big thanks for fixing #565! That enabled me to get a bit further!

Problem Description

My deployment is now failing with the following error:

Status:
  Dependencies:  All dependencies deployed
  Feature Summaries:
    Failure Message:    no matches for kind "Alertmanager" in version "monitoring.coreos.com/v1"
    Feature ID:         Kustomize
    Hash:               Xs9cDng9DO19cmZTInB4AqQLVuI+6Z3EYaOd6HF1TUo=
    Last Applied Time:  2024-05-29T01:06:52Z
    Status:             Provisioning
Events:                 <none>

This error presents itself as the Alertmanager appears before the corresponding CRD in my kustomization.yaml file. I managed to work around this by patching the ksort kubectl plugin but expecting everyone who uses Kustomize to sort their list of resources seems a bit inconvenient. Is there a way the apply could continue with the next resource in the list allowing the state to eventually reconcile?

System Information

CLUSTERAPI VERSION: v1.7.2
SVELTOS VERSION: 0.31.0
KUBERNETES VERSION: 1.30.1

@rbjorklin rbjorklin added the bug Something isn't working label May 29, 2024
@gianlucam76
Copy link
Member

gianlucam76 commented May 29, 2024

Thanks @rbjorklin

That might have unintended consequences. I looked at the helm you started from, and there CRDs are listed before anything else.

Sveltos essentially tries in the order resources are provided to it and stop when there is an error.

Would you mind changing this from bug (as of today that is the expected behaviour) to feature request? I am thinking on adding "ContinueOnError" field. That would be false by default (so on error Sveltos would stop), but if true Sveltos will continue to next resource.

It will then probably come in v0.32.0. Thank you again for reporting issues and enhancement requests!

@rbjorklin
Copy link
Author

rbjorklin commented May 29, 2024

Ah. I guess because I split each resource into its own file I have brought this problem onto myself...

My workflow is as follows:

  • helm template a chart and split the resources into individual files with the slice plugin.
  • Assemble kustomization.yaml with kustomize create --autodetect

I guess my issue should instead be reported against the kustomize project and the sorting happen as a part of the --autodetect behaviour.

I'm okay with this outcome however if you still want to continue the conversation I think you as a repo owner can convert a GH issue to a discussion. If you don't care to go down this rabbit hole please just go ahead and close this when you see it.

Thanks for your time @gianlucam76! ❤️

@gianlucam76
Copy link
Member

Thank you. For now I will close this (as it is current expected behaviour) and open a Poll.

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