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

salt-ssh cannot load pillar if a volume already exists on this specific node #3564

Closed
TeddyAndrieux opened this issue Oct 11, 2021 · 0 comments
Assignees
Labels
complexity:easy Something that requires less than a day to fix kind:bug Something isn't working priority:high High priority issues, should be worked on ASAP (after urgent issues), not postponed topic:salt Everything related to SaltStack in our product

Comments

@TeddyAndrieux
Copy link
Collaborator

Component:

'salt'

What happened:

If you try to run a salt-ssh state on a node that has some volumes deployed on it (it's the case when you try to restore bootstrap node for example) it fails

TypeError encountered executing state.sls: Object of type 'datetime' is not JSON serializable

It's due to a time in storage classes metadata:managed_fields.

What was expected:

Working salt-ssh even if you have some volumes

Steps to reproduce

  • Have a multi-node cluster with some volumes
  • Try to run a state with salt-ssh on a node that has some volumes
  • 💥

Resolution proposal (optional):

As we do for other timestamps In storage classes, convert this time to str in our custom pillar


NOTE: It's an issue on MetalK8s 2.10 but may not be an issue with the latest 2.11 as we changed the way to interact with Kubernetes API

@TeddyAndrieux TeddyAndrieux added kind:bug Something isn't working complexity:easy Something that requires less than a day to fix priority:high High priority issues, should be worked on ASAP (after urgent issues), not postponed topic:salt Everything related to SaltStack in our product labels Oct 11, 2021
@TeddyAndrieux TeddyAndrieux added this to the MetalK8s 2.10.4 milestone Oct 11, 2021
@TeddyAndrieux TeddyAndrieux self-assigned this Oct 11, 2021
TeddyAndrieux added a commit that referenced this issue Oct 12, 2021
We store volumes and storage classes in the salt pillar that contains
some `datetime` python object and `datetime` object cannot be rendered
to json using "classic" `json.dump`.
Which mean that salt-ssh command that rely on the pillar (like salt
states) crash if some volume are deployed on the target node

Fixes: #3564
TeddyAndrieux added a commit that referenced this issue Oct 12, 2021
We store volumes and storage classes in the salt pillar that contains
some `datetime` python objects and `datetime` objects cannot be rendered
to json using "classic" `json.dump`.
This means that salt-ssh command that relies on the pillar (like salt
states) crash if some volume is deployed on the target node

Fixes: #3564
@bert-e bert-e closed this as completed in 8cb111c Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity:easy Something that requires less than a day to fix kind:bug Something isn't working priority:high High priority issues, should be worked on ASAP (after urgent issues), not postponed topic:salt Everything related to SaltStack in our product
Projects
None yet
Development

No branches or pull requests

1 participant