diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 342f534b8e9..6f9aabb738f 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -4088,21 +4088,41 @@ "ImportPath": "k8s.io/repo-infra/kazel", "Rev": "00fe14e3d1a3f9a73c4cea62d9c33b29c1e03ac4" }, + { + "ImportPath": "k8s.io/utils/buffer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, { "ImportPath": "k8s.io/utils/clock", - "Rev": "8e7ff06bf0e2d3289061230af203e430a15b6dcc" + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" }, { "ImportPath": "k8s.io/utils/exec", - "Rev": "8e7ff06bf0e2d3289061230af203e430a15b6dcc" + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" }, { "ImportPath": "k8s.io/utils/exec/testing", - "Rev": "8e7ff06bf0e2d3289061230af203e430a15b6dcc" + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, + { + "ImportPath": "k8s.io/utils/integer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, + { + "ImportPath": "k8s.io/utils/io", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, + { + "ImportPath": "k8s.io/utils/nsenter", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" }, { "ImportPath": "k8s.io/utils/pointer", - "Rev": "8e7ff06bf0e2d3289061230af203e430a15b6dcc" + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, + { + "ImportPath": "k8s.io/utils/trace", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" }, { "ImportPath": "sigs.k8s.io/yaml", diff --git a/Godeps/LICENSES b/Godeps/LICENSES index a67ec0ba321..8c0bca5a0e4 100644 --- a/Godeps/LICENSES +++ b/Godeps/LICENSES @@ -114953,6 +114953,216 @@ third-party archives. ================================================================================ +================================================================================ += vendor/k8s.io/utils/buffer licensed under: = + + + 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. + += vendor/k8s.io/utils/LICENSE 3b83ef96387f14655fc854ddc3c6bd57 +================================================================================ + + ================================================================================ = vendor/k8s.io/utils/clock licensed under: = @@ -115583,6 +115793,636 @@ third-party archives. ================================================================================ +================================================================================ += vendor/k8s.io/utils/integer licensed under: = + + + 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. + += vendor/k8s.io/utils/LICENSE 3b83ef96387f14655fc854ddc3c6bd57 +================================================================================ + + +================================================================================ += vendor/k8s.io/utils/io licensed under: = + + + 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. + += vendor/k8s.io/utils/LICENSE 3b83ef96387f14655fc854ddc3c6bd57 +================================================================================ + + +================================================================================ += vendor/k8s.io/utils/nsenter licensed under: = + + + 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. + += vendor/k8s.io/utils/LICENSE 3b83ef96387f14655fc854ddc3c6bd57 +================================================================================ + + ================================================================================ = vendor/k8s.io/utils/pointer licensed under: = @@ -115793,6 +116633,216 @@ third-party archives. ================================================================================ +================================================================================ += vendor/k8s.io/utils/trace licensed under: = + + + 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. + += vendor/k8s.io/utils/LICENSE 3b83ef96387f14655fc854ddc3c6bd57 +================================================================================ + + ================================================================================ = vendor/sigs.k8s.io/yaml licensed under: = diff --git a/cmd/kubeadm/.import-restrictions b/cmd/kubeadm/.import-restrictions index b2ceea03ec9..9b3791b9e6e 100644 --- a/cmd/kubeadm/.import-restrictions +++ b/cmd/kubeadm/.import-restrictions @@ -40,6 +40,7 @@ "SelectorRegexp": "k8s[.]io/utils", "AllowedPrefixes": [ "k8s.io/utils/exec", + "k8s.io/utils/integer", "k8s.io/utils/pointer" ] }, diff --git a/cmd/kubelet/app/BUILD b/cmd/kubelet/app/BUILD index 59e5a936053..9fc77d79b0a 100644 --- a/cmd/kubelet/app/BUILD +++ b/cmd/kubelet/app/BUILD @@ -75,7 +75,6 @@ go_library( "//pkg/util/flock:go_default_library", "//pkg/util/mount:go_default_library", "//pkg/util/node:go_default_library", - "//pkg/util/nsenter:go_default_library", "//pkg/util/oom:go_default_library", "//pkg/util/rlimit:go_default_library", "//pkg/version:go_default_library", @@ -142,6 +141,7 @@ go_library( "//vendor/github.com/spf13/pflag:go_default_library", "//vendor/k8s.io/klog:go_default_library", "//vendor/k8s.io/utils/exec:go_default_library", + "//vendor/k8s.io/utils/nsenter:go_default_library", ] + select({ "@io_bazel_rules_go//go/platform:linux": [ "//vendor/github.com/sigma/go-inotify:go_default_library", diff --git a/cmd/kubelet/app/server.go b/cmd/kubelet/app/server.go index c84979fd617..bedd78500b1 100644 --- a/cmd/kubelet/app/server.go +++ b/cmd/kubelet/app/server.go @@ -91,12 +91,12 @@ import ( "k8s.io/kubernetes/pkg/util/flock" "k8s.io/kubernetes/pkg/util/mount" nodeutil "k8s.io/kubernetes/pkg/util/node" - "k8s.io/kubernetes/pkg/util/nsenter" "k8s.io/kubernetes/pkg/util/oom" "k8s.io/kubernetes/pkg/util/rlimit" "k8s.io/kubernetes/pkg/version" "k8s.io/kubernetes/pkg/version/verflag" "k8s.io/utils/exec" + "k8s.io/utils/nsenter" ) const ( diff --git a/hack/.golint_failures b/hack/.golint_failures index 95861311946..094c57b7226 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -579,7 +579,6 @@ staging/src/k8s.io/apiserver/pkg/storage/value staging/src/k8s.io/apiserver/pkg/util/feature staging/src/k8s.io/apiserver/pkg/util/flag staging/src/k8s.io/apiserver/pkg/util/proxy -staging/src/k8s.io/apiserver/pkg/util/trace staging/src/k8s.io/apiserver/pkg/util/webhook staging/src/k8s.io/apiserver/pkg/util/wsstream staging/src/k8s.io/apiserver/plugin/pkg/audit/log @@ -641,7 +640,6 @@ staging/src/k8s.io/client-go/tools/reference staging/src/k8s.io/client-go/transport staging/src/k8s.io/client-go/util/exec staging/src/k8s.io/client-go/util/flowcontrol -staging/src/k8s.io/client-go/util/integer staging/src/k8s.io/client-go/util/jsonpath staging/src/k8s.io/client-go/util/retry staging/src/k8s.io/client-go/util/testing diff --git a/hack/import-restrictions.yaml b/hack/import-restrictions.yaml index 76354c8c6e4..bfcd70fefa1 100644 --- a/hack/import-restrictions.yaml +++ b/hack/import-restrictions.yaml @@ -62,6 +62,7 @@ - k8s.io/apimachinery - k8s.io/client-go - k8s.io/klog + - k8s.io/utils # prevent core machinery from taking explicit v1 references unless # necessary @@ -84,6 +85,7 @@ - k8s.io/apimachinery - k8s.io/client-go - k8s.io/klog + - k8s.io/utils - baseImportPath: "./vendor/k8s.io/apiserver/" allowedImports: diff --git a/pkg/controller/.import-restrictions b/pkg/controller/.import-restrictions index 96eeb2aeef2..bb88f40d2ed 100644 --- a/pkg/controller/.import-restrictions +++ b/pkg/controller/.import-restrictions @@ -160,7 +160,6 @@ "k8s.io/client-go/tools/watch", "k8s.io/client-go/util/cert", "k8s.io/client-go/util/flowcontrol", - "k8s.io/client-go/util/integer", "k8s.io/client-go/util/retry", "k8s.io/client-go/util/testing", "k8s.io/client-go/util/workqueue" @@ -314,12 +313,10 @@ "k8s.io/kubernetes/pkg/fieldpath", "k8s.io/kubernetes/pkg/scheduler/volumebinder", "k8s.io/kubernetes/pkg/scheduler/internal/cache", - "k8s.io/kubernetes/pkg/util/nsenter", "k8s.io/kubernetes/pkg/util/resizefs", "k8s.io/kubernetes/pkg/util/version", "k8s.io/kubernetes/pkg/apis/apps", - "k8s.io/kubernetes/pkg/version", - "k8s.io/kubernetes/pkg/util/io" + "k8s.io/kubernetes/pkg/version" ] }, { @@ -340,6 +337,9 @@ "k8s.io/metrics/pkg/client/custom_metrics/fake", "k8s.io/metrics/pkg/client/external_metrics", "k8s.io/metrics/pkg/client/external_metrics/fake", + "k8s.io/utils/nsenter", + "k8s.io/utils/integer", + "k8s.io/utils/io", "k8s.io/utils/pointer", "k8s.io/utils/exec" ] diff --git a/pkg/controller/BUILD b/pkg/controller/BUILD index 57f6c8f70ab..00e7f8efa30 100644 --- a/pkg/controller/BUILD +++ b/pkg/controller/BUILD @@ -85,10 +85,10 @@ go_library( "//staging/src/k8s.io/client-go/tools/cache:go_default_library", "//staging/src/k8s.io/client-go/tools/record:go_default_library", "//staging/src/k8s.io/client-go/tools/watch:go_default_library", - "//staging/src/k8s.io/client-go/util/integer:go_default_library", "//staging/src/k8s.io/client-go/util/retry:go_default_library", "//vendor/github.com/golang/groupcache/lru:go_default_library", "//vendor/k8s.io/klog:go_default_library", + "//vendor/k8s.io/utils/integer:go_default_library", ], ) diff --git a/pkg/controller/controller_utils.go b/pkg/controller/controller_utils.go index 1a0324f7a84..06624341021 100644 --- a/pkg/controller/controller_utils.go +++ b/pkg/controller/controller_utils.go @@ -42,13 +42,13 @@ import ( clientset "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/record" - "k8s.io/client-go/util/integer" clientretry "k8s.io/client-go/util/retry" podutil "k8s.io/kubernetes/pkg/api/v1/pod" _ "k8s.io/kubernetes/pkg/apis/core/install" "k8s.io/kubernetes/pkg/apis/core/validation" hashutil "k8s.io/kubernetes/pkg/util/hash" taintutils "k8s.io/kubernetes/pkg/util/taints" + "k8s.io/utils/integer" "k8s.io/klog" ) diff --git a/pkg/controller/daemon/BUILD b/pkg/controller/daemon/BUILD index f98dafce883..b1d3548ed8d 100644 --- a/pkg/controller/daemon/BUILD +++ b/pkg/controller/daemon/BUILD @@ -49,9 +49,9 @@ go_library( "//staging/src/k8s.io/client-go/tools/cache:go_default_library", "//staging/src/k8s.io/client-go/tools/record:go_default_library", "//staging/src/k8s.io/client-go/util/flowcontrol:go_default_library", - "//staging/src/k8s.io/client-go/util/integer:go_default_library", "//staging/src/k8s.io/client-go/util/workqueue:go_default_library", "//vendor/k8s.io/klog:go_default_library", + "//vendor/k8s.io/utils/integer:go_default_library", ], ) diff --git a/pkg/controller/daemon/daemon_controller.go b/pkg/controller/daemon/daemon_controller.go index d98ea75166d..bf7019f117c 100644 --- a/pkg/controller/daemon/daemon_controller.go +++ b/pkg/controller/daemon/daemon_controller.go @@ -47,7 +47,6 @@ import ( "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/record" "k8s.io/client-go/util/flowcontrol" - "k8s.io/client-go/util/integer" "k8s.io/client-go/util/workqueue" podutil "k8s.io/kubernetes/pkg/api/v1/pod" "k8s.io/kubernetes/pkg/controller" @@ -57,6 +56,7 @@ import ( "k8s.io/kubernetes/pkg/scheduler/algorithm/predicates" schedulernodeinfo "k8s.io/kubernetes/pkg/scheduler/nodeinfo" "k8s.io/kubernetes/pkg/util/metrics" + "k8s.io/utils/integer" ) const ( diff --git a/pkg/controller/deployment/BUILD b/pkg/controller/deployment/BUILD index 7f1964a4f7e..53865847a37 100644 --- a/pkg/controller/deployment/BUILD +++ b/pkg/controller/deployment/BUILD @@ -40,9 +40,9 @@ go_library( "//staging/src/k8s.io/client-go/listers/core/v1:go_default_library", "//staging/src/k8s.io/client-go/tools/cache:go_default_library", "//staging/src/k8s.io/client-go/tools/record:go_default_library", - "//staging/src/k8s.io/client-go/util/integer:go_default_library", "//staging/src/k8s.io/client-go/util/workqueue:go_default_library", "//vendor/k8s.io/klog:go_default_library", + "//vendor/k8s.io/utils/integer:go_default_library", ], ) diff --git a/pkg/controller/deployment/rolling.go b/pkg/controller/deployment/rolling.go index 6950c3e6798..7cc40bbc53e 100644 --- a/pkg/controller/deployment/rolling.go +++ b/pkg/controller/deployment/rolling.go @@ -21,10 +21,10 @@ import ( "sort" apps "k8s.io/api/apps/v1" - "k8s.io/client-go/util/integer" "k8s.io/klog" "k8s.io/kubernetes/pkg/controller" deploymentutil "k8s.io/kubernetes/pkg/controller/deployment/util" + "k8s.io/utils/integer" ) // rolloutRolling implements the logic for rolling a new replica set. diff --git a/pkg/controller/deployment/util/BUILD b/pkg/controller/deployment/util/BUILD index 2b563e00ae2..3d9f752248b 100644 --- a/pkg/controller/deployment/util/BUILD +++ b/pkg/controller/deployment/util/BUILD @@ -23,8 +23,8 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/util/intstr:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1:go_default_library", - "//staging/src/k8s.io/client-go/util/integer:go_default_library", "//vendor/k8s.io/klog:go_default_library", + "//vendor/k8s.io/utils/integer:go_default_library", ], ) diff --git a/pkg/controller/deployment/util/deployment_util.go b/pkg/controller/deployment/util/deployment_util.go index 00e5c4c36e6..90c60c84619 100644 --- a/pkg/controller/deployment/util/deployment_util.go +++ b/pkg/controller/deployment/util/deployment_util.go @@ -36,9 +36,9 @@ import ( intstrutil "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/wait" appsclient "k8s.io/client-go/kubernetes/typed/apps/v1" - "k8s.io/client-go/util/integer" "k8s.io/kubernetes/pkg/controller" labelsutil "k8s.io/kubernetes/pkg/util/labels" + "k8s.io/utils/integer" ) const ( diff --git a/pkg/controller/job/BUILD b/pkg/controller/job/BUILD index cb12dbe575b..2cdbcd4986f 100644 --- a/pkg/controller/job/BUILD +++ b/pkg/controller/job/BUILD @@ -33,9 +33,9 @@ go_library( "//staging/src/k8s.io/client-go/listers/core/v1:go_default_library", "//staging/src/k8s.io/client-go/tools/cache:go_default_library", "//staging/src/k8s.io/client-go/tools/record:go_default_library", - "//staging/src/k8s.io/client-go/util/integer:go_default_library", "//staging/src/k8s.io/client-go/util/workqueue:go_default_library", "//vendor/k8s.io/klog:go_default_library", + "//vendor/k8s.io/utils/integer:go_default_library", ], ) diff --git a/pkg/controller/job/job_controller.go b/pkg/controller/job/job_controller.go index ebdcd7e2640..e3cecd9fc2d 100644 --- a/pkg/controller/job/job_controller.go +++ b/pkg/controller/job/job_controller.go @@ -40,10 +40,10 @@ import ( corelisters "k8s.io/client-go/listers/core/v1" "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/record" - "k8s.io/client-go/util/integer" "k8s.io/client-go/util/workqueue" "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/util/metrics" + "k8s.io/utils/integer" "k8s.io/klog" ) diff --git a/pkg/controller/replicaset/BUILD b/pkg/controller/replicaset/BUILD index e833fdf6e37..df8300c9fe1 100644 --- a/pkg/controller/replicaset/BUILD +++ b/pkg/controller/replicaset/BUILD @@ -36,9 +36,9 @@ go_library( "//staging/src/k8s.io/client-go/listers/core/v1:go_default_library", "//staging/src/k8s.io/client-go/tools/cache:go_default_library", "//staging/src/k8s.io/client-go/tools/record:go_default_library", - "//staging/src/k8s.io/client-go/util/integer:go_default_library", "//staging/src/k8s.io/client-go/util/workqueue:go_default_library", "//vendor/k8s.io/klog:go_default_library", + "//vendor/k8s.io/utils/integer:go_default_library", ], ) diff --git a/pkg/controller/replicaset/replica_set.go b/pkg/controller/replicaset/replica_set.go index 03edbe1365c..1ee5f61160a 100644 --- a/pkg/controller/replicaset/replica_set.go +++ b/pkg/controller/replicaset/replica_set.go @@ -52,12 +52,12 @@ import ( corelisters "k8s.io/client-go/listers/core/v1" "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/record" - "k8s.io/client-go/util/integer" "k8s.io/client-go/util/workqueue" "k8s.io/klog" podutil "k8s.io/kubernetes/pkg/api/v1/pod" "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/util/metrics" + "k8s.io/utils/integer" ) const ( diff --git a/pkg/kubectl/.import-restrictions b/pkg/kubectl/.import-restrictions index ab4626ce698..f635e6709f2 100644 --- a/pkg/kubectl/.import-restrictions +++ b/pkg/kubectl/.import-restrictions @@ -130,13 +130,11 @@ "k8s.io/kubernetes/pkg/util/goroutinemap", "k8s.io/kubernetes/pkg/util/hash", "k8s.io/kubernetes/pkg/util/interrupt", - "k8s.io/kubernetes/pkg/util/io", "k8s.io/kubernetes/pkg/util/labels", "k8s.io/kubernetes/pkg/util/metrics", "k8s.io/kubernetes/pkg/util/mount", "k8s.io/kubernetes/pkg/util/net/sets", "k8s.io/kubernetes/pkg/util/node", - "k8s.io/kubernetes/pkg/util/nsenter", "k8s.io/kubernetes/pkg/util/parsers", "k8s.io/kubernetes/pkg/util/slice", "k8s.io/kubernetes/pkg/util/taints", @@ -144,6 +142,8 @@ "k8s.io/kubernetes/pkg/version/prometheus", "k8s.io/kubernetes/pkg/volume", "k8s.io/kubernetes/pkg/volume/util", + "k8s.io/utils/nsenter", + "k8s.io/utils/io", "k8s.io/utils/pointer" ], "ForbiddenPrefixes": [] diff --git a/pkg/kubectl/BUILD b/pkg/kubectl/BUILD index cfb06a76450..1d56ac8a7d4 100644 --- a/pkg/kubectl/BUILD +++ b/pkg/kubectl/BUILD @@ -87,8 +87,8 @@ go_library( "//staging/src/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library", "//staging/src/k8s.io/client-go/rest:go_default_library", "//staging/src/k8s.io/client-go/scale:go_default_library", - "//staging/src/k8s.io/client-go/util/integer:go_default_library", "//staging/src/k8s.io/client-go/util/retry:go_default_library", + "//vendor/k8s.io/utils/integer:go_default_library", ], ) diff --git a/pkg/kubectl/cmd/get/BUILD b/pkg/kubectl/cmd/get/BUILD index 0aa20de3c04..9ab44eaec0f 100644 --- a/pkg/kubectl/cmd/get/BUILD +++ b/pkg/kubectl/cmd/get/BUILD @@ -53,11 +53,11 @@ go_library( "//staging/src/k8s.io/cli-runtime/pkg/genericclioptions/resource:go_default_library", "//staging/src/k8s.io/client-go/rest:go_default_library", "//staging/src/k8s.io/client-go/tools/watch:go_default_library", - "//staging/src/k8s.io/client-go/util/integer:go_default_library", "//staging/src/k8s.io/client-go/util/jsonpath:go_default_library", "//vendor/github.com/liggitt/tabwriter:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/k8s.io/klog:go_default_library", + "//vendor/k8s.io/utils/integer:go_default_library", "//vendor/vbom.ml/util/sortorder:go_default_library", ], ) diff --git a/pkg/kubectl/cmd/get/sorter.go b/pkg/kubectl/cmd/get/sorter.go index d806decd19a..c486d76df1a 100644 --- a/pkg/kubectl/cmd/get/sorter.go +++ b/pkg/kubectl/cmd/get/sorter.go @@ -31,8 +31,8 @@ import ( metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/cli-runtime/pkg/genericclioptions/printers" - "k8s.io/client-go/util/integer" "k8s.io/client-go/util/jsonpath" + "k8s.io/utils/integer" "vbom.ml/util/sortorder" ) diff --git a/pkg/kubectl/rolling_updater.go b/pkg/kubectl/rolling_updater.go index b6df08c4120..3cea7c82fef 100644 --- a/pkg/kubectl/rolling_updater.go +++ b/pkg/kubectl/rolling_updater.go @@ -33,11 +33,11 @@ import ( "k8s.io/apimachinery/pkg/util/wait" corev1client "k8s.io/client-go/kubernetes/typed/core/v1" scaleclient "k8s.io/client-go/scale" - "k8s.io/client-go/util/integer" "k8s.io/client-go/util/retry" "k8s.io/kubernetes/pkg/kubectl/util" deploymentutil "k8s.io/kubernetes/pkg/kubectl/util/deployment" "k8s.io/kubernetes/pkg/kubectl/util/podutils" + "k8s.io/utils/integer" ) func newInt32Ptr(val int) *int32 { diff --git a/pkg/kubectl/util/podutils/BUILD b/pkg/kubectl/util/podutils/BUILD index 51522abecab..ec4c53d899d 100644 --- a/pkg/kubectl/util/podutils/BUILD +++ b/pkg/kubectl/util/podutils/BUILD @@ -8,7 +8,7 @@ go_library( deps = [ "//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//staging/src/k8s.io/client-go/util/integer:go_default_library", + "//vendor/k8s.io/utils/integer:go_default_library", ], ) diff --git a/pkg/kubectl/util/podutils/podutils.go b/pkg/kubectl/util/podutils/podutils.go index 2da66ef9c3f..142b8879651 100644 --- a/pkg/kubectl/util/podutils/podutils.go +++ b/pkg/kubectl/util/podutils/podutils.go @@ -21,7 +21,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/util/integer" + "k8s.io/utils/integer" ) // IsPodAvailable returns true if a pod is available; false otherwise. diff --git a/pkg/kubelet/BUILD b/pkg/kubelet/BUILD index 61e9e649ed1..722309afa4e 100644 --- a/pkg/kubelet/BUILD +++ b/pkg/kubelet/BUILD @@ -140,7 +140,6 @@ go_library( "//staging/src/k8s.io/client-go/tools/record:go_default_library", "//staging/src/k8s.io/client-go/util/certificate:go_default_library", "//staging/src/k8s.io/client-go/util/flowcontrol:go_default_library", - "//staging/src/k8s.io/client-go/util/integer:go_default_library", "//staging/src/k8s.io/cloud-provider:go_default_library", "//staging/src/k8s.io/csi-api/pkg/client/clientset/versioned:go_default_library", "//third_party/forked/golang/expansion:go_default_library", @@ -150,6 +149,7 @@ go_library( "//vendor/github.com/google/cadvisor/info/v2:go_default_library", "//vendor/k8s.io/klog:go_default_library", "//vendor/k8s.io/utils/exec:go_default_library", + "//vendor/k8s.io/utils/integer:go_default_library", ], ) diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index 45ae42629fb..1592b558f65 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -51,7 +51,6 @@ import ( "k8s.io/client-go/tools/record" "k8s.io/client-go/util/certificate" "k8s.io/client-go/util/flowcontrol" - "k8s.io/client-go/util/integer" cloudprovider "k8s.io/cloud-provider" csiclientset "k8s.io/csi-api/pkg/client/clientset/versioned" "k8s.io/klog" @@ -116,6 +115,7 @@ import ( "k8s.io/kubernetes/pkg/volume" "k8s.io/kubernetes/pkg/volume/csi" utilexec "k8s.io/utils/exec" + "k8s.io/utils/integer" ) const ( diff --git a/pkg/scheduler/core/BUILD b/pkg/scheduler/core/BUILD index a2ef61a73e8..64b582126bb 100644 --- a/pkg/scheduler/core/BUILD +++ b/pkg/scheduler/core/BUILD @@ -27,11 +27,11 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/util/errors:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/net:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/util/trace:go_default_library", "//staging/src/k8s.io/client-go/listers/core/v1:go_default_library", "//staging/src/k8s.io/client-go/rest:go_default_library", "//staging/src/k8s.io/client-go/util/workqueue:go_default_library", "//vendor/k8s.io/klog:go_default_library", + "//vendor/k8s.io/utils/trace:go_default_library", ], ) diff --git a/pkg/scheduler/core/generic_scheduler.go b/pkg/scheduler/core/generic_scheduler.go index f2086c7fac1..59a4d40179e 100644 --- a/pkg/scheduler/core/generic_scheduler.go +++ b/pkg/scheduler/core/generic_scheduler.go @@ -33,7 +33,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/errors" - utiltrace "k8s.io/apiserver/pkg/util/trace" corelisters "k8s.io/client-go/listers/core/v1" "k8s.io/client-go/util/workqueue" "k8s.io/kubernetes/pkg/scheduler/algorithm" @@ -47,6 +46,7 @@ import ( pluginsv1alpha1 "k8s.io/kubernetes/pkg/scheduler/plugins/v1alpha1" "k8s.io/kubernetes/pkg/scheduler/util" "k8s.io/kubernetes/pkg/scheduler/volumebinder" + utiltrace "k8s.io/utils/trace" ) const ( diff --git a/pkg/util/BUILD b/pkg/util/BUILD index e46513b9652..b2620448b6b 100644 --- a/pkg/util/BUILD +++ b/pkg/util/BUILD @@ -28,7 +28,6 @@ filegroup( "//pkg/util/hash:all-srcs", "//pkg/util/initsystem:all-srcs", "//pkg/util/interrupt:all-srcs", - "//pkg/util/io:all-srcs", "//pkg/util/ipconfig:all-srcs", "//pkg/util/ipset:all-srcs", "//pkg/util/iptables:all-srcs", @@ -42,7 +41,6 @@ filegroup( "//pkg/util/netsh:all-srcs", "//pkg/util/node:all-srcs", "//pkg/util/normalizer:all-srcs", - "//pkg/util/nsenter:all-srcs", "//pkg/util/oom:all-srcs", "//pkg/util/parsers:all-srcs", "//pkg/util/pod:all-srcs", diff --git a/pkg/util/iptables/BUILD b/pkg/util/iptables/BUILD index 9b289951f52..6e62709b6da 100644 --- a/pkg/util/iptables/BUILD +++ b/pkg/util/iptables/BUILD @@ -20,10 +20,10 @@ go_library( "//pkg/util/dbus:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/version:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/util/trace:go_default_library", "//vendor/github.com/godbus/dbus:go_default_library", "//vendor/k8s.io/klog:go_default_library", "//vendor/k8s.io/utils/exec:go_default_library", + "//vendor/k8s.io/utils/trace:go_default_library", ] + select({ "@io_bazel_rules_go//go/platform:linux": [ "//staging/src/k8s.io/apimachinery/pkg/util/errors:go_default_library", diff --git a/pkg/util/iptables/iptables.go b/pkg/util/iptables/iptables.go index c9f3d9860d1..976f6d780da 100644 --- a/pkg/util/iptables/iptables.go +++ b/pkg/util/iptables/iptables.go @@ -28,10 +28,10 @@ import ( godbus "github.com/godbus/dbus" "k8s.io/apimachinery/pkg/util/sets" utilversion "k8s.io/apimachinery/pkg/util/version" - utiltrace "k8s.io/apiserver/pkg/util/trace" "k8s.io/klog" utildbus "k8s.io/kubernetes/pkg/util/dbus" utilexec "k8s.io/utils/exec" + utiltrace "k8s.io/utils/trace" ) type RulePosition string diff --git a/pkg/util/mount/BUILD b/pkg/util/mount/BUILD index c9b9ce8a47e..60998c1d228 100644 --- a/pkg/util/mount/BUILD +++ b/pkg/util/mount/BUILD @@ -23,42 +23,42 @@ go_library( "//vendor/k8s.io/utils/exec:go_default_library", ] + select({ "@io_bazel_rules_go//go/platform:android": [ - "//pkg/util/nsenter:go_default_library", + "//vendor/k8s.io/utils/nsenter:go_default_library", ], "@io_bazel_rules_go//go/platform:darwin": [ - "//pkg/util/nsenter:go_default_library", + "//vendor/k8s.io/utils/nsenter:go_default_library", ], "@io_bazel_rules_go//go/platform:dragonfly": [ - "//pkg/util/nsenter:go_default_library", + "//vendor/k8s.io/utils/nsenter:go_default_library", ], "@io_bazel_rules_go//go/platform:freebsd": [ - "//pkg/util/nsenter:go_default_library", + "//vendor/k8s.io/utils/nsenter:go_default_library", ], "@io_bazel_rules_go//go/platform:linux": [ "//pkg/util/file:go_default_library", - "//pkg/util/io:go_default_library", - "//pkg/util/nsenter:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//vendor/golang.org/x/sys/unix:go_default_library", + "//vendor/k8s.io/utils/io:go_default_library", + "//vendor/k8s.io/utils/nsenter:go_default_library", ], "@io_bazel_rules_go//go/platform:nacl": [ - "//pkg/util/nsenter:go_default_library", + "//vendor/k8s.io/utils/nsenter:go_default_library", ], "@io_bazel_rules_go//go/platform:netbsd": [ - "//pkg/util/nsenter:go_default_library", + "//vendor/k8s.io/utils/nsenter:go_default_library", ], "@io_bazel_rules_go//go/platform:openbsd": [ - "//pkg/util/nsenter:go_default_library", + "//vendor/k8s.io/utils/nsenter:go_default_library", ], "@io_bazel_rules_go//go/platform:plan9": [ - "//pkg/util/nsenter:go_default_library", + "//vendor/k8s.io/utils/nsenter:go_default_library", ], "@io_bazel_rules_go//go/platform:solaris": [ - "//pkg/util/nsenter:go_default_library", + "//vendor/k8s.io/utils/nsenter:go_default_library", ], "@io_bazel_rules_go//go/platform:windows": [ "//pkg/util/file:go_default_library", - "//pkg/util/nsenter:go_default_library", + "//vendor/k8s.io/utils/nsenter:go_default_library", ], "//conditions:default": [], }), @@ -80,10 +80,10 @@ go_test( "//vendor/k8s.io/utils/exec/testing:go_default_library", ] + select({ "@io_bazel_rules_go//go/platform:linux": [ - "//pkg/util/nsenter:go_default_library", "//vendor/golang.org/x/sys/unix:go_default_library", "//vendor/k8s.io/klog:go_default_library", "//vendor/k8s.io/utils/exec:go_default_library", + "//vendor/k8s.io/utils/nsenter:go_default_library", ], "@io_bazel_rules_go//go/platform:windows": [ "//vendor/github.com/stretchr/testify/assert:go_default_library", diff --git a/pkg/util/mount/mount_linux.go b/pkg/util/mount/mount_linux.go index 8e7604a22c4..b0ef01bae4d 100644 --- a/pkg/util/mount/mount_linux.go +++ b/pkg/util/mount/mount_linux.go @@ -34,8 +34,8 @@ import ( "k8s.io/apimachinery/pkg/util/sets" "k8s.io/klog" utilfile "k8s.io/kubernetes/pkg/util/file" - utilio "k8s.io/kubernetes/pkg/util/io" utilexec "k8s.io/utils/exec" + utilio "k8s.io/utils/io" ) const ( diff --git a/pkg/util/mount/nsenter_mount.go b/pkg/util/mount/nsenter_mount.go index 215da6174fb..e77ee6f75f3 100644 --- a/pkg/util/mount/nsenter_mount.go +++ b/pkg/util/mount/nsenter_mount.go @@ -28,7 +28,7 @@ import ( "golang.org/x/sys/unix" "k8s.io/klog" utilfile "k8s.io/kubernetes/pkg/util/file" - "k8s.io/kubernetes/pkg/util/nsenter" + "k8s.io/utils/nsenter" ) const ( diff --git a/pkg/util/mount/nsenter_mount_test.go b/pkg/util/mount/nsenter_mount_test.go index 164eab2f1cd..1ed4bd222b3 100644 --- a/pkg/util/mount/nsenter_mount_test.go +++ b/pkg/util/mount/nsenter_mount_test.go @@ -27,7 +27,7 @@ import ( "testing" "golang.org/x/sys/unix" - "k8s.io/kubernetes/pkg/util/nsenter" + "k8s.io/utils/nsenter" ) func TestParseFindMnt(t *testing.T) { diff --git a/pkg/util/mount/nsenter_mount_unsupported.go b/pkg/util/mount/nsenter_mount_unsupported.go index ddc44742e83..d68f751af84 100644 --- a/pkg/util/mount/nsenter_mount_unsupported.go +++ b/pkg/util/mount/nsenter_mount_unsupported.go @@ -22,7 +22,7 @@ import ( "errors" "os" - "k8s.io/kubernetes/pkg/util/nsenter" + "k8s.io/utils/nsenter" ) type NsenterMounter struct{} diff --git a/pkg/util/nsenter/nsenter_test.go b/pkg/util/nsenter/nsenter_test.go deleted file mode 100644 index 3158a55bbec..00000000000 --- a/pkg/util/nsenter/nsenter_test.go +++ /dev/null @@ -1,311 +0,0 @@ -// +build linux - -/* -Copyright 2018 The Kubernetes Authors. - -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. -*/ - -package nsenter - -import ( - "io/ioutil" - "os" - "path/filepath" - "testing" - - "k8s.io/utils/exec" -) - -func TestExec(t *testing.T) { - tests := []struct { - name string - command string - args []string - expectedOutput string - expectError bool - }{ - { - name: "simple command", - command: "echo", - args: []string{"hello", "world"}, - expectedOutput: "hello world\n", - }, - { - name: "nozero exit code", - command: "false", - expectError: true, - }, - } - - executor := fakeExec{ - rootfsPath: "/rootfs", - } - for _, test := range tests { - ns := Nsenter{ - hostRootFsPath: "/rootfs", - executor: executor, - } - cmd := ns.Exec(test.command, test.args) - outBytes, err := cmd.CombinedOutput() - out := string(outBytes) - if err != nil && !test.expectError { - t.Errorf("Test %q: unexpected error: %s", test.name, err) - } - if err == nil && test.expectError { - t.Errorf("Test %q: expected error, got none", test.name) - } - if test.expectedOutput != out { - t.Errorf("test %q: expected output %q, got %q", test.name, test.expectedOutput, out) - } - } -} - -func TestKubeletPath(t *testing.T) { - tests := []struct { - rootfs string - hostpath string - expectedKubeletPath string - }{ - { - // simple join - "/rootfs", - "/some/path", - "/rootfs/some/path", - }, - { - // squash slashes - "/rootfs/", - "//some/path", - "/rootfs/some/path", - }, - } - - for _, test := range tests { - ns := Nsenter{ - hostRootFsPath: test.rootfs, - } - out := ns.KubeletPath(test.hostpath) - if out != test.expectedKubeletPath { - t.Errorf("Expected path %q, got %q", test.expectedKubeletPath, out) - } - - } -} - -func TestEvalSymlinks(t *testing.T) { - tests := []struct { - name string - mustExist bool - prepare func(tmpdir string) (src string, expectedDst string, err error) - expectError bool - }{ - { - name: "simple file /src", - mustExist: true, - prepare: func(tmpdir string) (src string, expectedDst string, err error) { - src = filepath.Join(tmpdir, "src") - err = ioutil.WriteFile(src, []byte{}, 0644) - return src, src, err - }, - }, - { - name: "non-existing file /src", - mustExist: true, - prepare: func(tmpdir string) (src string, expectedDst string, err error) { - src = filepath.Join(tmpdir, "src") - return src, "", nil - }, - expectError: true, - }, - { - name: "non-existing file /src/ with mustExist=false", - mustExist: false, - prepare: func(tmpdir string) (src string, expectedDst string, err error) { - src = filepath.Join(tmpdir, "src") - return src, src, nil - }, - }, - { - name: "non-existing file /existing/path/src with mustExist=false with existing directories", - mustExist: false, - prepare: func(tmpdir string) (src string, expectedDst string, err error) { - src = filepath.Join(tmpdir, "existing/path") - if err := os.MkdirAll(src, 0755); err != nil { - return "", "", err - } - src = filepath.Join(src, "src") - return src, src, nil - }, - }, - { - name: "simple symlink /src -> /dst", - mustExist: false, - prepare: func(tmpdir string) (src string, expectedDst string, err error) { - dst := filepath.Join(tmpdir, "dst") - if err = ioutil.WriteFile(dst, []byte{}, 0644); err != nil { - return "", "", err - } - src = filepath.Join(tmpdir, "src") - err = os.Symlink(dst, src) - return src, dst, err - }, - }, - { - name: "dangling symlink /src -> /non-existing-path", - mustExist: true, - prepare: func(tmpdir string) (src string, expectedDst string, err error) { - dst := filepath.Join(tmpdir, "non-existing-path") - src = filepath.Join(tmpdir, "src") - err = os.Symlink(dst, src) - return src, "", err - }, - expectError: true, - }, - { - name: "dangling symlink /src -> /non-existing-path with mustExist=false", - mustExist: false, - prepare: func(tmpdir string) (src string, expectedDst string, err error) { - dst := filepath.Join(tmpdir, "non-existing-path") - src = filepath.Join(tmpdir, "src") - err = os.Symlink(dst, src) - return src, dst, err - }, - }, - { - name: "symlink to directory /src/file, where /src is link to /dst", - mustExist: true, - prepare: func(tmpdir string) (src string, expectedDst string, err error) { - dst := filepath.Join(tmpdir, "dst") - if err = os.Mkdir(dst, 0755); err != nil { - return "", "", err - } - dstFile := filepath.Join(dst, "file") - if err = ioutil.WriteFile(dstFile, []byte{}, 0644); err != nil { - return "", "", err - } - - src = filepath.Join(tmpdir, "src") - if err = os.Symlink(dst, src); err != nil { - return "", "", err - } - srcFile := filepath.Join(src, "file") - return srcFile, dstFile, nil - }, - }, - { - name: "symlink to non-existing directory: /src/file, where /src is link to /dst and dst does not exist", - mustExist: true, - prepare: func(tmpdir string) (src string, expectedDst string, err error) { - dst := filepath.Join(tmpdir, "dst") - - src = filepath.Join(tmpdir, "src") - if err = os.Symlink(dst, src); err != nil { - return "", "", err - } - srcFile := filepath.Join(src, "file") - return srcFile, "", nil - }, - expectError: true, - }, - { - name: "symlink to non-existing directory: /src/file, where /src is link to /dst and dst does not exist with mustExist=false", - mustExist: false, - prepare: func(tmpdir string) (src string, expectedDst string, err error) { - dst := filepath.Join(tmpdir, "dst") - dstFile := filepath.Join(dst, "file") - - src = filepath.Join(tmpdir, "src") - if err = os.Symlink(dst, src); err != nil { - return "", "", err - } - srcFile := filepath.Join(src, "file") - return srcFile, dstFile, nil - }, - }, - } - - for _, test := range tests { - ns := Nsenter{ - hostRootFsPath: "/rootfs", - executor: fakeExec{ - rootfsPath: "/rootfs", - }, - } - - tmpdir, err := ioutil.TempDir("", "nsenter-hostpath-") - if err != nil { - t.Fatal(err) - } - defer os.RemoveAll(tmpdir) - - src, expectedDst, err := test.prepare(tmpdir) - if err != nil { - t.Error(err) - continue - } - - dst, err := ns.EvalSymlinks(src, test.mustExist) - if err != nil && !test.expectError { - t.Errorf("Test %q: unexpected error: %s", test.name, err) - } - if err == nil && test.expectError { - t.Errorf("Test %q: expected error, got none", test.name) - } - if dst != expectedDst { - t.Errorf("Test %q: expected destination %q, got %q", test.name, expectedDst, dst) - } - } -} - -func TestNewNsenter(t *testing.T) { - // Create a symlink /tmp/xyz/rootfs -> / and use it as rootfs path - // It should resolve all binaries correctly, the test runs on Linux - - tmpdir, err := ioutil.TempDir("", "nsenter-hostpath-") - if err != nil { - t.Fatal(err) - } - defer os.RemoveAll(tmpdir) - - rootfs := filepath.Join(tmpdir, "rootfs") - if err = os.Symlink("/", rootfs); err != nil { - t.Fatal(err) - } - - _, err = NewNsenter(rootfs, exec.New()) - if err != nil { - t.Errorf("Error: %s", err) - } -} - -func TestNewNsenterError(t *testing.T) { - // Create empty dir /tmp/xyz/rootfs and use it as rootfs path - // It should resolve all binaries correctly, the test runs on Linux - - tmpdir, err := ioutil.TempDir("", "nsenter-hostpath-") - if err != nil { - t.Fatal(err) - } - defer os.RemoveAll(tmpdir) - - rootfs := filepath.Join(tmpdir, "rootfs") - if err = os.MkdirAll(rootfs, 0755); err != nil { - t.Fatal(err) - } - - _, err = NewNsenter(rootfs, exec.New()) - if err == nil { - t.Errorf("Expected error, got none") - } -} diff --git a/staging/src/BUILD b/staging/src/BUILD index 4f19558e677..730d52d8dde 100644 --- a/staging/src/BUILD +++ b/staging/src/BUILD @@ -103,7 +103,6 @@ filegroup( "//staging/src/k8s.io/apiserver/pkg/util/globalflag:all-srcs", "//staging/src/k8s.io/apiserver/pkg/util/openapi:all-srcs", "//staging/src/k8s.io/apiserver/pkg/util/proxy:all-srcs", - "//staging/src/k8s.io/apiserver/pkg/util/trace:all-srcs", "//staging/src/k8s.io/apiserver/pkg/util/webhook:all-srcs", "//staging/src/k8s.io/apiserver/pkg/util/wsstream:all-srcs", "//staging/src/k8s.io/apiserver/plugin/pkg/audit:all-srcs", @@ -175,14 +174,12 @@ filegroup( "//staging/src/k8s.io/client-go/tools/remotecommand:all-srcs", "//staging/src/k8s.io/client-go/tools/watch:all-srcs", "//staging/src/k8s.io/client-go/transport:all-srcs", - "//staging/src/k8s.io/client-go/util/buffer:all-srcs", "//staging/src/k8s.io/client-go/util/cert:all-srcs", "//staging/src/k8s.io/client-go/util/certificate:all-srcs", "//staging/src/k8s.io/client-go/util/connrotation:all-srcs", "//staging/src/k8s.io/client-go/util/exec:all-srcs", "//staging/src/k8s.io/client-go/util/flowcontrol:all-srcs", "//staging/src/k8s.io/client-go/util/homedir:all-srcs", - "//staging/src/k8s.io/client-go/util/integer:all-srcs", "//staging/src/k8s.io/client-go/util/jsonpath:all-srcs", "//staging/src/k8s.io/client-go/util/retry:all-srcs", "//staging/src/k8s.io/client-go/util/testing:all-srcs", diff --git a/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json b/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json index 400833ef349..5c303ad9b53 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json @@ -1622,10 +1622,6 @@ "ImportPath": "k8s.io/apiserver/pkg/util/openapi", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/apiserver/pkg/util/trace", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/apiserver/pkg/util/webhook", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -2218,10 +2214,6 @@ "ImportPath": "k8s.io/client-go/transport", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/buffer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/client-go/util/cert", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -2238,10 +2230,6 @@ "ImportPath": "k8s.io/client-go/util/homedir", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/integer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/client-go/util/retry", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -2566,6 +2554,18 @@ "ImportPath": "k8s.io/component-base/logs", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, + { + "ImportPath": "k8s.io/utils/buffer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, + { + "ImportPath": "k8s.io/utils/integer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, + { + "ImportPath": "k8s.io/utils/trace", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, { "ImportPath": "sigs.k8s.io/yaml", "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" diff --git a/staging/src/k8s.io/apiserver/Godeps/Godeps.json b/staging/src/k8s.io/apiserver/Godeps/Godeps.json index a9e95a13697..c3ee8cbccda 100644 --- a/staging/src/k8s.io/apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/apiserver/Godeps/Godeps.json @@ -1918,10 +1918,6 @@ "ImportPath": "k8s.io/client-go/transport", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/buffer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/client-go/util/cert", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -1938,10 +1934,6 @@ "ImportPath": "k8s.io/client-go/util/homedir", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/integer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/client-go/util/retry", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -2058,9 +2050,21 @@ "ImportPath": "k8s.io/component-base/logs", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, + { + "ImportPath": "k8s.io/utils/buffer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, + { + "ImportPath": "k8s.io/utils/integer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, { "ImportPath": "k8s.io/utils/pointer", - "Rev": "8e7ff06bf0e2d3289061230af203e430a15b6dcc" + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, + { + "ImportPath": "k8s.io/utils/trace", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" }, { "ImportPath": "sigs.k8s.io/yaml", diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/BUILD b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/BUILD index 734fc9004b2..009a8d4b2e0 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/BUILD +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/BUILD @@ -31,8 +31,8 @@ go_test( "//staging/src/k8s.io/apiserver/pkg/apis/example/v1:go_default_library", "//staging/src/k8s.io/apiserver/pkg/endpoints/request:go_default_library", "//staging/src/k8s.io/apiserver/pkg/registry/rest:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/util/trace:go_default_library", "//vendor/github.com/evanphx/json-patch:go_default_library", + "//vendor/k8s.io/utils/trace:go_default_library", ], ) @@ -82,12 +82,12 @@ go_library( "//staging/src/k8s.io/apiserver/pkg/server/httplog:go_default_library", "//staging/src/k8s.io/apiserver/pkg/util/dryrun:go_default_library", "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/util/trace:go_default_library", "//staging/src/k8s.io/apiserver/pkg/util/wsstream:go_default_library", "//vendor/github.com/evanphx/json-patch:go_default_library", "//vendor/golang.org/x/net/websocket:go_default_library", "//vendor/k8s.io/klog:go_default_library", "//vendor/k8s.io/kube-openapi/pkg/util/proto:go_default_library", + "//vendor/k8s.io/utils/trace:go_default_library", ], ) diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/create.go b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/create.go index 510bdeae7db..c28e44b9539 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/create.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/create.go @@ -36,7 +36,7 @@ import ( "k8s.io/apiserver/pkg/registry/rest" "k8s.io/apiserver/pkg/util/dryrun" utilfeature "k8s.io/apiserver/pkg/util/feature" - utiltrace "k8s.io/apiserver/pkg/util/trace" + utiltrace "k8s.io/utils/trace" ) func createHandler(r rest.NamedCreater, scope RequestScope, admit admission.Interface, includeName bool) http.HandlerFunc { diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/delete.go b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/delete.go index e38e1c2972c..1353ed82503 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/delete.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/delete.go @@ -35,7 +35,7 @@ import ( "k8s.io/apiserver/pkg/registry/rest" "k8s.io/apiserver/pkg/util/dryrun" utilfeature "k8s.io/apiserver/pkg/util/feature" - utiltrace "k8s.io/apiserver/pkg/util/trace" + utiltrace "k8s.io/utils/trace" ) // DeleteResource returns a function that will handle a resource deletion diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/get.go b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/get.go index 1c0950b8d10..cfa8a6872b8 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/get.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/get.go @@ -37,7 +37,7 @@ import ( "k8s.io/apiserver/pkg/endpoints/metrics" "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/apiserver/pkg/registry/rest" - utiltrace "k8s.io/apiserver/pkg/util/trace" + utiltrace "k8s.io/utils/trace" ) // getterFunc performs a get request with the given context and object name. The request diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/patch.go b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/patch.go index 8ca8b47f856..384c276685b 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/patch.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/patch.go @@ -44,7 +44,7 @@ import ( "k8s.io/apiserver/pkg/registry/rest" "k8s.io/apiserver/pkg/util/dryrun" utilfeature "k8s.io/apiserver/pkg/util/feature" - utiltrace "k8s.io/apiserver/pkg/util/trace" + utiltrace "k8s.io/utils/trace" ) // PatchResource returns a function that will handle a resource patch. diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest.go b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest.go index 5d7abf229c3..43b0919452f 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest.go @@ -41,8 +41,8 @@ import ( "k8s.io/apiserver/pkg/endpoints/metrics" "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/apiserver/pkg/registry/rest" - utiltrace "k8s.io/apiserver/pkg/util/trace" openapiproto "k8s.io/kube-openapi/pkg/util/proto" + utiltrace "k8s.io/utils/trace" ) // RequestScope encapsulates common fields across all RESTful handler methods. diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go index 4938e94c30e..d410bc461f4 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go @@ -43,7 +43,7 @@ import ( examplev1 "k8s.io/apiserver/pkg/apis/example/v1" "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/apiserver/pkg/registry/rest" - utiltrace "k8s.io/apiserver/pkg/util/trace" + utiltrace "k8s.io/utils/trace" ) var ( diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/update.go b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/update.go index ad2fc6ef197..9080b9b42b3 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/update.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/update.go @@ -38,7 +38,7 @@ import ( "k8s.io/apiserver/pkg/registry/rest" "k8s.io/apiserver/pkg/util/dryrun" utilfeature "k8s.io/apiserver/pkg/util/feature" - utiltrace "k8s.io/apiserver/pkg/util/trace" + utiltrace "k8s.io/utils/trace" ) // UpdateResource returns a function that will handle a resource update diff --git a/staging/src/k8s.io/apiserver/pkg/storage/cacher/BUILD b/staging/src/k8s.io/apiserver/pkg/storage/cacher/BUILD index af3a14a8fba..cdffbdf0b1d 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/cacher/BUILD +++ b/staging/src/k8s.io/apiserver/pkg/storage/cacher/BUILD @@ -26,9 +26,9 @@ go_library( "//staging/src/k8s.io/apiserver/pkg/features:go_default_library", "//staging/src/k8s.io/apiserver/pkg/storage:go_default_library", "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/util/trace:go_default_library", "//staging/src/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/klog:go_default_library", + "//vendor/k8s.io/utils/trace:go_default_library", ], ) diff --git a/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go b/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go index 008f768ec4a..512a5775bed 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go @@ -39,8 +39,8 @@ import ( "k8s.io/apiserver/pkg/features" "k8s.io/apiserver/pkg/storage" utilfeature "k8s.io/apiserver/pkg/util/feature" - utiltrace "k8s.io/apiserver/pkg/util/trace" "k8s.io/client-go/tools/cache" + utiltrace "k8s.io/utils/trace" ) // Config contains the configuration for a given Cache. diff --git a/staging/src/k8s.io/apiserver/pkg/storage/cacher/watch_cache.go b/staging/src/k8s.io/apiserver/pkg/storage/cacher/watch_cache.go index b11c0c2b1c1..f9729aa44f5 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/cacher/watch_cache.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/cacher/watch_cache.go @@ -29,8 +29,8 @@ import ( "k8s.io/apimachinery/pkg/util/clock" "k8s.io/apimachinery/pkg/watch" "k8s.io/apiserver/pkg/storage" - utiltrace "k8s.io/apiserver/pkg/util/trace" "k8s.io/client-go/tools/cache" + utiltrace "k8s.io/utils/trace" ) const ( diff --git a/staging/src/k8s.io/apiserver/pkg/storage/etcd3/BUILD b/staging/src/k8s.io/apiserver/pkg/storage/etcd3/BUILD index 9ca061e8cac..2d064bac409 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/etcd3/BUILD +++ b/staging/src/k8s.io/apiserver/pkg/storage/etcd3/BUILD @@ -63,11 +63,11 @@ go_library( "//staging/src/k8s.io/apiserver/pkg/storage:go_default_library", "//staging/src/k8s.io/apiserver/pkg/storage/etcd:go_default_library", "//staging/src/k8s.io/apiserver/pkg/storage/value:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/util/trace:go_default_library", "//vendor/github.com/coreos/etcd/clientv3:go_default_library", "//vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes:go_default_library", "//vendor/github.com/coreos/etcd/mvcc/mvccpb:go_default_library", "//vendor/k8s.io/klog:go_default_library", + "//vendor/k8s.io/utils/trace:go_default_library", ], ) diff --git a/staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go b/staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go index 129b593f53b..2413a6674a2 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go @@ -39,7 +39,7 @@ import ( "k8s.io/apiserver/pkg/storage" "k8s.io/apiserver/pkg/storage/etcd" "k8s.io/apiserver/pkg/storage/value" - utiltrace "k8s.io/apiserver/pkg/util/trace" + utiltrace "k8s.io/utils/trace" ) // authenticatedDataString satisfies the value.Context interface. It uses the key to diff --git a/staging/src/k8s.io/cli-runtime/Godeps/Godeps.json b/staging/src/k8s.io/cli-runtime/Godeps/Godeps.json index b1a330cd13d..2f973b487dc 100644 --- a/staging/src/k8s.io/cli-runtime/Godeps/Godeps.json +++ b/staging/src/k8s.io/cli-runtime/Godeps/Godeps.json @@ -562,10 +562,6 @@ "ImportPath": "k8s.io/client-go/util/homedir", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/integer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/klog", "Rev": "8139d8cb77af419532b33dfa7dd09fbc5f1d344f" @@ -614,6 +610,10 @@ "ImportPath": "k8s.io/client-go/util/testing", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, + { + "ImportPath": "k8s.io/utils/integer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, { "ImportPath": "sigs.k8s.io/yaml", "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" diff --git a/staging/src/k8s.io/client-go/Godeps/Godeps.json b/staging/src/k8s.io/client-go/Godeps/Godeps.json index 3d4d25f44eb..fba6a23de66 100644 --- a/staging/src/k8s.io/client-go/Godeps/Godeps.json +++ b/staging/src/k8s.io/client-go/Godeps/Godeps.json @@ -614,6 +614,14 @@ "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "Rev": "ced9eb3070a5f1c548ef46e8dfe2a97c208d9f03" }, + { + "ImportPath": "k8s.io/utils/buffer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, + { + "ImportPath": "k8s.io/utils/integer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, { "ImportPath": "sigs.k8s.io/yaml", "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" diff --git a/staging/src/k8s.io/client-go/tools/cache/BUILD b/staging/src/k8s.io/client-go/tools/cache/BUILD index 8b8b9125855..8609439e558 100644 --- a/staging/src/k8s.io/client-go/tools/cache/BUILD +++ b/staging/src/k8s.io/client-go/tools/cache/BUILD @@ -81,9 +81,9 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library", "//staging/src/k8s.io/client-go/rest:go_default_library", "//staging/src/k8s.io/client-go/tools/pager:go_default_library", - "//staging/src/k8s.io/client-go/util/buffer:go_default_library", "//staging/src/k8s.io/client-go/util/retry:go_default_library", "//vendor/k8s.io/klog:go_default_library", + "//vendor/k8s.io/utils/buffer:go_default_library", ], ) diff --git a/staging/src/k8s.io/client-go/tools/cache/shared_informer.go b/staging/src/k8s.io/client-go/tools/cache/shared_informer.go index e91fc9e9558..b2f3dba07cc 100644 --- a/staging/src/k8s.io/client-go/tools/cache/shared_informer.go +++ b/staging/src/k8s.io/client-go/tools/cache/shared_informer.go @@ -25,8 +25,8 @@ import ( "k8s.io/apimachinery/pkg/util/clock" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/util/buffer" "k8s.io/client-go/util/retry" + "k8s.io/utils/buffer" "k8s.io/klog" ) diff --git a/staging/src/k8s.io/client-go/util/buffer/ring_growing_test.go b/staging/src/k8s.io/client-go/util/buffer/ring_growing_test.go deleted file mode 100644 index 31a4c079d8e..00000000000 --- a/staging/src/k8s.io/client-go/util/buffer/ring_growing_test.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -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. -*/ - -package buffer - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestGrowth(t *testing.T) { - t.Parallel() - x := 10 - g := NewRingGrowing(1) - for i := 0; i < x; i++ { - assert.Equal(t, i, g.readable) - g.WriteOne(i) - } - read := 0 - for g.readable > 0 { - v, ok := g.ReadOne() - assert.True(t, ok) - assert.Equal(t, read, v) - read++ - } - assert.Equalf(t, x, read, "expected to have read %d items: %d", x, read) - assert.Zerof(t, g.readable, "expected readable to be zero: %d", g.readable) - assert.Equalf(t, 16, g.n, "expected N to be 16: %d", g.n) -} - -func TestEmpty(t *testing.T) { - t.Parallel() - g := NewRingGrowing(1) - _, ok := g.ReadOne() - assert.False(t, ok) -} diff --git a/staging/src/k8s.io/client-go/util/flowcontrol/BUILD b/staging/src/k8s.io/client-go/util/flowcontrol/BUILD index a67ac494f0d..526e8db020f 100644 --- a/staging/src/k8s.io/client-go/util/flowcontrol/BUILD +++ b/staging/src/k8s.io/client-go/util/flowcontrol/BUILD @@ -26,8 +26,8 @@ go_library( importpath = "k8s.io/client-go/util/flowcontrol", deps = [ "//staging/src/k8s.io/apimachinery/pkg/util/clock:go_default_library", - "//staging/src/k8s.io/client-go/util/integer:go_default_library", "//vendor/golang.org/x/time/rate:go_default_library", + "//vendor/k8s.io/utils/integer:go_default_library", ], ) diff --git a/staging/src/k8s.io/client-go/util/flowcontrol/backoff.go b/staging/src/k8s.io/client-go/util/flowcontrol/backoff.go index 71d442a62b4..b7cb70ea747 100644 --- a/staging/src/k8s.io/client-go/util/flowcontrol/backoff.go +++ b/staging/src/k8s.io/client-go/util/flowcontrol/backoff.go @@ -21,7 +21,7 @@ import ( "time" "k8s.io/apimachinery/pkg/util/clock" - "k8s.io/client-go/util/integer" + "k8s.io/utils/integer" ) type backoffEntry struct { diff --git a/staging/src/k8s.io/client-go/util/integer/BUILD b/staging/src/k8s.io/client-go/util/integer/BUILD deleted file mode 100644 index 338cd1b8192..00000000000 --- a/staging/src/k8s.io/client-go/util/integer/BUILD +++ /dev/null @@ -1,33 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_test( - name = "go_default_test", - srcs = ["integer_test.go"], - embed = [":go_default_library"], -) - -go_library( - name = "go_default_library", - srcs = ["integer.go"], - importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/util/integer", - importpath = "k8s.io/client-go/util/integer", -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/staging/src/k8s.io/client-go/util/integer/integer_test.go b/staging/src/k8s.io/client-go/util/integer/integer_test.go deleted file mode 100644 index e9f586888c1..00000000000 --- a/staging/src/k8s.io/client-go/util/integer/integer_test.go +++ /dev/null @@ -1,244 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -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. -*/ - -package integer - -import "testing" - -func TestIntMax(t *testing.T) { - tests := []struct { - nums []int - expectedMax int - }{ - { - nums: []int{-1, 0}, - expectedMax: 0, - }, - { - nums: []int{-1, -2}, - expectedMax: -1, - }, - { - nums: []int{0, 1}, - expectedMax: 1, - }, - { - nums: []int{1, 2}, - expectedMax: 2, - }, - } - - for i, test := range tests { - t.Logf("executing scenario %d", i) - if max := IntMax(test.nums[0], test.nums[1]); max != test.expectedMax { - t.Errorf("expected %v, got %v", test.expectedMax, max) - } - } -} - -func TestIntMin(t *testing.T) { - tests := []struct { - nums []int - expectedMin int - }{ - { - nums: []int{-1, 0}, - expectedMin: -1, - }, - { - nums: []int{-1, -2}, - expectedMin: -2, - }, - { - nums: []int{0, 1}, - expectedMin: 0, - }, - { - nums: []int{1, 2}, - expectedMin: 1, - }, - } - - for i, test := range tests { - t.Logf("executing scenario %d", i) - if min := IntMin(test.nums[0], test.nums[1]); min != test.expectedMin { - t.Errorf("expected %v, got %v", test.expectedMin, min) - } - } -} - -func TestInt32Max(t *testing.T) { - tests := []struct { - nums []int32 - expectedMax int32 - }{ - { - nums: []int32{-1, 0}, - expectedMax: 0, - }, - { - nums: []int32{-1, -2}, - expectedMax: -1, - }, - { - nums: []int32{0, 1}, - expectedMax: 1, - }, - { - nums: []int32{1, 2}, - expectedMax: 2, - }, - } - - for i, test := range tests { - t.Logf("executing scenario %d", i) - if max := Int32Max(test.nums[0], test.nums[1]); max != test.expectedMax { - t.Errorf("expected %v, got %v", test.expectedMax, max) - } - } -} - -func TestInt32Min(t *testing.T) { - tests := []struct { - nums []int32 - expectedMin int32 - }{ - { - nums: []int32{-1, 0}, - expectedMin: -1, - }, - { - nums: []int32{-1, -2}, - expectedMin: -2, - }, - { - nums: []int32{0, 1}, - expectedMin: 0, - }, - { - nums: []int32{1, 2}, - expectedMin: 1, - }, - } - - for i, test := range tests { - t.Logf("executing scenario %d", i) - if min := Int32Min(test.nums[0], test.nums[1]); min != test.expectedMin { - t.Errorf("expected %v, got %v", test.expectedMin, min) - } - } -} - -func TestInt64Max(t *testing.T) { - tests := []struct { - nums []int64 - expectedMax int64 - }{ - { - nums: []int64{-1, 0}, - expectedMax: 0, - }, - { - nums: []int64{-1, -2}, - expectedMax: -1, - }, - { - nums: []int64{0, 1}, - expectedMax: 1, - }, - { - nums: []int64{1, 2}, - expectedMax: 2, - }, - } - - for i, test := range tests { - t.Logf("executing scenario %d", i) - if max := Int64Max(test.nums[0], test.nums[1]); max != test.expectedMax { - t.Errorf("expected %v, got %v", test.expectedMax, max) - } - } -} - -func TestInt64Min(t *testing.T) { - tests := []struct { - nums []int64 - expectedMin int64 - }{ - { - nums: []int64{-1, 0}, - expectedMin: -1, - }, - { - nums: []int64{-1, -2}, - expectedMin: -2, - }, - { - nums: []int64{0, 1}, - expectedMin: 0, - }, - { - nums: []int64{1, 2}, - expectedMin: 1, - }, - } - - for i, test := range tests { - t.Logf("executing scenario %d", i) - if min := Int64Min(test.nums[0], test.nums[1]); min != test.expectedMin { - t.Errorf("expected %v, got %v", test.expectedMin, min) - } - } -} - -func TestRoundToInt32(t *testing.T) { - tests := []struct { - num float64 - exp int32 - }{ - { - num: 5.5, - exp: 6, - }, - { - num: -3.7, - exp: -4, - }, - { - num: 3.49, - exp: 3, - }, - { - num: -7.9, - exp: -8, - }, - { - num: -4.499999, - exp: -4, - }, - { - num: 0, - exp: 0, - }, - } - - for i, test := range tests { - t.Logf("executing scenario %d", i) - if got := RoundToInt32(test.num); got != test.exp { - t.Errorf("expected %d, got %d", test.exp, got) - } - } -} diff --git a/staging/src/k8s.io/cloud-provider/Godeps/Godeps.json b/staging/src/k8s.io/cloud-provider/Godeps/Godeps.json index a6cc5d21143..e09d9befdf5 100644 --- a/staging/src/k8s.io/cloud-provider/Godeps/Godeps.json +++ b/staging/src/k8s.io/cloud-provider/Godeps/Godeps.json @@ -930,10 +930,6 @@ "ImportPath": "k8s.io/client-go/transport", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/buffer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/client-go/util/cert", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -946,10 +942,6 @@ "ImportPath": "k8s.io/client-go/util/flowcontrol", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/integer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/client-go/util/retry", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -958,6 +950,14 @@ "ImportPath": "k8s.io/klog", "Rev": "8139d8cb77af419532b33dfa7dd09fbc5f1d344f" }, + { + "ImportPath": "k8s.io/utils/buffer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, + { + "ImportPath": "k8s.io/utils/integer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, { "ImportPath": "sigs.k8s.io/yaml", "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" diff --git a/staging/src/k8s.io/component-base/Godeps/Godeps.json b/staging/src/k8s.io/component-base/Godeps/Godeps.json index 7bf2c4ed9bc..774c215ba52 100644 --- a/staging/src/k8s.io/component-base/Godeps/Godeps.json +++ b/staging/src/k8s.io/component-base/Godeps/Godeps.json @@ -152,7 +152,7 @@ }, { "ImportPath": "k8s.io/utils/pointer", - "Rev": "8e7ff06bf0e2d3289061230af203e430a15b6dcc" + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" } ] } diff --git a/staging/src/k8s.io/csi-api/Godeps/Godeps.json b/staging/src/k8s.io/csi-api/Godeps/Godeps.json index c5019f76964..c476ce1dfcd 100644 --- a/staging/src/k8s.io/csi-api/Godeps/Godeps.json +++ b/staging/src/k8s.io/csi-api/Godeps/Godeps.json @@ -522,10 +522,6 @@ "ImportPath": "k8s.io/client-go/transport", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/buffer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/client-go/util/cert", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -538,10 +534,6 @@ "ImportPath": "k8s.io/client-go/util/flowcontrol", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/integer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/client-go/util/retry", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -554,6 +546,14 @@ "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "Rev": "ced9eb3070a5f1c548ef46e8dfe2a97c208d9f03" }, + { + "ImportPath": "k8s.io/utils/buffer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, + { + "ImportPath": "k8s.io/utils/integer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, { "ImportPath": "sigs.k8s.io/yaml", "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" diff --git a/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json b/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json index 9d47f970bff..bf8d2e15685 100644 --- a/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json +++ b/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json @@ -1214,10 +1214,6 @@ "ImportPath": "k8s.io/apiserver/pkg/util/proxy", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/apiserver/pkg/util/trace", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/apiserver/pkg/util/webhook", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -1778,10 +1774,6 @@ "ImportPath": "k8s.io/client-go/transport", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/buffer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/client-go/util/cert", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -1798,10 +1790,6 @@ "ImportPath": "k8s.io/client-go/util/homedir", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/integer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/client-go/util/retry", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -1842,6 +1830,18 @@ "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "Rev": "ced9eb3070a5f1c548ef46e8dfe2a97c208d9f03" }, + { + "ImportPath": "k8s.io/utils/buffer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, + { + "ImportPath": "k8s.io/utils/integer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, + { + "ImportPath": "k8s.io/utils/trace", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, { "ImportPath": "sigs.k8s.io/yaml", "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" diff --git a/staging/src/k8s.io/kube-controller-manager/Godeps/Godeps.json b/staging/src/k8s.io/kube-controller-manager/Godeps/Godeps.json index 9a685bd0464..7d41706b786 100644 --- a/staging/src/k8s.io/kube-controller-manager/Godeps/Godeps.json +++ b/staging/src/k8s.io/kube-controller-manager/Godeps/Godeps.json @@ -152,7 +152,7 @@ }, { "ImportPath": "k8s.io/utils/pointer", - "Rev": "8e7ff06bf0e2d3289061230af203e430a15b6dcc" + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" } ] } diff --git a/staging/src/k8s.io/kube-proxy/Godeps/Godeps.json b/staging/src/k8s.io/kube-proxy/Godeps/Godeps.json index e95e34a677e..94aa5161252 100644 --- a/staging/src/k8s.io/kube-proxy/Godeps/Godeps.json +++ b/staging/src/k8s.io/kube-proxy/Godeps/Godeps.json @@ -152,7 +152,7 @@ }, { "ImportPath": "k8s.io/utils/pointer", - "Rev": "8e7ff06bf0e2d3289061230af203e430a15b6dcc" + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" } ] } diff --git a/staging/src/k8s.io/kube-scheduler/Godeps/Godeps.json b/staging/src/k8s.io/kube-scheduler/Godeps/Godeps.json index a2d2fa638e7..1532f61221d 100644 --- a/staging/src/k8s.io/kube-scheduler/Godeps/Godeps.json +++ b/staging/src/k8s.io/kube-scheduler/Godeps/Godeps.json @@ -152,7 +152,7 @@ }, { "ImportPath": "k8s.io/utils/pointer", - "Rev": "8e7ff06bf0e2d3289061230af203e430a15b6dcc" + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" } ] } diff --git a/staging/src/k8s.io/metrics/Godeps/Godeps.json b/staging/src/k8s.io/metrics/Godeps/Godeps.json index 502f3806c39..80d6aa9b7c5 100644 --- a/staging/src/k8s.io/metrics/Godeps/Godeps.json +++ b/staging/src/k8s.io/metrics/Godeps/Godeps.json @@ -514,10 +514,6 @@ "ImportPath": "k8s.io/client-go/util/flowcontrol", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/integer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/klog", "Rev": "8139d8cb77af419532b33dfa7dd09fbc5f1d344f" @@ -526,6 +522,10 @@ "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "Rev": "ced9eb3070a5f1c548ef46e8dfe2a97c208d9f03" }, + { + "ImportPath": "k8s.io/utils/integer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, { "ImportPath": "sigs.k8s.io/yaml", "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" diff --git a/staging/src/k8s.io/node-api/Godeps/Godeps.json b/staging/src/k8s.io/node-api/Godeps/Godeps.json index 04b6bc7f610..9607b15f758 100644 --- a/staging/src/k8s.io/node-api/Godeps/Godeps.json +++ b/staging/src/k8s.io/node-api/Godeps/Godeps.json @@ -522,10 +522,6 @@ "ImportPath": "k8s.io/client-go/transport", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/buffer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/client-go/util/cert", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -538,10 +534,6 @@ "ImportPath": "k8s.io/client-go/util/flowcontrol", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/integer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/client-go/util/retry", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -554,6 +546,14 @@ "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "Rev": "ced9eb3070a5f1c548ef46e8dfe2a97c208d9f03" }, + { + "ImportPath": "k8s.io/utils/buffer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, + { + "ImportPath": "k8s.io/utils/integer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, { "ImportPath": "sigs.k8s.io/yaml", "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" diff --git a/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json b/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json index f9c46010c00..b920ad905a8 100644 --- a/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json @@ -1174,10 +1174,6 @@ "ImportPath": "k8s.io/apiserver/pkg/util/openapi", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/apiserver/pkg/util/trace", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/apiserver/pkg/util/webhook", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -1738,10 +1734,6 @@ "ImportPath": "k8s.io/client-go/transport", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/buffer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/client-go/util/cert", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -1758,10 +1750,6 @@ "ImportPath": "k8s.io/client-go/util/homedir", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/integer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/client-go/util/retry", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -1794,6 +1782,18 @@ "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "Rev": "ced9eb3070a5f1c548ef46e8dfe2a97c208d9f03" }, + { + "ImportPath": "k8s.io/utils/buffer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, + { + "ImportPath": "k8s.io/utils/integer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, + { + "ImportPath": "k8s.io/utils/trace", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, { "ImportPath": "sigs.k8s.io/yaml", "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" diff --git a/staging/src/k8s.io/sample-cli-plugin/Godeps/Godeps.json b/staging/src/k8s.io/sample-cli-plugin/Godeps/Godeps.json index b6f37d65788..d881a452c5f 100644 --- a/staging/src/k8s.io/sample-cli-plugin/Godeps/Godeps.json +++ b/staging/src/k8s.io/sample-cli-plugin/Godeps/Godeps.json @@ -566,10 +566,6 @@ "ImportPath": "k8s.io/client-go/util/homedir", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/integer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/client-go/util/jsonpath", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -578,6 +574,10 @@ "ImportPath": "k8s.io/klog", "Rev": "8139d8cb77af419532b33dfa7dd09fbc5f1d344f" }, + { + "ImportPath": "k8s.io/utils/integer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, { "ImportPath": "sigs.k8s.io/yaml", "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" diff --git a/staging/src/k8s.io/sample-controller/Godeps/Godeps.json b/staging/src/k8s.io/sample-controller/Godeps/Godeps.json index b94236dff6f..d3f4b12e983 100644 --- a/staging/src/k8s.io/sample-controller/Godeps/Godeps.json +++ b/staging/src/k8s.io/sample-controller/Godeps/Godeps.json @@ -1122,10 +1122,6 @@ "ImportPath": "k8s.io/client-go/transport", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/buffer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/client-go/util/cert", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -1142,10 +1138,6 @@ "ImportPath": "k8s.io/client-go/util/homedir", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, - { - "ImportPath": "k8s.io/client-go/util/integer", - "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, { "ImportPath": "k8s.io/client-go/util/retry", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @@ -1162,6 +1154,14 @@ "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "Rev": "ced9eb3070a5f1c548ef46e8dfe2a97c208d9f03" }, + { + "ImportPath": "k8s.io/utils/buffer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, + { + "ImportPath": "k8s.io/utils/integer", + "Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7" + }, { "ImportPath": "sigs.k8s.io/yaml", "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" diff --git a/test/e2e/instrumentation/logging/utils/BUILD b/test/e2e/instrumentation/logging/utils/BUILD index 6d1c4dba0fd..b8c5ab7771e 100644 --- a/test/e2e/instrumentation/logging/utils/BUILD +++ b/test/e2e/instrumentation/logging/utils/BUILD @@ -24,9 +24,9 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//staging/src/k8s.io/client-go/kubernetes:go_default_library", - "//staging/src/k8s.io/client-go/util/integer:go_default_library", "//test/e2e/framework:go_default_library", "//test/utils/image:go_default_library", + "//vendor/k8s.io/utils/integer:go_default_library", ], ) diff --git a/test/e2e/instrumentation/logging/utils/logging_agent.go b/test/e2e/instrumentation/logging/utils/logging_agent.go index cf5a98c0ce8..0673fed737b 100644 --- a/test/e2e/instrumentation/logging/utils/logging_agent.go +++ b/test/e2e/instrumentation/logging/utils/logging_agent.go @@ -22,9 +22,9 @@ import ( api_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/util/integer" api "k8s.io/kubernetes/pkg/apis/core" "k8s.io/kubernetes/test/e2e/framework" + "k8s.io/utils/integer" ) // EnsureLoggingAgentDeployment checks that logging agent is present on each diff --git a/vendor/BUILD b/vendor/BUILD index 549798b7581..dfbacdaab8a 100644 --- a/vendor/BUILD +++ b/vendor/BUILD @@ -467,9 +467,14 @@ filegroup( "//vendor/k8s.io/kube-openapi/pkg/handler:all-srcs", "//vendor/k8s.io/kube-openapi/pkg/util:all-srcs", "//vendor/k8s.io/repo-infra/kazel:all-srcs", + "//vendor/k8s.io/utils/buffer:all-srcs", "//vendor/k8s.io/utils/clock:all-srcs", "//vendor/k8s.io/utils/exec:all-srcs", + "//vendor/k8s.io/utils/integer:all-srcs", + "//vendor/k8s.io/utils/io:all-srcs", + "//vendor/k8s.io/utils/nsenter:all-srcs", "//vendor/k8s.io/utils/pointer:all-srcs", + "//vendor/k8s.io/utils/trace:all-srcs", "//vendor/sigs.k8s.io/yaml:all-srcs", "//vendor/vbom.ml/util/sortorder:all-srcs", ], diff --git a/staging/src/k8s.io/client-go/util/buffer/BUILD b/vendor/k8s.io/utils/buffer/BUILD similarity index 50% rename from staging/src/k8s.io/client-go/util/buffer/BUILD rename to vendor/k8s.io/utils/buffer/BUILD index d9496272c8c..0f44f14ad20 100644 --- a/staging/src/k8s.io/client-go/util/buffer/BUILD +++ b/vendor/k8s.io/utils/buffer/BUILD @@ -1,20 +1,13 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["ring_growing.go"], - importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/util/buffer", - importpath = "k8s.io/client-go/util/buffer", + importmap = "k8s.io/kubernetes/vendor/k8s.io/utils/buffer", + importpath = "k8s.io/utils/buffer", visibility = ["//visibility:public"], ) -go_test( - name = "go_default_test", - srcs = ["ring_growing_test.go"], - embed = [":go_default_library"], - deps = ["//vendor/github.com/stretchr/testify/assert:go_default_library"], -) - filegroup( name = "package-srcs", srcs = glob(["**"]), diff --git a/staging/src/k8s.io/client-go/util/buffer/ring_growing.go b/vendor/k8s.io/utils/buffer/ring_growing.go similarity index 100% rename from staging/src/k8s.io/client-go/util/buffer/ring_growing.go rename to vendor/k8s.io/utils/buffer/ring_growing.go diff --git a/vendor/k8s.io/utils/integer/BUILD b/vendor/k8s.io/utils/integer/BUILD new file mode 100644 index 00000000000..09990295153 --- /dev/null +++ b/vendor/k8s.io/utils/integer/BUILD @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["integer.go"], + importmap = "k8s.io/kubernetes/vendor/k8s.io/utils/integer", + importpath = "k8s.io/utils/integer", + visibility = ["//visibility:public"], +) + +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/client-go/util/integer/integer.go b/vendor/k8s.io/utils/integer/integer.go similarity index 81% rename from staging/src/k8s.io/client-go/util/integer/integer.go rename to vendor/k8s.io/utils/integer/integer.go index c6ea106f9b1..e4e740cad4c 100644 --- a/staging/src/k8s.io/client-go/util/integer/integer.go +++ b/vendor/k8s.io/utils/integer/integer.go @@ -16,6 +16,7 @@ limitations under the License. package integer +// IntMax returns the maximum of the params func IntMax(a, b int) int { if b > a { return b @@ -23,6 +24,7 @@ func IntMax(a, b int) int { return a } +// IntMin returns the minimum of the params func IntMin(a, b int) int { if b < a { return b @@ -30,6 +32,7 @@ func IntMin(a, b int) int { return a } +// Int32Max returns the maximum of the params func Int32Max(a, b int32) int32 { if b > a { return b @@ -37,6 +40,7 @@ func Int32Max(a, b int32) int32 { return a } +// Int32Min returns the minimum of the params func Int32Min(a, b int32) int32 { if b < a { return b @@ -44,6 +48,7 @@ func Int32Min(a, b int32) int32 { return a } +// Int64Max returns the maximum of the params func Int64Max(a, b int64) int64 { if b > a { return b @@ -51,6 +56,7 @@ func Int64Max(a, b int64) int64 { return a } +// Int64Min returns the minimum of the params func Int64Min(a, b int64) int64 { if b < a { return b diff --git a/pkg/util/io/BUILD b/vendor/k8s.io/utils/io/BUILD similarity index 57% rename from pkg/util/io/BUILD rename to vendor/k8s.io/utils/io/BUILD index 92e8f2ae785..caf537ddcf1 100644 --- a/pkg/util/io/BUILD +++ b/vendor/k8s.io/utils/io/BUILD @@ -1,14 +1,11 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) +load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["consistentread.go"], - importpath = "k8s.io/kubernetes/pkg/util/io", + importmap = "k8s.io/kubernetes/vendor/k8s.io/utils/io", + importpath = "k8s.io/utils/io", + visibility = ["//visibility:public"], ) filegroup( @@ -22,4 +19,5 @@ filegroup( name = "all-srcs", srcs = [":package-srcs"], tags = ["automanaged"], + visibility = ["//visibility:public"], ) diff --git a/pkg/util/io/consistentread.go b/vendor/k8s.io/utils/io/consistentread.go similarity index 78% rename from pkg/util/io/consistentread.go rename to vendor/k8s.io/utils/io/consistentread.go index 6e1f17b0985..1d79bed3ae9 100644 --- a/pkg/util/io/consistentread.go +++ b/vendor/k8s.io/utils/io/consistentread.go @@ -26,11 +26,21 @@ import ( // This is useful when reading files in /proc that are larger than page size // and kernel may modify them between individual read() syscalls. func ConsistentRead(filename string, attempts int) ([]byte, error) { + return consistentReadSync(filename, attempts, nil) +} + +// consistentReadSync is the main functionality of ConsistentRead but +// introduces a sync callback that can be used by the tests to mutate the file +// from which the test data is being read +func consistentReadSync(filename string, attempts int, sync func(int)) ([]byte, error) { oldContent, err := ioutil.ReadFile(filename) if err != nil { return nil, err } for i := 0; i < attempts; i++ { + if sync != nil { + sync(i) + } newContent, err := ioutil.ReadFile(filename) if err != nil { return nil, err diff --git a/pkg/util/nsenter/BUILD b/vendor/k8s.io/utils/nsenter/BUILD similarity index 82% rename from pkg/util/nsenter/BUILD rename to vendor/k8s.io/utils/nsenter/BUILD index 9a94fae1015..31fa8ba2400 100644 --- a/pkg/util/nsenter/BUILD +++ b/vendor/k8s.io/utils/nsenter/BUILD @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", @@ -8,7 +8,8 @@ go_library( "nsenter.go", "nsenter_unsupported.go", ], - importpath = "k8s.io/kubernetes/pkg/util/nsenter", + importmap = "k8s.io/kubernetes/vendor/k8s.io/utils/nsenter", + importpath = "k8s.io/utils/nsenter", visibility = ["//visibility:public"], deps = select({ "@io_bazel_rules_go//go/platform:android": [ @@ -62,15 +63,3 @@ filegroup( tags = ["automanaged"], visibility = ["//visibility:public"], ) - -go_test( - name = "go_default_test", - srcs = ["nsenter_test.go"], - embed = [":go_default_library"], - deps = select({ - "@io_bazel_rules_go//go/platform:linux": [ - "//vendor/k8s.io/utils/exec:go_default_library", - ], - "//conditions:default": [], - }), -) diff --git a/pkg/util/nsenter/OWNERS b/vendor/k8s.io/utils/nsenter/OWNERS similarity index 80% rename from pkg/util/nsenter/OWNERS rename to vendor/k8s.io/utils/nsenter/OWNERS index 273520d2c73..c4f27cb4381 100644 --- a/pkg/util/nsenter/OWNERS +++ b/vendor/k8s.io/utils/nsenter/OWNERS @@ -2,9 +2,7 @@ reviewers: - jsafrane - msau42 - cofyc - - dixudx approvers: - jsafrane - msau42 - cofyc - - dixudx diff --git a/pkg/util/nsenter/exec.go b/vendor/k8s.io/utils/nsenter/exec.go similarity index 100% rename from pkg/util/nsenter/exec.go rename to vendor/k8s.io/utils/nsenter/exec.go diff --git a/pkg/util/nsenter/exec_unsupported.go b/vendor/k8s.io/utils/nsenter/exec_unsupported.go similarity index 100% rename from pkg/util/nsenter/exec_unsupported.go rename to vendor/k8s.io/utils/nsenter/exec_unsupported.go diff --git a/pkg/util/nsenter/nsenter.go b/vendor/k8s.io/utils/nsenter/nsenter.go similarity index 99% rename from pkg/util/nsenter/nsenter.go rename to vendor/k8s.io/utils/nsenter/nsenter.go index 56361e7846e..13532f06339 100644 --- a/pkg/util/nsenter/nsenter.go +++ b/vendor/k8s.io/utils/nsenter/nsenter.go @@ -26,9 +26,8 @@ import ( "path/filepath" "strings" - "k8s.io/utils/exec" - "k8s.io/klog" + "k8s.io/utils/exec" ) const ( diff --git a/pkg/util/nsenter/nsenter_unsupported.go b/vendor/k8s.io/utils/nsenter/nsenter_unsupported.go similarity index 100% rename from pkg/util/nsenter/nsenter_unsupported.go rename to vendor/k8s.io/utils/nsenter/nsenter_unsupported.go diff --git a/staging/src/k8s.io/apiserver/pkg/util/trace/BUILD b/vendor/k8s.io/utils/trace/BUILD similarity index 59% rename from staging/src/k8s.io/apiserver/pkg/util/trace/BUILD rename to vendor/k8s.io/utils/trace/BUILD index 4e93ff5b498..a099049be13 100644 --- a/staging/src/k8s.io/apiserver/pkg/util/trace/BUILD +++ b/vendor/k8s.io/utils/trace/BUILD @@ -1,15 +1,11 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) +load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["trace.go"], - importmap = "k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/util/trace", - importpath = "k8s.io/apiserver/pkg/util/trace", + importmap = "k8s.io/kubernetes/vendor/k8s.io/utils/trace", + importpath = "k8s.io/utils/trace", + visibility = ["//visibility:public"], deps = ["//vendor/k8s.io/klog:go_default_library"], ) @@ -24,4 +20,5 @@ filegroup( name = "all-srcs", srcs = [":package-srcs"], tags = ["automanaged"], + visibility = ["//visibility:public"], ) diff --git a/staging/src/k8s.io/apiserver/pkg/util/trace/trace.go b/vendor/k8s.io/utils/trace/trace.go similarity index 85% rename from staging/src/k8s.io/apiserver/pkg/util/trace/trace.go rename to vendor/k8s.io/utils/trace/trace.go index 9049a17d0de..3a1ecfc7150 100644 --- a/staging/src/k8s.io/apiserver/pkg/util/trace/trace.go +++ b/vendor/k8s.io/utils/trace/trace.go @@ -30,16 +30,20 @@ type traceStep struct { msg string } +// Trace keeps track of a set of "steps" and allows us to log a specific +// step if it took longer than its share of the total allowed time type Trace struct { name string startTime time.Time steps []traceStep } +// New creates a Trace with the specified name func New(name string) *Trace { return &Trace{name, time.Now(), nil} } +// Step adds a new step with a specific message func (t *Trace) Step(msg string) { if t.steps == nil { // traces almost always have less than 6 steps, do this to avoid more than a single allocation @@ -48,6 +52,7 @@ func (t *Trace) Step(msg string) { t.steps = append(t.steps, traceStep{time.Now(), msg}) } +// Log is used to dump all the steps in the Trace func (t *Trace) Log() { // an explicit logging request should dump all the steps out at the higher level t.logWithStepThreshold(0) @@ -76,6 +81,7 @@ func (t *Trace) logWithStepThreshold(stepThreshold time.Duration) { klog.Info(buffer.String()) } +// LogIfLong is used to dump steps that took longer than its share func (t *Trace) LogIfLong(threshold time.Duration) { if time.Since(t.startTime) >= threshold { // if any step took more than it's share of the total allowed time, it deserves a higher log level @@ -84,6 +90,7 @@ func (t *Trace) LogIfLong(threshold time.Duration) { } } +// TotalTime can be used to figure out how long it took since the Trace was created func (t *Trace) TotalTime() time.Duration { return time.Since(t.startTime) }