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

Added support for mounting EmptyDir volume type #1679

Merged
merged 4 commits into from
Jun 24, 2022

Conversation

vyasgun
Copy link
Contributor

@vyasgun vyasgun commented May 30, 2022

Description

Added support for mounting EmptyDir volume type

Changes

  • Added parsing for emptyDir volume type, medium type, and size limit

Reference

Fixes #1633

Release Note

Add support for mounting EmptyDir volumes

Copy link

@knative-prow knative-prow bot left a comment

Choose a reason for hiding this comment

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

@vyasgun: 0 warnings.

In response to this:

Description

Added support for mounting EmptyDir volume type

Changes

  • Added parsing for emptyDir volume type, medium type, and size limit

Reference

Fixes #1633

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow knative-prow bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 30, 2022
@codecov
Copy link

codecov bot commented May 30, 2022

Codecov Report

Merging #1679 (b692085) into main (94a5352) will increase coverage by 0.19%.
The diff coverage is 67.50%.

@@            Coverage Diff             @@
##             main    #1679      +/-   ##
==========================================
+ Coverage   79.49%   79.69%   +0.19%     
==========================================
  Files         171      173       +2     
  Lines       12969    13264     +295     
==========================================
+ Hits        10310    10571     +261     
- Misses       1941     1963      +22     
- Partials      718      730      +12     
Impacted Files Coverage Δ
pkg/kn/flags/podspec_helper.go 81.87% <65.17%> (-0.56%) ⬇️
pkg/kn/flags/podspec.go 77.68% <100.00%> (+0.17%) ⬆️
pkg/kn/commands/broker/create.go 69.64% <0.00%> (-1.41%) ⬇️
pkg/kn/commands/broker/broker.go 100.00% <0.00%> (ø)
pkg/kn/commands/broker/update.go 86.36% <0.00%> (ø)
pkg/kn/commands/broker/delivery_option_flags.go 100.00% <0.00%> (ø)
pkg/eventing/v1/client_mock.go 92.75% <0.00%> (+0.81%) ⬆️
pkg/eventing/v1/client.go 91.00% <0.00%> (+3.73%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94a5352...b692085. Read the comment docs.

@dsimansk
Copy link
Contributor

dsimansk commented May 31, 2022

I think with the current approach the PR is mixing --mount and --volume flag functionality. Moreover what about more simplistic approach would be better for emptyDir. I'd expect most usage is with default emptyDir: {}. We don't necessarily need to cover Medium and SizeLimit parameters at first.

However, if the decision is to have those detailed settings. Any additional parameters should be parsed in --volume flag.

My suggestion for handling:

  • Use of --mount /path=ed:myEmptyVol results in:
    • Creation of volume stanza with default config {}
    • Similarly to the following When a configmap or a secret is specified, a corresponding volume is automatically generated.
volumes:
  - name: myEmptyVol    
    emptyDir: {}

@dsimansk
Copy link
Contributor

/retest

@vyasgun
Copy link
Contributor Author

vyasgun commented Jun 6, 2022

@dsimansk Thanks for the review. The memory and size limit syntax is according to #1633 (comment). I will add the additional functionality to the --volume flag and simplify --mount .

@dsimansk
Copy link
Contributor

dsimansk commented Jun 8, 2022

@dsimansk Thanks for the review. The memory and size limit syntax is according to #1633 (comment). I will add the additional functionality to the --volume flag and simplify --mount .

OK, I see. :) It still feels like too granular option to my taste. However, let's have it in --volume flag. That should be fine.

@dsimansk
Copy link
Contributor

@vyasgun there's one issue with current volume creation that I've stumped upon. By default we enforce readOnly: true, that's probably good and desired for ConfigMaps and Secrets. However, it'll be problematic for empty dir and PVC since those might be very well expected to have write access.

https://github.com/knative/client/blob/main/pkg/kn/flags/podspec_helper.go#L504

@dsimansk
Copy link
Contributor

/approve
/lgtm

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jun 24, 2022
@knative-prow
Copy link

knative-prow bot commented Jun 24, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dsimansk, vyasgun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 24, 2022
@knative-prow knative-prow bot merged commit b696546 into knative:main Jun 24, 2022
@dsimansk
Copy link
Contributor

/kind feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature New feature or request lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for different volume types
2 participants