Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Conversation

@lcnuance
Copy link

Proof of concept adding support for DaemonSets, StatefulSets. It also uses patch instead of Update, hence reducing problems introduced by different api versions trying to change the contents of the resource.

@lcnuance lcnuance changed the title Proof of concept adding support for DaemonSets, StatefulSets Adding support for DaemonSets, StatefulSets Mar 23, 2018
glog.Infof("About to run patch: %s %s with %s", objectKind, objectId, yamlPatch)
attemptDelay := 30
for attempt := 1; attempt < 3; attempt++ {
err := exec.Command("/kubectl", "patch", objectKind, objectId, "--patch", yamlPatch).Run()
Copy link

Choose a reason for hiding this comment

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

Is running kubectl in a subprocess the only way? Doesn't the Go client support patching operations?

Copy link
Author

Choose a reason for hiding this comment

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

Not the only way. The client doesn't do patches well (Update replaces the content, not only patches and this yields to raise conditions). I didn't find any way through the client but any ideas welcome. The only other way I thought about was to use the rest api directly (http requests to the rest api). We could do that too and change the implementation of that function.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants