-
Notifications
You must be signed in to change notification settings - Fork 985
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
r/pod: Fix a crash caused by wrong field name (config map volume source) #19
Conversation
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.
Commented on a couple of things around how the default_mode
field is stored in HCL - but otherwise LGTM :)
resource.TestCheckResourceAttr("kubernetes_pod.test", "spec.0.container.0.volume_mount.0.sub_path", ""), | ||
resource.TestCheckResourceAttr("kubernetes_pod.test", "spec.0.volume.0.name", "cfg"), | ||
resource.TestCheckResourceAttr("kubernetes_pod.test", "spec.0.volume.0.config_map.0.name", cfgMap), | ||
resource.TestCheckResourceAttr("kubernetes_pod.test", "spec.0.volume.0.config_map.0.default_mode", "511"), // 0777 in decimal |
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.
as discussed on Slack, I could see this causing confusion - would it be worth making this a type String instead until we've better options?
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.
As discussed on Slack - I generally agree that this is confusing.
I’m just not sure it’s worth implementing a dirty solution (TypeString
) which may require state migration + config change once we implement the right solution.
I’ll take a look into the schema internals and see how hard it would be to implement IntRepresentation
into the schema. Then if we do it would be just a matter of adding a single line to the existing schema, which seems much cleaner.
name = "cfg" | ||
config_map { | ||
name = "${kubernetes_config_map.test.metadata.0.name}" | ||
default_mode = 0777 |
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.
might be worth adding some validation to this to the schema too?
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.
Agreed, I'll add validation.
5a04ca3
to
92965c0
Compare
Fixes #18
This affects both
kubernetes_pod
andkubernetes_replication_controller
as they share part of the schema and related helper functions (which includes the one we're fixing here).Test results