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

Add "validate" diff strategy #538

Merged
merged 1 commit into from
Jun 3, 2021

Conversation

julienduchesne
Copy link
Member

Fixes #332

In the "validate" mode, diff will be called an additional time with "--server-side"
The reason why it's called an additional time is because this argument will add server-only attributes to the diff such as "last-applied-configuration", users probably don't want to see these since they will change on every run
By adding a second diff call that's only use to find errors, we keep the same diff as before but we add an extra validation

Let me know if you think that this solution is adequate. I left the existing "native" mode as the default

I also didn't add any tests, some guidance would be appreciated here. I might be mistaken but there doesn't seem to be any tests around Kubernetes.client.diff, is this because it meant to stay without any logic?

In this mode, diff will be called an additional time with "--server-side"
The reason why it's called an additional time is because this argument will add server-only attributes to the diff such as "last-applied-configuration"

By adding a second diff call that's only use to find errors, we keep the same diff as before but we add an extra validation

Let me know if you think that this solution is adequate. I left the existing "native" mode as the default
Copy link
Member

@Duologic Duologic left a comment

Choose a reason for hiding this comment

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

This is probably fine as it doesn't change the default behavior, we can test it out and consider it default later on.

@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 2, 2021
@Duologic Duologic removed the stale label Jun 2, 2021
@julienduchesne julienduchesne merged commit 60775d3 into grafana:main Jun 3, 2021
@julienduchesne julienduchesne deleted the validate-on-diff branch June 3, 2021 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validation only happens on apply
2 participants