Fix the re-apply system#84
Conversation
| glog.Errorf("Cannot apply manifests in %s", r.env.GetManifestsPathToApply()) | ||
| continue | ||
| } | ||
| r.state.SetKubectlApplied() |
There was a problem hiding this comment.
Why don't we run a r.UnsetKubectlApplied()
// UnsetKubectlApplied mark the state when kubectl reset successfully returned
func (s *State) UnsetKubectlApplied() {
s.Lock()
s.kubectlApplied = false
s.Unlock()
}
around: https://github.com/DataDog/pupernetes/blob/master/pkg/run/delete.go#L322 ?
There was a problem hiding this comment.
We would need more code about the namespace no?
There was a problem hiding this comment.
yes, for sure - I just want to make sure resetting allows for a fresh start and thus one could reset the state 2, 3, N times in a row with no issues.
There was a problem hiding this comment.
The reset capability is managed by a dedicated channel, so I think it's safe and simple to let it like that and this restore the previous logic.
Then, it's not that bad if we apply when not needed because the kubectl apply is idempotent, this is safe.
Today we only have some resources in the kube-system namespace, but we could have something else in an another namespace. It let to the user a way to configure it as it suits him.
What does this PR do?
After #73, I introduced a regression when using
pupernetes reset $ns --applyorSIGSTP.The
re-applyfeature doesn't work anymore.To avoid this kind of regression I added a test in the CI.
Additional Notes
This should be short released on
v0.6.1.