From 5db0ae548fb5e7f2f5ce54351b6926f2ea6758d6 Mon Sep 17 00:00:00 2001 From: Srini Brahmaroutu Date: Tue, 1 Sep 2020 22:42:43 -0700 Subject: [PATCH] moving files from k8s.io/util/mount into staging/src/k8s.io/mount-utils --- go.mod | 1 + hack/.golint_failures | 1 + staging/publishing/rules.yaml | 8 + staging/repos_generated.bzl | 1 + staging/src/BUILD | 1 + .../.github/PULL_REQUEST_TEMPLATE.md | 2 + staging/src/k8s.io/mount-utils/BUILD | 107 ++++++++++ staging/src/k8s.io/mount-utils/LICENSE | 201 ++++++++++++++++++ staging/src/k8s.io/mount-utils/OWNERS | 14 ++ staging/src/k8s.io/mount-utils/README.md | 30 +++ .../src/k8s.io/mount-utils/SECURITY_CONTACTS | 18 ++ .../src/k8s.io/mount-utils/code-of-conduct.md | 3 + .../src/k8s.io/mount-utils/doc.go | 2 +- .../src/k8s.io/mount-utils/fake_mounter.go | 0 staging/src/k8s.io/mount-utils/go.mod | 16 ++ staging/src/k8s.io/mount-utils/go.sum | 33 +++ .../src/k8s.io/mount-utils/mount.go | 4 - .../k8s.io/mount-utils/mount_helper_common.go | 0 .../k8s.io/mount-utils/mount_helper_test.go | 0 .../k8s.io/mount-utils/mount_helper_unix.go | 0 .../mount-utils/mount_helper_unix_test.go | 0 .../mount-utils/mount_helper_windows.go | 0 .../mount-utils/mount_helper_windows_test.go | 0 .../src/k8s.io/mount-utils/mount_linux.go | 2 +- .../k8s.io/mount-utils/mount_linux_test.go | 0 .../src/k8s.io/mount-utils/mount_test.go | 0 .../k8s.io/mount-utils/mount_unsupported.go | 0 .../src/k8s.io/mount-utils/mount_windows.go | 0 .../k8s.io/mount-utils/mount_windows_test.go | 0 .../mount-utils/safe_format_and_mount_test.go | 0 vendor/k8s.io/mount-utils | 1 + vendor/modules.txt | 1 + 32 files changed, 440 insertions(+), 6 deletions(-) create mode 100644 staging/src/k8s.io/mount-utils/.github/PULL_REQUEST_TEMPLATE.md create mode 100644 staging/src/k8s.io/mount-utils/BUILD create mode 100644 staging/src/k8s.io/mount-utils/LICENSE create mode 100644 staging/src/k8s.io/mount-utils/OWNERS create mode 100644 staging/src/k8s.io/mount-utils/README.md create mode 100644 staging/src/k8s.io/mount-utils/SECURITY_CONTACTS create mode 100644 staging/src/k8s.io/mount-utils/code-of-conduct.md rename doc.go => staging/src/k8s.io/mount-utils/doc.go (93%) rename fake_mounter.go => staging/src/k8s.io/mount-utils/fake_mounter.go (100%) create mode 100644 staging/src/k8s.io/mount-utils/go.mod create mode 100644 staging/src/k8s.io/mount-utils/go.sum rename mount.go => staging/src/k8s.io/mount-utils/mount.go (99%) rename mount_helper_common.go => staging/src/k8s.io/mount-utils/mount_helper_common.go (100%) rename mount_helper_test.go => staging/src/k8s.io/mount-utils/mount_helper_test.go (100%) rename mount_helper_unix.go => staging/src/k8s.io/mount-utils/mount_helper_unix.go (100%) rename mount_helper_unix_test.go => staging/src/k8s.io/mount-utils/mount_helper_unix_test.go (100%) rename mount_helper_windows.go => staging/src/k8s.io/mount-utils/mount_helper_windows.go (100%) rename mount_helper_windows_test.go => staging/src/k8s.io/mount-utils/mount_helper_windows_test.go (100%) rename mount_linux.go => staging/src/k8s.io/mount-utils/mount_linux.go (99%) rename mount_linux_test.go => staging/src/k8s.io/mount-utils/mount_linux_test.go (100%) rename mount_test.go => staging/src/k8s.io/mount-utils/mount_test.go (100%) rename mount_unsupported.go => staging/src/k8s.io/mount-utils/mount_unsupported.go (100%) rename mount_windows.go => staging/src/k8s.io/mount-utils/mount_windows.go (100%) rename mount_windows_test.go => staging/src/k8s.io/mount-utils/mount_windows_test.go (100%) rename safe_format_and_mount_test.go => staging/src/k8s.io/mount-utils/safe_format_and_mount_test.go (100%) create mode 120000 vendor/k8s.io/mount-utils diff --git a/go.mod b/go.mod index d62c0676c31..b93122e0fa4 100644 --- a/go.mod +++ b/go.mod @@ -484,6 +484,7 @@ replace ( k8s.io/kubelet => ./staging/src/k8s.io/kubelet k8s.io/legacy-cloud-providers => ./staging/src/k8s.io/legacy-cloud-providers k8s.io/metrics => ./staging/src/k8s.io/metrics + k8s.io/mount-utils => ./staging/src/k8s.io/mount-utils k8s.io/sample-apiserver => ./staging/src/k8s.io/sample-apiserver k8s.io/sample-cli-plugin => ./staging/src/k8s.io/sample-cli-plugin k8s.io/sample-controller => ./staging/src/k8s.io/sample-controller diff --git a/hack/.golint_failures b/hack/.golint_failures index 9fba7988f66..13b08705294 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -487,6 +487,7 @@ staging/src/k8s.io/metrics/pkg/client/custom_metrics/fake staging/src/k8s.io/metrics/pkg/client/custom_metrics/scheme staging/src/k8s.io/metrics/pkg/client/external_metrics staging/src/k8s.io/metrics/pkg/client/external_metrics/fake +staging/src/k8s.io/mount-utils staging/src/k8s.io/sample-apiserver/pkg/admission/wardleinitializer staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/v1alpha1 staging/src/k8s.io/sample-apiserver/pkg/registry/wardle/fischer diff --git a/staging/publishing/rules.yaml b/staging/publishing/rules.yaml index b61fa32c075..d07711ae7e0 100644 --- a/staging/publishing/rules.yaml +++ b/staging/publishing/rules.yaml @@ -1645,3 +1645,11 @@ rules: dir: staging/src/k8s.io/controller-manager name: release-1.19 go: 1.15 + +- destination: mount-utils + library: true + branches: + - source: + branch: master + dir: staging/src/k8s.io/mount-utils + name: master diff --git a/staging/repos_generated.bzl b/staging/repos_generated.bzl index 8adfb85f514..212032e6c4e 100644 --- a/staging/repos_generated.bzl +++ b/staging/repos_generated.bzl @@ -37,6 +37,7 @@ staging_repos = [ "k8s.io/kubelet", "k8s.io/legacy-cloud-providers", "k8s.io/metrics", + "k8s.io/mount-utils", "k8s.io/sample-apiserver", "k8s.io/sample-cli-plugin", "k8s.io/sample-controller", diff --git a/staging/src/BUILD b/staging/src/BUILD index 680dedeb077..b8b0597c81e 100644 --- a/staging/src/BUILD +++ b/staging/src/BUILD @@ -36,6 +36,7 @@ filegroup( "//staging/src/k8s.io/kubelet:all-srcs", "//staging/src/k8s.io/legacy-cloud-providers:all-srcs", "//staging/src/k8s.io/metrics:all-srcs", + "//staging/src/k8s.io/mount-utils:all-srcs", "//staging/src/k8s.io/sample-apiserver:all-srcs", "//staging/src/k8s.io/sample-cli-plugin:all-srcs", "//staging/src/k8s.io/sample-controller:all-srcs", diff --git a/staging/src/k8s.io/mount-utils/.github/PULL_REQUEST_TEMPLATE.md b/staging/src/k8s.io/mount-utils/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000000..e7e5eb834b2 --- /dev/null +++ b/staging/src/k8s.io/mount-utils/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,2 @@ +Sorry, we do not accept changes directly against this repository. Please see +CONTRIBUTING.md for information on where and how to contribute instead. diff --git a/staging/src/k8s.io/mount-utils/BUILD b/staging/src/k8s.io/mount-utils/BUILD new file mode 100644 index 00000000000..d57b710fe82 --- /dev/null +++ b/staging/src/k8s.io/mount-utils/BUILD @@ -0,0 +1,107 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "go_default_library", + srcs = [ + "doc.go", + "fake_mounter.go", + "mount.go", + "mount_helper_common.go", + "mount_helper_unix.go", + "mount_helper_windows.go", + "mount_linux.go", + "mount_unsupported.go", + "mount_windows.go", + ], + importmap = "k8s.io/kubernetes/vendor/k8s.io/mount-utils", + importpath = "k8s.io/mount-utils", + visibility = ["//visibility:public"], + deps = [ + "//vendor/k8s.io/klog/v2:go_default_library", + "//vendor/k8s.io/utils/exec:go_default_library", + ] + select({ + "@io_bazel_rules_go//go/platform:aix": [ + "//vendor/k8s.io/utils/io:go_default_library", + ], + "@io_bazel_rules_go//go/platform:android": [ + "//vendor/k8s.io/utils/io:go_default_library", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "//vendor/k8s.io/utils/io:go_default_library", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "//vendor/k8s.io/utils/io:go_default_library", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "//vendor/k8s.io/utils/io:go_default_library", + ], + "@io_bazel_rules_go//go/platform:illumos": [ + "//vendor/k8s.io/utils/io:go_default_library", + ], + "@io_bazel_rules_go//go/platform:ios": [ + "//vendor/k8s.io/utils/io:go_default_library", + ], + "@io_bazel_rules_go//go/platform:js": [ + "//vendor/k8s.io/utils/io:go_default_library", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "//vendor/k8s.io/utils/io:go_default_library", + ], + "@io_bazel_rules_go//go/platform:nacl": [ + "//vendor/k8s.io/utils/io:go_default_library", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + "//vendor/k8s.io/utils/io:go_default_library", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + "//vendor/k8s.io/utils/io:go_default_library", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + "//vendor/k8s.io/utils/io:go_default_library", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + "//vendor/k8s.io/utils/io:go_default_library", + ], + "@io_bazel_rules_go//go/platform:windows": [ + "//vendor/k8s.io/utils/keymutex:go_default_library", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "go_default_test", + srcs = [ + "mount_helper_test.go", + "mount_helper_unix_test.go", + "mount_helper_windows_test.go", + "mount_linux_test.go", + "mount_test.go", + "mount_windows_test.go", + "safe_format_and_mount_test.go", + ], + embed = [":go_default_library"], + deps = [ + "//vendor/k8s.io/utils/exec:go_default_library", + "//vendor/k8s.io/utils/exec/testing:go_default_library", + ] + select({ + "@io_bazel_rules_go//go/platform:windows": [ + "//vendor/github.com/stretchr/testify/assert:go_default_library", + ], + "//conditions:default": [], + }), +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/staging/src/k8s.io/mount-utils/LICENSE b/staging/src/k8s.io/mount-utils/LICENSE new file mode 100644 index 00000000000..8dada3edaf5 --- /dev/null +++ b/staging/src/k8s.io/mount-utils/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/staging/src/k8s.io/mount-utils/OWNERS b/staging/src/k8s.io/mount-utils/OWNERS new file mode 100644 index 00000000000..5fa5cc24c37 --- /dev/null +++ b/staging/src/k8s.io/mount-utils/OWNERS @@ -0,0 +1,14 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +reviewers: + - jingxu97 + - saad-ali + - jsafrane + - msau42 + - andyzhangx + - gnufied +approvers: + - jingxu97 + - saad-ali + - jsafrane + diff --git a/staging/src/k8s.io/mount-utils/README.md b/staging/src/k8s.io/mount-utils/README.md new file mode 100644 index 00000000000..5510e99bc4f --- /dev/null +++ b/staging/src/k8s.io/mount-utils/README.md @@ -0,0 +1,30 @@ +## Purpose + +This repository defines an interface to mounting filesystems to be consumed by +various Kubernetes and out-of-tree CSI components. + +Consumers of this repository can make use of functions like 'Mount' to mount +source to target as fstype with given options, 'Unmount' to unmount a target. +Other useful functions include 'List' all mounted file systems and find all +mount references to a path using 'GetMountRefs' + +## Community, discussion, contribution, and support + +Learn how to engage with the Kubernetes community on the [community +page](http://kubernetes.io/community/). + +You can reach the maintainers of this repository at: + +- Slack: #sig-storage (on https://kubernetes.slack.com -- get an + invite at slack.kubernetes.io) +- Mailing List: + https://groups.google.com/forum/#!forum/kubernetes-sig-storage + +### Code of Conduct + +Participation in the Kubernetes community is governed by the [Kubernetes +Code of Conduct](code-of-conduct.md). + +### Contibution Guidelines + +See [CONTRIBUTING.md](CONTRIBUTING.md) for more information. diff --git a/staging/src/k8s.io/mount-utils/SECURITY_CONTACTS b/staging/src/k8s.io/mount-utils/SECURITY_CONTACTS new file mode 100644 index 00000000000..14fe23e186d --- /dev/null +++ b/staging/src/k8s.io/mount-utils/SECURITY_CONTACTS @@ -0,0 +1,18 @@ +# Defined below are the security contacts for this repo. +# +# They are the contact point for the Product Security Committee to reach out +# to for triaging and handling of incoming issues. +# +# The below names agree to abide by the +# [Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy) +# and will be removed and replaced if they violate that agreement. +# +# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE +# INSTRUCTIONS AT https://kubernetes.io/security/ + +saad-ali +cjcullen +joelsmith +liggitt +philips +tallclair diff --git a/staging/src/k8s.io/mount-utils/code-of-conduct.md b/staging/src/k8s.io/mount-utils/code-of-conduct.md new file mode 100644 index 00000000000..0d15c00cf32 --- /dev/null +++ b/staging/src/k8s.io/mount-utils/code-of-conduct.md @@ -0,0 +1,3 @@ +# Kubernetes Community Code of Conduct + +Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) diff --git a/doc.go b/staging/src/k8s.io/mount-utils/doc.go similarity index 93% rename from doc.go rename to staging/src/k8s.io/mount-utils/doc.go index c81b426ce8c..b7cac03a52e 100644 --- a/doc.go +++ b/staging/src/k8s.io/mount-utils/doc.go @@ -15,4 +15,4 @@ limitations under the License. */ // Package mount defines an interface to mounting filesystems. -package mount // import "k8s.io/utils/mount" +package mount // import "k8s.io/mount-utils" diff --git a/fake_mounter.go b/staging/src/k8s.io/mount-utils/fake_mounter.go similarity index 100% rename from fake_mounter.go rename to staging/src/k8s.io/mount-utils/fake_mounter.go diff --git a/staging/src/k8s.io/mount-utils/go.mod b/staging/src/k8s.io/mount-utils/go.mod new file mode 100644 index 00000000000..5bc95b701db --- /dev/null +++ b/staging/src/k8s.io/mount-utils/go.mod @@ -0,0 +1,16 @@ +// This is a generated file. Do not edit directly. + +module k8s.io/mount-utils + +go 1.15 + +require ( + github.com/kr/pretty v0.2.0 // indirect + github.com/stretchr/testify v1.4.0 + gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect + gopkg.in/yaml.v2 v2.2.8 // indirect + k8s.io/klog/v2 v2.2.0 + k8s.io/utils v0.0.0-20200729134348-d5654de09c73 +) + +replace k8s.io/mount-utils => ../mount-utils diff --git a/staging/src/k8s.io/mount-utils/go.sum b/staging/src/k8s.io/mount-utils/go.sum new file mode 100644 index 00000000000..5c7f2cfb15f --- /dev/null +++ b/staging/src/k8s.io/mount-utils/go.sum @@ -0,0 +1,33 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +k8s.io/klog/v2 v2.0.0 h1:Foj74zO6RbjjP4hBEKjnYtjjAhGg4jNynUdYF6fJrok= +k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K8Hf8whTseBgJcg= +k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= diff --git a/mount.go b/staging/src/k8s.io/mount-utils/mount.go similarity index 99% rename from mount.go rename to staging/src/k8s.io/mount-utils/mount.go index 14997a75c9b..2847da46bcc 100644 --- a/mount.go +++ b/staging/src/k8s.io/mount-utils/mount.go @@ -290,9 +290,7 @@ func MakeBindOptsSensitive(options []string, sensitiveOptions []string) (bool, [ switch option { case "bind": bind = true - break case "remount": - break default: bindRemountOpts = append(bindRemountOpts, option) } @@ -302,9 +300,7 @@ func MakeBindOptsSensitive(options []string, sensitiveOptions []string) (bool, [ switch sensitiveOption { case "bind": bind = true - break case "remount": - break default: bindRemountSensitiveOpts = append(bindRemountSensitiveOpts, sensitiveOption) } diff --git a/mount_helper_common.go b/staging/src/k8s.io/mount-utils/mount_helper_common.go similarity index 100% rename from mount_helper_common.go rename to staging/src/k8s.io/mount-utils/mount_helper_common.go diff --git a/mount_helper_test.go b/staging/src/k8s.io/mount-utils/mount_helper_test.go similarity index 100% rename from mount_helper_test.go rename to staging/src/k8s.io/mount-utils/mount_helper_test.go diff --git a/mount_helper_unix.go b/staging/src/k8s.io/mount-utils/mount_helper_unix.go similarity index 100% rename from mount_helper_unix.go rename to staging/src/k8s.io/mount-utils/mount_helper_unix.go diff --git a/mount_helper_unix_test.go b/staging/src/k8s.io/mount-utils/mount_helper_unix_test.go similarity index 100% rename from mount_helper_unix_test.go rename to staging/src/k8s.io/mount-utils/mount_helper_unix_test.go diff --git a/mount_helper_windows.go b/staging/src/k8s.io/mount-utils/mount_helper_windows.go similarity index 100% rename from mount_helper_windows.go rename to staging/src/k8s.io/mount-utils/mount_helper_windows.go diff --git a/mount_helper_windows_test.go b/staging/src/k8s.io/mount-utils/mount_helper_windows_test.go similarity index 100% rename from mount_helper_windows_test.go rename to staging/src/k8s.io/mount-utils/mount_helper_windows_test.go diff --git a/mount_linux.go b/staging/src/k8s.io/mount-utils/mount_linux.go similarity index 99% rename from mount_linux.go rename to staging/src/k8s.io/mount-utils/mount_linux.go index b7a443fdf6c..10f046e86ba 100644 --- a/mount_linux.go +++ b/staging/src/k8s.io/mount-utils/mount_linux.go @@ -136,7 +136,7 @@ func (mounter *Mounter) doMount(mounterPath string, mountCmd string, source stri // systemd-mount is not used because it's too new for older distros // (CentOS 7, Debian Jessie). mountCmd, mountArgs, mountArgsLogStr = AddSystemdScopeSensitive("systemd-run", target, mountCmd, mountArgs, mountArgsLogStr) - } else { + // } else { // No systemd-run on the host (or we failed to check it), assume kubelet // does not run as a systemd service. // No code here, mountCmd and mountArgs are already populated. diff --git a/mount_linux_test.go b/staging/src/k8s.io/mount-utils/mount_linux_test.go similarity index 100% rename from mount_linux_test.go rename to staging/src/k8s.io/mount-utils/mount_linux_test.go diff --git a/mount_test.go b/staging/src/k8s.io/mount-utils/mount_test.go similarity index 100% rename from mount_test.go rename to staging/src/k8s.io/mount-utils/mount_test.go diff --git a/mount_unsupported.go b/staging/src/k8s.io/mount-utils/mount_unsupported.go similarity index 100% rename from mount_unsupported.go rename to staging/src/k8s.io/mount-utils/mount_unsupported.go diff --git a/mount_windows.go b/staging/src/k8s.io/mount-utils/mount_windows.go similarity index 100% rename from mount_windows.go rename to staging/src/k8s.io/mount-utils/mount_windows.go diff --git a/mount_windows_test.go b/staging/src/k8s.io/mount-utils/mount_windows_test.go similarity index 100% rename from mount_windows_test.go rename to staging/src/k8s.io/mount-utils/mount_windows_test.go diff --git a/safe_format_and_mount_test.go b/staging/src/k8s.io/mount-utils/safe_format_and_mount_test.go similarity index 100% rename from safe_format_and_mount_test.go rename to staging/src/k8s.io/mount-utils/safe_format_and_mount_test.go diff --git a/vendor/k8s.io/mount-utils b/vendor/k8s.io/mount-utils new file mode 120000 index 00000000000..a5a8937b13a --- /dev/null +++ b/vendor/k8s.io/mount-utils @@ -0,0 +1 @@ +../../staging/src/k8s.io/mount-utils \ No newline at end of file diff --git a/vendor/modules.txt b/vendor/modules.txt index 1182c1c8a08..f33338bbc77 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -2414,6 +2414,7 @@ k8s.io/metrics/pkg/client/custom_metrics/fake k8s.io/metrics/pkg/client/custom_metrics/scheme k8s.io/metrics/pkg/client/external_metrics k8s.io/metrics/pkg/client/external_metrics/fake +# k8s.io/mount-utils => ./staging/src/k8s.io/mount-utils # k8s.io/sample-apiserver v0.0.0 => ./staging/src/k8s.io/sample-apiserver ## explicit # k8s.io/sample-apiserver => ./staging/src/k8s.io/sample-apiserver