-
Notifications
You must be signed in to change notification settings - Fork 261
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 subpath functionality to --mount flag #1655
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.
@vyasgun: 1 warning.
In response to this:
Description
User can now specify subpath of a volume to be mounted using the
--mount
flaggvyas-mac:client gvyas$ ./kn service update hello-example-2 --image gcr.io/knative-samples/helloworld-go --mount /mydir2=cm:cm1/xyzzz/jhg --mount /etc/mydir3=sc:my-sec Updating Service 'hello-example-2' in namespace 'default': 0.053s The Configuration is still working to reflect the latest desired specification. 4.387s Traffic is not yet migrated to the latest revision. 4.428s Ingress has not yet been reconciled. 4.488s Waiting for load balancer to be ready 4.659s Ready to serve. Service 'hello-example-2' updated to latest revision 'hello-example-2-00005' is available at URL: http://hello-example-2.default.10.111.180.117.sslip.io
gvyas-mac:client gvyas$ kubectl get pod hello-example-2-00005-deployment-746c9959-dwtbh -o json | jq -r '.spec.containers[0].volumeMounts' [ { "mountPath": "/mydir", "name": "myvol", "readOnly": true, "subPath": "abc/xyz" }, { "mountPath": "/mydir2", "name": "mydir2-e1669d63", "readOnly": true, "subPath": "xyzzz/jhg" }, { "mountPath": "/etc/mydir3", "name": "etc-mydir3-cc5ae7ae", "readOnly": true }, { "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount", "name": "kube-api-access-t9kks", "readOnly": true } ]
Changes
- Modified
--mount
flag so it can process subpaths in volumes- To be added: unit tests
Reference
Fixes #
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.
@@ -38,6 +38,11 @@ const ( | |||
PortFormatErr = "the port specification '%s' is not valid. Please provide in the format 'NAME:PORT', where 'NAME' is optional. Examples: '--port h2c:8080' , '--port 8080'." | |||
) | |||
|
|||
type MountInfo struct { |
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.
Golint comments: exported type MountInfo should have comment or be unexported. More info.
Codecov Report
@@ Coverage Diff @@
## main #1655 +/- ##
==========================================
+ Coverage 79.32% 79.48% +0.16%
==========================================
Files 171 171
Lines 12939 12963 +24
==========================================
+ Hits 10264 10304 +40
+ Misses 1955 1941 -14
+ Partials 720 718 -2
Continue to review full report at Codecov.
|
deea908
to
8561f74
Compare
45cbff2
to
b1a6a81
Compare
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.
Once the other PR is merged, can you please rebase and update changelog? Looks good otherwise.
b1a6a81
to
0b63a1d
Compare
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.
/approve
/lgtm
[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 |
/retest |
Description
User can now specify subpath of a volume to be mounted using the
--mount
flagChanges
--mount
flag so it can process subpaths in volumesReference
Fixes #1015