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 read only mount support #41

Merged
merged 3 commits into from
Jun 4, 2023

Conversation

JackFlukinger
Copy link

No description provided.

@JackFlukinger
Copy link
Author

Hey @tehcyx, anything else I need to do for this PR? Really appreciate your work on this provider!

@tehcyx
Copy link
Owner

tehcyx commented Jun 4, 2023

Hi @JackFlukinger, no you're good. Just haven't gotten around testing this. Doing that now, as well as running tests on the PR.

@JackFlukinger
Copy link
Author

JackFlukinger commented Jun 4, 2023

Ah, I do see one small problem now that I look back. Oops! Fixing & committing now

@tehcyx
Copy link
Owner

tehcyx commented Jun 4, 2023

So what I found is, that we should change the function like this:

func kindConfigNodeMountFields() map[string]*schema.Schema {
	s := map[string]*schema.Schema{
		"host_path": {
			Type:     schema.TypeString,
			Optional: true,
		},
		"container_path": {
			Type:     schema.TypeString,
			Optional: true,
		},
		"propagation": {
			Type:     schema.TypeString,
			Optional: true,
		},
		"readonly": {
			Type:     schema.TypeBool,
			Optional: true,
		},
		"selinux_relabel": {
			Type:     schema.TypeBool,
			Optional: true,
		},
	}
	return s
}

Since we already have the mapping done:
https://github.com/tehcyx/terraform-provider-kind/blob/master/kind/structure_kind_config.go#L186-L219

edit: Actually you uncovered that I missed adding three options here to the mapping.

@JackFlukinger
Copy link
Author

Yeah, I just saw that, I think read_only is more idiomatic. I'll add propagation & selinux_relable real quick

@tehcyx
Copy link
Owner

tehcyx commented Jun 4, 2023

Yeah, I just saw that, I think read_only is more idiomatic. I'll add propagation & selinux_relable real quick

True. Thanks for adding the other two.

@JackFlukinger
Copy link
Author

Cool, done, let me know if that looks all good to you :)

@tehcyx
Copy link
Owner

tehcyx commented Jun 4, 2023

Cool, done, let me know if that looks all good to you :)

Testing, then probably merging if nothing pops up.

@tehcyx tehcyx merged commit b90448f into tehcyx:master Jun 4, 2023
@JackFlukinger JackFlukinger deleted the readonly_mount_support branch June 4, 2023 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants