-
Notifications
You must be signed in to change notification settings - Fork 115
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
Replace PersistentVolume if volume source changes #1015
Conversation
Add replacement cases for PersistentVolume to the diff logic. All PersistentVolumeSource fields are immutable.
@@ -78,6 +78,31 @@ var forceNew = _groups{ | |||
var core = _versions{ | |||
"v1": _kinds{ | |||
"ConfigMap": properties{".binaryData", ".data"}, | |||
"PersistentVolume": append( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's link the volume types doc.
Any chance we can programmatically pull this list from the API?
e.g.
kubectl explain pod.spec.volumes
shows all volume types so it seems like API's should be possible. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pulled this info from the API reference, but am not sure of a reliable way to do so programmatically. I included everything that had a Kind name ending in VolumeSource
, but these Kinds don't seem to share a common interface.
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#volume-v1-core
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of reflect in Go due to its perf cost, but is it worth considering asserting the various interfaces to approach this programmatically. Is this viable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the rest of this file is also manually curated for now, I'm inclined to defer further work here. We need to figure out a more robust approach at some point, but that's probably going to involve upstream work to fix the k8s OpenAPI spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposed changes
Add replacement cases for PersistentVolume to the diff
logic. All PersistentVolumeSource fields are immutable.
Related issues (optional)
Fixes #1014