diff --git a/.github/workflows/shellcheck.yaml b/.github/workflows/shellcheck.yaml new file mode 100644 index 00000000000..941c3f8867c --- /dev/null +++ b/.github/workflows/shellcheck.yaml @@ -0,0 +1,18 @@ +# Controls when the workflow will run +on: + # Triggers the workflow on pull request events but only for the main branch + pull_request: + branches: [ master ] + +name: 'Trigger: Push action' + +jobs: + shellcheck: + name: Shellcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@master + env: + SHELLCHECK_OPTS: -e SC2046 -e SC1091 -e SC2086 -e SC2090 -e SC2089 diff --git a/.github/workflows/kes.yml b/.github/workflows/tenant-kes.yml similarity index 80% rename from .github/workflows/kes.yml rename to .github/workflows/tenant-kes.yml index 04090679e12..52da8191c43 100644 --- a/.github/workflows/kes.yml +++ b/.github/workflows/tenant-kes.yml @@ -36,12 +36,4 @@ jobs: # Runs a set of commands using the runners shell - name: Deploy a MinIO Tenant with KES via Operator UI run: | - curl -sLO "https://dl.k8s.io/release/v1.23.1/bin/linux/amd64/kubectl" -o kubectl - chmod +x kubectl - mv kubectl /usr/local/bin - - curl -sLO "https://dl.min.io/client/mc/release/linux-amd64/mc" -o mc - chmod +x mc - mv mc /usr/local/bin - "${GITHUB_WORKSPACE}/testing/console-tenant+kes.sh" diff --git a/.github/workflows/logs.yaml b/.github/workflows/tenant-logs.yml similarity index 88% rename from .github/workflows/logs.yaml rename to .github/workflows/tenant-logs.yml index 96fd833b385..947ab73f828 100644 --- a/.github/workflows/logs.yaml +++ b/.github/workflows/tenant-logs.yml @@ -36,7 +36,4 @@ jobs: # Runs a set of commands using the runners shell - name: Logs test on Kind run: | - curl -sLO "https://dl.k8s.io/release/v1.23.1/bin/linux/amd64/kubectl" -o kubectl - chmod +x kubectl - mv kubectl /usr/local/bin "${GITHUB_WORKSPACE}/testing/check-logs.sh" diff --git a/.github/workflows/prometheus.yaml b/.github/workflows/tenant-prometheus.yml similarity index 89% rename from .github/workflows/prometheus.yaml rename to .github/workflows/tenant-prometheus.yml index 2ab9277fd5f..23249648374 100644 --- a/.github/workflows/prometheus.yaml +++ b/.github/workflows/tenant-prometheus.yml @@ -36,7 +36,4 @@ jobs: # Runs a set of commands using the runners shell - name: Prometheus test on Kind run: | - curl -sLO "https://dl.k8s.io/release/v1.23.1/bin/linux/amd64/kubectl" -o kubectl - chmod +x kubectl - mv kubectl /usr/local/bin "${GITHUB_WORKSPACE}/testing/check-prometheus.sh" diff --git a/.github/workflows/bash.yml b/.github/workflows/tenant.yml similarity index 89% rename from .github/workflows/bash.yml rename to .github/workflows/tenant.yml index 7117bc58262..75a4c35fe7e 100644 --- a/.github/workflows/bash.yml +++ b/.github/workflows/tenant.yml @@ -36,7 +36,4 @@ jobs: # Runs a set of commands using the runners shell - name: Deploy a MinIO Tenant on Kind run: | - curl -sLO "https://dl.k8s.io/release/v1.23.1/bin/linux/amd64/kubectl" -o kubectl - chmod +x kubectl - mv kubectl /usr/local/bin "${GITHUB_WORKSPACE}/testing/deploy-tenant.sh" diff --git a/.golangci.yml b/.golangci.yml index fe913319d6c..e9023974c0e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -18,11 +18,11 @@ linters: - deadcode - structcheck - gomodguard - - gofmt - unused - structcheck - unconvert - varcheck + - gofumpt issues: exclude-use-default: false @@ -37,4 +37,4 @@ issues: - deadcode service: - golangci-lint-version: 1.42.0 # use the fixed version to not introduce new linters unexpectedly + golangci-lint-version: 1.43.0 # use the fixed version to not introduce new linters unexpectedly diff --git a/CREDITS b/CREDITS index e22cebf0ada..94491d95ec0 100644 --- a/CREDITS +++ b/CREDITS @@ -2159,6 +2159,33 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================================ +github.com/dustin/go-humanize +https://github.com/dustin/go-humanize +---------------------------------------------------------------- +Copyright (c) 2005-2008 Dustin Sallings + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + + +================================================================ + github.com/emicklei/go-restful https://github.com/emicklei/go-restful ---------------------------------------------------------------- @@ -5211,129 +5238,427 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================================ -github.com/klauspost/cpuid -https://github.com/klauspost/cpuid +github.com/klauspost/compress +https://github.com/klauspost/compress ---------------------------------------------------------------- -The MIT License (MIT) +Copyright (c) 2012 The Go Authors. All rights reserved. +Copyright (c) 2019 Klaus Post. All rights reserved. -Copyright (c) 2015 Klaus Post +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +------------------ +Files: gzhttp/* -================================================================ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -github.com/klauspost/cpuid/v2 -https://github.com/klauspost/cpuid/v2 ----------------------------------------------------------------- -The MIT License (MIT) + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -Copyright (c) 2015 Klaus Post + 1. Definitions. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + "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. -github.com/kr/text -https://github.com/kr/text ----------------------------------------------------------------- -Copyright 2012 Keith Rarick + "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. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + "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). -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + "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. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. + "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. -github.com/lestrrat-go/backoff/v2 -https://github.com/lestrrat-go/backoff/v2 ----------------------------------------------------------------- -MIT License + 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. -Copyright (c) 2018 lestrrat + 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. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + 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: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + (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 -github.com/lestrrat-go/blackmagic -https://github.com/lestrrat-go/blackmagic ----------------------------------------------------------------- -MIT License + (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. -Copyright (c) 2021 lestrrat-go + 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. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + 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. -The above copyright notice and this permission notice shall be included in all + 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 2016-2017 The New York Times Company + + 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. + +------------------ + +Files: s2/cmd/internal/readahead/* + +The MIT License (MIT) + +Copyright (c) 2015 Klaus Post + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--------------------- +Files: snappy/* +Files: internal/snapref/* + +Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +================================================================ + +github.com/klauspost/cpuid +https://github.com/klauspost/cpuid +---------------------------------------------------------------- +The MIT License (MIT) + +Copyright (c) 2015 Klaus Post + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +================================================================ + +github.com/klauspost/cpuid/v2 +https://github.com/klauspost/cpuid/v2 +---------------------------------------------------------------- +The MIT License (MIT) + +Copyright (c) 2015 Klaus Post + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +================================================================ + +github.com/kr/text +https://github.com/kr/text +---------------------------------------------------------------- +Copyright 2012 Keith Rarick + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +================================================================ + +github.com/lestrrat-go/backoff/v2 +https://github.com/lestrrat-go/backoff/v2 +---------------------------------------------------------------- +MIT License + +Copyright (c) 2018 lestrrat + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +================================================================ + +github.com/lestrrat-go/blackmagic +https://github.com/lestrrat-go/blackmagic +---------------------------------------------------------------- +MIT License + +Copyright (c) 2021 lestrrat-go + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR @@ -5407,96 +5732,304 @@ The MIT License (MIT) Copyright (c) 2015 lestrrat -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +================================================================ + +github.com/lestrrat-go/option +https://github.com/lestrrat-go/option +---------------------------------------------------------------- +MIT License + +Copyright (c) 2021 lestrrat-go + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +================================================================ + +github.com/lestrrat-go/pdebug/v3 +https://github.com/lestrrat-go/pdebug/v3 +---------------------------------------------------------------- +The MIT License (MIT) + +Copyright (c) 2016 lestrrat + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +================================================================ + +github.com/mailru/easyjson +https://github.com/mailru/easyjson +---------------------------------------------------------------- +Copyright (c) 2016 Mail.Ru Group + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +================================================================ + +github.com/minio/madmin-go +https://github.com/minio/madmin-go +---------------------------------------------------------------- + + 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. -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + 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. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + 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 -github.com/lestrrat-go/option -https://github.com/lestrrat-go/option ----------------------------------------------------------------- -MIT License + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and -Copyright (c) 2021 lestrrat-go + (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 -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + (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. -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + 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. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + 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. -github.com/lestrrat-go/pdebug/v3 -https://github.com/lestrrat-go/pdebug/v3 ----------------------------------------------------------------- -The MIT License (MIT) + 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. -Copyright (c) 2016 lestrrat + 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. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + 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. -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + END OF TERMS AND CONDITIONS -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + 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. -github.com/mailru/easyjson -https://github.com/mailru/easyjson ----------------------------------------------------------------- -Copyright (c) 2016 Mail.Ru Group + Copyright [yyyy] [name of copyright owner] -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + 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 -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + http://www.apache.org/licenses/LICENSE-2.0 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + 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. ================================================================ -github.com/minio/madmin-go -https://github.com/minio/madmin-go +github.com/minio/md5-simd +https://github.com/minio/md5-simd ---------------------------------------------------------------- Apache License @@ -8064,86 +8597,20 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -================================================================ - -github.com/shirou/gopsutil -https://github.com/shirou/gopsutil ----------------------------------------------------------------- -gopsutil is distributed under BSD license reproduced below. - -Copyright (c) 2014, WAKAYAMA Shirou -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the gopsutil authors nor the names of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -------- -internal/common/binary.go in the gopsutil is copied and modifid from golang/encoding/binary.go. - - - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================================ github.com/shirou/gopsutil/v3 @@ -8212,6 +8679,33 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================================ +github.com/sirupsen/logrus +https://github.com/sirupsen/logrus +---------------------------------------------------------------- +The MIT License (MIT) + +Copyright (c) 2014 Simon Eskildsen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +================================================================ + github.com/smartystreets/assertions https://github.com/smartystreets/assertions ---------------------------------------------------------------- @@ -10967,245 +11461,48 @@ https://k8s.io/gengo 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 2014 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. - -================================================================ - -k8s.io/klog -https://k8s.io/klog ----------------------------------------------------------------- -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: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -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 -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. + 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. -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. + 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 + END OF TERMS AND CONDITIONS -APPENDIX: How to apply the Apache License to your work + 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. + 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] + Copyright 2014 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 + 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, @@ -12035,213 +12332,6 @@ https://sigs.k8s.io/controller-runtime ================================================================ -sigs.k8s.io/structured-merge-diff -https://sigs.k8s.io/structured-merge-diff ----------------------------------------------------------------- - 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. - -================================================================ - sigs.k8s.io/structured-merge-diff/v4 https://sigs.k8s.io/structured-merge-diff/v4 ---------------------------------------------------------------- diff --git a/Makefile b/Makefile index e27f8b1f502..21c876b8d9c 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ all: build logsearchapi getdeps: @echo "Checking dependencies" @mkdir -p ${GOPATH}/bin - @which golangci-lint 1>/dev/null || (echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.42.0) + @which golangci-lint 1>/dev/null || (echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.43.0) verify: getdeps govet gotest lint diff --git a/examples/kustomization/base/tenant.yaml b/examples/kustomization/base/tenant.yaml index 5d2eeee1fa6..b050c038126 100644 --- a/examples/kustomization/base/tenant.yaml +++ b/examples/kustomization/base/tenant.yaml @@ -170,7 +170,7 @@ spec: image: "" # defaults to quay.io/prometheus/prometheus:latest sidecarimage: "" # defaults to alpine initimage: "" # defaults to busybox:1.33.1 - diskCapacityGB: 10 + diskCapacityGB: 1 storageClassName: standard annotations: { } labels: { } @@ -203,7 +203,7 @@ spec: annotations: { } labels: { } audit: - diskCapacityGB: 10 + diskCapacityGB: 1 ## Postgres setup for LogSearch API db: image: "" # defaults to library/postgres @@ -216,7 +216,7 @@ spec: - ReadWriteOnce resources: requests: - storage: 10Gi + storage: 1Gi resources: { } nodeSelector: { } affinity: diff --git a/examples/kustomization/tenant-lite/tenant.yaml b/examples/kustomization/tenant-lite/tenant.yaml index 64bfaeadd75..22245b413df 100644 --- a/examples/kustomization/tenant-lite/tenant.yaml +++ b/examples/kustomization/tenant-lite/tenant.yaml @@ -21,4 +21,4 @@ spec: - ReadWriteOnce resources: requests: - storage: 10Gi + storage: 2Gi diff --git a/examples/kustomization/tenant-tiny/tenant.yaml b/examples/kustomization/tenant-tiny/tenant.yaml index 0d41c8f1034..eeea9d079b5 100644 --- a/examples/kustomization/tenant-tiny/tenant.yaml +++ b/examples/kustomization/tenant-tiny/tenant.yaml @@ -22,4 +22,4 @@ spec: - ReadWriteOnce resources: requests: - storage: 10Gi \ No newline at end of file + storage: 2Gi diff --git a/go.mod b/go.mod index 31efd59a10d..858ba8ca552 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,6 @@ require ( github.com/prometheus-operator/prometheus-operator/pkg/client v0.46.0 github.com/stretchr/testify v1.7.0 golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e - gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.20.2 k8s.io/apiextensions-apiserver v0.20.2 k8s.io/apimachinery v0.20.2 @@ -23,6 +22,7 @@ require ( k8s.io/code-generator v0.20.2 k8s.io/klog/v2 v2.4.0 sigs.k8s.io/controller-runtime v0.8.0 + sigs.k8s.io/yaml v1.2.0 ) require ( @@ -106,10 +106,10 @@ require ( gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.57.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect k8s.io/gengo v0.0.0-20201113003025-83324d819ded // indirect k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd // indirect k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.0.2 // indirect - sigs.k8s.io/yaml v1.2.0 // indirect ) diff --git a/k8s/update-codegen.sh b/k8s/update-codegen.sh index 3e1caf0fffd..b66cbd19462 100755 --- a/k8s/update-codegen.sh +++ b/k8s/update-codegen.sh @@ -9,7 +9,8 @@ ROOT_PKG=github.com/minio/operator # Grab code-generator version from go.sum CODEGEN_VERSION=$(grep 'k8s.io/code-generator' go.mod | awk '{print $2}' | sed 's/\/go.mod//g' | head -1) -CODEGEN_PKG=$(echo `go env GOPATH`"/pkg/mod/k8s.io/code-generator@${CODEGEN_VERSION}") +GOPATH=$(go env GOPATH) +CODEGEN_PKG="${GOPATH}/pkg/mod/k8s.io/code-generator@${CODEGEN_VERSION}" if [[ ! -d ${CODEGEN_PKG} ]]; then echo "${CODEGEN_PKG} is missing. Running 'go mod download'." @@ -34,7 +35,6 @@ echo ">> Temporary output directory ${TEMP_DIR}" # Ensure we can execute. chmod +x ${CODEGEN_PKG}/generate-groups.sh - # generate the code with: # --output-base because this script should also be able to run inside the vendor dir of # k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir diff --git a/kubectl-minio/cmd/init.go b/kubectl-minio/cmd/init.go index cee9b43d498..561951c7cf7 100644 --- a/kubectl-minio/cmd/init.go +++ b/kubectl-minio/cmd/init.go @@ -231,7 +231,6 @@ func (o *operatorInitCmd) run(writer io.Writer) error { } if o.operatorOpts.ConsoleImage != "" { - kustomizationYaml.PatchesJson6902 = append(kustomizationYaml.PatchesJson6902, types.Patch{ Patch: o.serializeJSONPachOps([]interface{}{ opStr{ diff --git a/kubectl-minio/cmd/kubectl-minio.go b/kubectl-minio/cmd/kubectl-minio.go index 6a4689b944a..5849f66d3dc 100644 --- a/kubectl-minio/cmd/kubectl-minio.go +++ b/kubectl-minio/cmd/kubectl-minio.go @@ -33,18 +33,19 @@ const ( kubeconfig = "kubeconfig" ) -var confPath string -var rootCmd = &cobra.Command{ - Use: "minio", - Long: minioDesc, - SilenceUsage: true, -} +var ( + confPath string + rootCmd = &cobra.Command{ + Use: "minio", + Long: minioDesc, + SilenceUsage: true, + } +) func init() { rootCmd.PersistentFlags().StringVar(&confPath, kubeconfig, "", "Custom kubeconfig path") log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile) - } // New creates a new root command for kubectl-minio diff --git a/kubectl-minio/cmd/proxy.go b/kubectl-minio/cmd/proxy.go index 8ef129a206f..52ce066b9f5 100644 --- a/kubectl-minio/cmd/proxy.go +++ b/kubectl-minio/cmd/proxy.go @@ -73,7 +73,6 @@ func newProxyCmd(out io.Writer, errOut io.Writer) *cobra.Command { // run initializes local config and installs MinIO Operator to Kubernetes cluster. func (o *operatorProxyCmd) run() error { - ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -158,8 +157,8 @@ func servicePortForwardPort(ctx context.Context, namespace, service, port string log.Printf("failed to capture stdout or stderr\n") return } - //outStr, errStr := string(stdout), string(stderr) - //fmt.Printf("\nout:\n%s\nerr:\n%s\n", outStr, errStr) + // outStr, errStr := string(stdout), string(stderr) + // fmt.Printf("\nout:\n%s\nerr:\n%s\n", outStr, errStr) }() return ch } @@ -176,7 +175,6 @@ func copyAndCapture(r io.Reader, dcolor color.Attribute) error { theColor := color.New(dcolor) //_, err := w.Write(d) _, err := theColor.Print(string(d)) - if err != nil { return err } diff --git a/kubectl-minio/cmd/resources/common.go b/kubectl-minio/cmd/resources/common.go index 985a670f3ed..89789e82df8 100644 --- a/kubectl-minio/cmd/resources/common.go +++ b/kubectl-minio/cmd/resources/common.go @@ -101,7 +101,6 @@ func Pool(opts *TenantOptions, volumes int32, q resource.Quantity) miniov2.Pool // GetSchemeDecoder returns a decoder for the scheme's that we use func GetSchemeDecoder() func(data []byte, defaults *schema.GroupVersionKind, into runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) { - sch := runtime.NewScheme() scheme.AddToScheme(sch) apiextensionv1.AddToScheme(sch) diff --git a/logsearchapi/server/query.go b/logsearchapi/server/query.go index 72f6e5087d7..e751f55fc66 100644 --- a/logsearchapi/server/query.go +++ b/logsearchapi/server/query.go @@ -106,7 +106,7 @@ func searchQueryFromRequest(r *http.Request) (*SearchQuery, error) { timeEnd = &ts } - var pageSize = 10 + pageSize := 10 if psParam := values.Get("pageSize"); psParam != "" { pageSize, err = strconv.Atoi(psParam) if err != nil { diff --git a/pkg/apis/minio.min.io/v1/helper.go b/pkg/apis/minio.min.io/v1/helper.go index a7f606713d7..833012206dc 100644 --- a/pkg/apis/minio.min.io/v1/helper.go +++ b/pkg/apis/minio.min.io/v1/helper.go @@ -185,7 +185,7 @@ func ExtractTar(filesToExtract []string, basePath, tarFileName string) error { tr = tar.NewReader(gz) } - var success = len(filesToExtract) + success := len(filesToExtract) for { header, err := tr.Next() if errors.Is(err, io.EOF) { @@ -200,7 +200,7 @@ func ExtractTar(filesToExtract []string, basePath, tarFileName string) error { } if header.Typeflag == tar.TypeReg { if name := find(filesToExtract, header.Name); name != "" { - outFile, err := os.OpenFile(basePath+path.Base(name), os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0777) + outFile, err := os.OpenFile(basePath+path.Base(name), os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o777) if err != nil { return fmt.Errorf("Tar file extraction failed while opening file: %s, at index: %d, with: %w", name, success, err) } diff --git a/pkg/apis/minio.min.io/v2/helper.go b/pkg/apis/minio.min.io/v2/helper.go index 7da6b96ca74..cdd886f14aa 100644 --- a/pkg/apis/minio.min.io/v2/helper.go +++ b/pkg/apis/minio.min.io/v2/helper.go @@ -249,7 +249,7 @@ func ExtractTar(filesToExtract []string, basePath, tarFileName string) error { tr = tar.NewReader(gz) } - var success = len(filesToExtract) + success := len(filesToExtract) for { header, err := tr.Next() if errors.Is(err, io.EOF) { @@ -264,7 +264,7 @@ func ExtractTar(filesToExtract []string, basePath, tarFileName string) error { } if header.Typeflag == tar.TypeReg { if name := find(filesToExtract, header.Name); name != "" { - outFile, err := os.OpenFile(basePath+path.Base(name), os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0777) + outFile, err := os.OpenFile(basePath+path.Base(name), os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o777) if err != nil { return fmt.Errorf("Tar file extraction failed while opening file: %s, at index: %d, with: %w", name, success, err) } diff --git a/pkg/controller/cluster/artifacts.go b/pkg/controller/cluster/artifacts.go index 473b355f989..1870b7fe76e 100644 --- a/pkg/controller/cluster/artifacts.go +++ b/pkg/controller/cluster/artifacts.go @@ -164,7 +164,7 @@ func (c *Controller) fetchArtifacts(tenant *miniov2.Tenant) (latest time.Time, e } } - f, err := os.OpenFile(basePath+"image.tar", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0777) + f, err := os.OpenFile(basePath+"image.tar", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o777) if err != nil { return latest, err } diff --git a/pkg/controller/cluster/console.go b/pkg/controller/cluster/console.go index 608c21ab250..f06a3f67ce1 100644 --- a/pkg/controller/cluster/console.go +++ b/pkg/controller/cluster/console.go @@ -32,7 +32,6 @@ import ( // checkConsoleSvc validates the existence of the MinIO service and validate it's status against what the specification // states func (c *Controller) checkConsoleSvc(ctx context.Context, tenant *miniov2.Tenant, nsName types.NamespacedName) error { - // Handle the Internal ClusterIP Service for Tenant svc, err := c.serviceLister.Services(tenant.Namespace).Get(tenant.ConsoleCIServiceName()) if err != nil { diff --git a/pkg/controller/cluster/http_handlers.go b/pkg/controller/cluster/http_handlers.go index 9f1176069e7..b4a86a1c91f 100644 --- a/pkg/controller/cluster/http_handlers.go +++ b/pkg/controller/cluster/http_handlers.go @@ -52,7 +52,6 @@ const ( // BucketSrvHandler - POST /webhook/v1/bucketsrv/{namespace}/{name}?bucket={bucket} func (c *Controller) BucketSrvHandler(w http.ResponseWriter, r *http.Request) { - vars := mux.Vars(r) v := r.URL.Query() @@ -207,7 +206,6 @@ func (c *Controller) GetenvHandler(w http.ResponseWriter, r *http.Request) { // CRDConversionHandler - POST /webhook/v1/crd-conversion func (c *Controller) CRDConversionHandler(w http.ResponseWriter, r *http.Request) { - dec := json.NewDecoder(r.Body) var req v1.ConversionReview @@ -236,7 +234,7 @@ func (c *Controller) CRDConversionHandler(w http.ResponseWriter, r *http.Request case "v1": // cast to v1 - //tenantV1 := obj.Object.(*miniov1.Tenant) + // tenantV1 := obj.Object.(*miniov1.Tenant) tenantV1 := miniov1.Tenant{} // convert the runtime.Object to unstructured.Unstructured @@ -257,7 +255,7 @@ func (c *Controller) CRDConversionHandler(w http.ResponseWriter, r *http.Request req.Response.ConvertedObjects = append(req.Response.ConvertedObjects, runtime.RawExtension{Object: &tenantV1}) case "minio.min.io/v2": tenantV2 := miniov2.Tenant{} - //convert to v2 + // convert to v2 if err := tenantV1.ConvertTo(&tenantV2); err != nil { log.Println(err) w.WriteHeader(500) @@ -289,7 +287,7 @@ func (c *Controller) CRDConversionHandler(w http.ResponseWriter, r *http.Request switch req.Request.DesiredAPIVersion { case "minio.min.io/v1": - //convert to v1 + // convert to v1 var tenantV1 miniov1.Tenant if err := tenantV1.ConvertFrom(&tenantV2); err != nil { log.Println(err) @@ -316,5 +314,4 @@ func (c *Controller) CRDConversionHandler(w http.ResponseWriter, r *http.Request if _, err := w.Write(rawResp); err != nil { log.Println(err) } - } diff --git a/pkg/controller/cluster/main-controller.go b/pkg/controller/cluster/main-controller.go index 62224c6b51c..8d08658f52c 100644 --- a/pkg/controller/cluster/main-controller.go +++ b/pkg/controller/cluster/main-controller.go @@ -200,7 +200,6 @@ type Controller struct { // NewController returns a new sample controller func NewController(podName string, namespacesToWatch set.StringSet, kubeClientSet kubernetes.Interface, minioClientSet clientset.Interface, promClient promclientset.Interface, statefulSetInformer appsinformers.StatefulSetInformer, deploymentInformer appsinformers.DeploymentInformer, podInformer coreinformers.PodInformer, jobInformer batchinformers.JobInformer, tenantInformer informers.TenantInformer, serviceInformer coreinformers.ServiceInformer, hostsTemplate, operatorVersion string) *Controller { - // Create event broadcaster // Add minio-controller types to the default Kubernetes Scheme so Events can be // logged for minio-controller types. @@ -340,7 +339,6 @@ func (c *Controller) Start(threadiness int, stopCh <-chan struct{}) error { apiWillStart := make(chan interface{}) go func() { - // Request kubernetes version from Kube ApiServer c.getKubeAPIServerVersion() @@ -792,7 +790,7 @@ func (c *Controller) syncHandler(key string) error { } // Check if this is fresh setup not an expansion. - //addingNewPool := len(tenant.Spec.Pools) == len(tenant.Status.Pools) + // addingNewPool := len(tenant.Spec.Pools) == len(tenant.Status.Pools) addingNewPool := false // count the number of initialized pools, if at least 1 is not Initialized, we are still adding a new pool for _, poolStatus := range tenant.Status.Pools { @@ -1121,7 +1119,6 @@ func (c *Controller) syncHandler(key string) error { return err } if pool.Servers != *ss.Spec.Replicas { - // warn the user that replica count of an existing pool can't be changed if tenant, err = c.updateTenantStatus(ctx, tenant, fmt.Sprintf("Can't modify server count for pool %s", pool.Name), 0); err != nil { return err diff --git a/pkg/controller/cluster/minio-services.go b/pkg/controller/cluster/minio-services.go index ef2453a3137..b1a9248d85b 100644 --- a/pkg/controller/cluster/minio-services.go +++ b/pkg/controller/cluster/minio-services.go @@ -32,7 +32,6 @@ import ( // checkMinIOSvc validates the existence of the MinIO service and validate it's status against what the specification // states func (c *Controller) checkMinIOSvc(ctx context.Context, tenant *miniov2.Tenant, nsName types.NamespacedName) error { - // Handle the Internal ClusterIP Service for Tenant svc, err := c.serviceLister.Services(tenant.Namespace).Get(tenant.MinIOCIServiceName()) if err != nil { diff --git a/pkg/controller/cluster/minio.go b/pkg/controller/cluster/minio.go index 0717332e228..a50c2210e64 100644 --- a/pkg/controller/cluster/minio.go +++ b/pkg/controller/cluster/minio.go @@ -348,7 +348,6 @@ func (c *Controller) createMinIOClientCSR(ctx context.Context, tenant *miniov2.T } func (c *Controller) deleteOldConsoleDeployment(ctx context.Context, tenant *miniov2.Tenant, consoleDeployment string) error { - err := c.kubeClientSet.AppsV1().Deployments(tenant.Namespace).Delete(ctx, consoleDeployment, metav1.DeleteOptions{}) if err != nil { klog.V(2).Infof(err.Error()) diff --git a/pkg/controller/cluster/monitoring.go b/pkg/controller/cluster/monitoring.go index afe75f275cc..8c1380b63c6 100644 --- a/pkg/controller/cluster/monitoring.go +++ b/pkg/controller/cluster/monitoring.go @@ -74,7 +74,6 @@ func (c *Controller) recurrentTenantStatusMonitor(stopCh <-chan struct{}) { return } } - } func (c *Controller) tenantsHealthMonitor() error { @@ -175,7 +174,6 @@ func (c *Controller) updateHealthStatusForTenant(tenant *miniov2.Tenant) error { srvInfoCtx, cancel := context.WithTimeout(context.Background(), 120*time.Second) defer cancel() storageInfo, err := adminClnt.StorageInfo(srvInfoCtx) - if err != nil { // show the error and continue klog.Infof("'%s/%s' Failed to get storage info: %v", tenant.Namespace, tenant.Name, err) @@ -416,7 +414,6 @@ func (c *Controller) processNextHealthCheckItem() bool { // syncHealthCheckHandler acts on work items from the healthCheckQueue func (c *Controller) syncHealthCheckHandler(key string) error { - // Convert the namespace/name string into a distinct namespace and name if key == "" { runtime.HandleError(fmt.Errorf("Invalid resource key: %s", key)) diff --git a/pkg/controller/cluster/operator.go b/pkg/controller/cluster/operator.go index 00f01621b4b..5588d929c3c 100644 --- a/pkg/controller/cluster/operator.go +++ b/pkg/controller/cluster/operator.go @@ -54,9 +54,7 @@ const ( DefaultDeploymentName = "minio-operator" ) -var ( - errOperatorWaitForTLS = errors.New("waiting for Operator cert") -) +var errOperatorWaitForTLS = errors.New("waiting for Operator cert") func getOperatorDeploymentName() string { return env.Get("MINIO_OPERATOR_DEPLOYMENT_NAME", DefaultDeploymentName) @@ -68,8 +66,10 @@ func isOperatorTLS() bool { return (set && value == "on") || !set } -var kubeAPIServerVersion *version.Info -var useCertificatesV1API bool +var ( + kubeAPIServerVersion *version.Info + useCertificatesV1API bool +) func (c *Controller) getKubeAPIServerVersion() { var err error @@ -105,13 +105,12 @@ func (c *Controller) generateTLSCert() (string, string) { err = c.deleteMinIOCSR(ctx, c.operatorCSRName()) if err != nil { klog.Infof(err.Error()) - } } } } else { if val, ok := operatorTLSCert.Data["public.crt"]; ok { - err := ioutil.WriteFile(publicCertPath, val, 0644) + err := ioutil.WriteFile(publicCertPath, val, 0o644) if err != nil { panic(err) } @@ -120,7 +119,7 @@ func (c *Controller) generateTLSCert() (string, string) { } if val, ok := operatorTLSCert.Data["private.key"]; ok { - err := ioutil.WriteFile(publicKeyPath, val, 0644) + err := ioutil.WriteFile(publicKeyPath, val, 0o644) if err != nil { panic(err) } diff --git a/pkg/controller/cluster/prometheus.go b/pkg/controller/cluster/prometheus.go index ca395200aec..9904a032f86 100644 --- a/pkg/controller/cluster/prometheus.go +++ b/pkg/controller/cluster/prometheus.go @@ -25,16 +25,17 @@ import ( "strings" "time" - miniov2 "github.com/minio/operator/pkg/apis/minio.min.io/v2" - "github.com/minio/operator/pkg/resources/configmaps" - "github.com/minio/operator/pkg/resources/services" - "github.com/minio/operator/pkg/resources/statefulsets" promv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "gopkg.in/yaml.v2" corev1 "k8s.io/api/core/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/klog/v2" + + miniov2 "github.com/minio/operator/pkg/apis/minio.min.io/v2" + "github.com/minio/operator/pkg/resources/configmaps" + "github.com/minio/operator/pkg/resources/services" + "github.com/minio/operator/pkg/resources/statefulsets" ) // MinIOPrometheusMetrics holds metrics pulled from prometheus @@ -46,6 +47,7 @@ type MinIOPrometheusMetrics struct { func getPrometheusMetricsForTenant(tenant *miniov2.Tenant, bearer string) (*MinIOPrometheusMetrics, error) { return getPrometheusMetricsForTenantWithRetry(tenant, bearer, 5) } + func getPrometheusMetricsForTenantWithRetry(tenant *miniov2.Tenant, bearer string, tryCount int) (*MinIOPrometheusMetrics, error) { // build the endpoint to contact the Tenant svcURL := tenant.GetTenantServiceURL() diff --git a/pkg/controller/cluster/status.go b/pkg/controller/cluster/status.go index 6c78ccdf553..18c60b23db8 100644 --- a/pkg/controller/cluster/status.go +++ b/pkg/controller/cluster/status.go @@ -101,7 +101,6 @@ func (c *Controller) updatePoolStatus(ctx context.Context, tenant *miniov2.Tenan } func (c *Controller) updatePoolStatusWithRetry(ctx context.Context, tenant *miniov2.Tenant, retry bool) (*miniov2.Tenant, error) { - // NEVER modify objects from the store. It's a read-only, local cache. // You can use DeepCopy() to make a deep copy of original object and modify this copy // Or create a copy manually for better performance @@ -135,7 +134,6 @@ func (c *Controller) updateCertificatesStatus(ctx context.Context, tenant *minio } func (c *Controller) updateCertificatesWithRetry(ctx context.Context, tenant *miniov2.Tenant, autoCertEnabled bool, retry bool) (*miniov2.Tenant, error) { - // NEVER modify objects from the store. It's a read-only, local cache. // You can use DeepCopy() to make a deep copy of original object and modify this copy // Or create a copy manually for better performance diff --git a/pkg/controller/cluster/upgrades.go b/pkg/controller/cluster/upgrades.go index 476fa8136e9..b1695a2bd93 100644 --- a/pkg/controller/cluster/upgrades.go +++ b/pkg/controller/cluster/upgrades.go @@ -42,7 +42,6 @@ type upgradeFunction func(ctx context.Context, tenant *miniov2.Tenant) (*miniov2 // checkForUpgrades verifies if the tenant definition needs any upgrades func (c *Controller) checkForUpgrades(ctx context.Context, tenant *miniov2.Tenant) (*miniov2.Tenant, error) { - var upgradesToDo []string upgrades := map[string]upgradeFunction{ version420: c.upgrade420, @@ -204,7 +203,6 @@ func versionCompare(version1 string, version2 string) int { // Upgrades the sync version to v4.2.8 // we needed to clean `operator-webhook-secrets` with non-alphanumerical characters func (c *Controller) upgrade428(ctx context.Context, tenant *miniov2.Tenant) (*miniov2.Tenant, error) { - secret, err := c.kubeClientSet.CoreV1().Secrets(tenant.Namespace).Get(ctx, miniov2.WebhookSecret, metav1.GetOptions{}) if err != nil && !k8serrors.IsNotFound(err) { return tenant, err @@ -213,7 +211,7 @@ func (c *Controller) upgrade428(ctx context.Context, tenant *miniov2.Tenant) (*m if err == nil { unsupportedChars := false - var re = regexp.MustCompile(`(?m)^[a-zA-Z0-9]+$`) + re := regexp.MustCompile(`(?m)^[a-zA-Z0-9]+$`) // if any of the keys contains non alphanumerical characters, accessKey := string(secret.Data[miniov2.WebhookOperatorUsername]) diff --git a/pkg/resources/configmaps/prometheus.go b/pkg/resources/configmaps/prometheus.go index a51f6d20f2d..3fce54330b2 100644 --- a/pkg/resources/configmaps/prometheus.go +++ b/pkg/resources/configmaps/prometheus.go @@ -20,11 +20,12 @@ import ( "time" "github.com/golang-jwt/jwt" - miniov2 "github.com/minio/operator/pkg/apis/minio.min.io/v2" - v2 "github.com/minio/operator/pkg/apis/minio.min.io/v2" "gopkg.in/yaml.v2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + miniov2 "github.com/minio/operator/pkg/apis/minio.min.io/v2" + v2 "github.com/minio/operator/pkg/apis/minio.min.io/v2" ) type globalConfig struct { diff --git a/pkg/resources/deployments/log-search-api.go b/pkg/resources/deployments/log-search-api.go index 951bb940b1c..6525fef11ae 100644 --- a/pkg/resources/deployments/log-search-api.go +++ b/pkg/resources/deployments/log-search-api.go @@ -122,11 +122,11 @@ func logSearchAPISelector(t *miniov2.Tenant) *metav1.LabelSelector { // logSearchAPISecurityContext builds the security context for log search api pods func logSearchAPISecurityContext(t *miniov2.Tenant) *corev1.PodSecurityContext { - var runAsNonRoot = true + runAsNonRoot := true var runAsUser int64 = 1000 var runAsGroup int64 = 1000 var fsGroup int64 = 1000 - var securityContext = corev1.PodSecurityContext{ + securityContext := corev1.PodSecurityContext{ RunAsNonRoot: &runAsNonRoot, RunAsUser: &runAsUser, RunAsGroup: &runAsGroup, diff --git a/pkg/resources/jobs/kes-job.go b/pkg/resources/jobs/kes-job.go index b54c07c2e08..2c05bcc26de 100644 --- a/pkg/resources/jobs/kes-job.go +++ b/pkg/resources/jobs/kes-job.go @@ -23,11 +23,10 @@ import ( // NewForKES creates a new Job to create KES Key func NewForKES(t *miniov2.Tenant) *batchv1.Job { - containers := []corev1.Container{kesJobContainer(t)} var clientCertSecret string - var clientCertPaths = []corev1.KeyToPath{ + clientCertPaths := []corev1.KeyToPath{ {Key: "public.crt", Path: "minio.crt"}, {Key: "private.key", Path: "minio.key"}, } diff --git a/pkg/resources/statefulsets/kes-statefulset.go b/pkg/resources/statefulsets/kes-statefulset.go index 07738dbc02e..f70a10a9363 100644 --- a/pkg/resources/statefulsets/kes-statefulset.go +++ b/pkg/resources/statefulsets/kes-statefulset.go @@ -68,7 +68,6 @@ func KESEnvironmentVars(t *miniov2.Tenant) []corev1.EnvVar { // KESServerContainer returns the KES container for a KES StatefulSet. func KESServerContainer(t *miniov2.Tenant) corev1.Container { - // Args to start KES with config mounted at miniov2.KESConfigMountPath and require but don't verify mTLS authentication args := []string{"server", "--config=" + miniov2.KESConfigMountPath + "/server-config.yaml", "--auth=off"} @@ -90,11 +89,11 @@ func KESServerContainer(t *miniov2.Tenant) corev1.Container { // kesSecurityContext builds the security context for KES statefulset pods func kesSecurityContext(t *miniov2.Tenant) *corev1.PodSecurityContext { - var runAsNonRoot = true + runAsNonRoot := true var runAsUser int64 = 1000 var runAsGroup int64 = 1000 var fsGroup int64 = 1000 - var securityContext = corev1.PodSecurityContext{ + securityContext := corev1.PodSecurityContext{ RunAsNonRoot: &runAsNonRoot, RunAsUser: &runAsUser, RunAsGroup: &runAsGroup, @@ -108,10 +107,10 @@ func kesSecurityContext(t *miniov2.Tenant) *corev1.PodSecurityContext { // NewForKES creates a new KES StatefulSet for the given Cluster. func NewForKES(t *miniov2.Tenant, serviceName string) *appsv1.StatefulSet { - var replicas = t.KESReplicas() + replicas := t.KESReplicas() // certificate files used by the KES server - var certPath = "server.crt" - var keyPath = "server.key" + certPath := "server.crt" + keyPath := "server.key" var volumeProjections []corev1.VolumeProjection @@ -120,12 +119,12 @@ func NewForKES(t *miniov2.Tenant, serviceName string) *appsv1.StatefulSet { // in mTLS with a KMS (eg: authentication with Vault) var clientCertSecret string - var serverCertPaths = []corev1.KeyToPath{ + serverCertPaths := []corev1.KeyToPath{ {Key: "public.crt", Path: certPath}, {Key: "private.key", Path: keyPath}, } - var configPath = []corev1.KeyToPath{ + configPath := []corev1.KeyToPath{ {Key: "server-config.yaml", Path: "server-config.yaml"}, } diff --git a/pkg/resources/statefulsets/log.go b/pkg/resources/statefulsets/log.go index f30e00b17ce..b5af8b8c441 100644 --- a/pkg/resources/statefulsets/log.go +++ b/pkg/resources/statefulsets/log.go @@ -127,11 +127,11 @@ const defaultLogVolumeSize = 5 * 1024 * 1024 * 1024 // 5GiB // postgresSecurityContext builds the security context for postgres pods func postgresSecurityContext(t *miniov2.Tenant) *corev1.PodSecurityContext { - var runAsNonRoot = true + runAsNonRoot := true var runAsUser int64 = 999 var runAsGroup int64 = 999 var fsGroup int64 = 999 - var securityContext = corev1.PodSecurityContext{ + securityContext := corev1.PodSecurityContext{ RunAsNonRoot: &runAsNonRoot, RunAsUser: &runAsUser, RunAsGroup: &runAsGroup, @@ -197,8 +197,8 @@ func NewForLogDb(t *miniov2.Tenant, serviceName string) *appsv1.StatefulSet { dbPod.Spec.SecurityContext.RunAsGroup != nil { var runAsUser int64 - var runAsNonRoot = false - var allowPrivilegeEscalation = true + runAsNonRoot := false + allowPrivilegeEscalation := true initContainerSecurityContext = corev1.SecurityContext{ RunAsUser: &runAsUser, RunAsNonRoot: &runAsNonRoot, diff --git a/pkg/resources/statefulsets/minio-statefulset.go b/pkg/resources/statefulsets/minio-statefulset.go index ab9a46daea8..423f5dd7ded 100644 --- a/pkg/resources/statefulsets/minio-statefulset.go +++ b/pkg/resources/statefulsets/minio-statefulset.go @@ -355,11 +355,11 @@ func poolTopologySpreadConstraints(z *miniov2.Pool) []corev1.TopologySpreadConst // Builds the security context for a Pool func poolSecurityContext(pool *miniov2.Pool, status *miniov2.PoolStatus) *v1.PodSecurityContext { - var runAsNonRoot = true + runAsNonRoot := true var runAsUser int64 = 1000 var runAsGroup int64 = 1000 var fsGroup int64 = 1000 - var securityContext = corev1.PodSecurityContext{ + securityContext := corev1.PodSecurityContext{ RunAsNonRoot: &runAsNonRoot, RunAsUser: &runAsUser, RunAsGroup: &runAsGroup, @@ -383,16 +383,16 @@ func poolSecurityContext(pool *miniov2.Pool, status *miniov2.PoolStatus) *v1.Pod // NewPool creates a new StatefulSet for the given Cluster. func NewPool(t *miniov2.Tenant, wsSecret *v1.Secret, pool *miniov2.Pool, poolStatus *miniov2.PoolStatus, serviceName, hostsTemplate, operatorVersion string, operatorTLS bool) *appsv1.StatefulSet { var podVolumes []corev1.Volume - var replicas = pool.Servers + replicas := pool.Servers var certVolumeSources []corev1.VolumeProjection var clientCertSecret string - var clientCertPaths = []corev1.KeyToPath{ + clientCertPaths := []corev1.KeyToPath{ {Key: "public.crt", Path: "client.crt"}, {Key: "private.key", Path: "client.key"}, } var kesCertSecret string - var KESCertPath = []corev1.KeyToPath{ + KESCertPath := []corev1.KeyToPath{ {Key: "public.crt", Path: "CAs/kes.crt"}, } diff --git a/pkg/resources/statefulsets/prometheus.go b/pkg/resources/statefulsets/prometheus.go index 6d9735be008..31a10c8a719 100644 --- a/pkg/resources/statefulsets/prometheus.go +++ b/pkg/resources/statefulsets/prometheus.go @@ -115,18 +115,17 @@ func prometheusSidecarContainer(t *miniov2.Tenant) corev1.Container { `echo -e '#!/bin/sh\n\nset -e\nset -x\necho "POST /-/reload HTTP/1.1\r\nHost:localhost:9090\r\nConnection: close\r\n\r\n" | nc localhost 9090\n' > /tmp/run.sh && echo "ok" && chmod +x /tmp/run.sh && inotifyd /tmp/run.sh /etc/prometheus/prometheus.yml:w`, }, } - } const prometheusDefaultVolumeSize = 5 * 1024 * 1024 * 1024 // 5GiB // prometheusSecurityContext builds the security context for prometheus pods func prometheusSecurityContext(t *miniov2.Tenant) *corev1.PodSecurityContext { - var runAsNonRoot = true + runAsNonRoot := true var runAsUser int64 = 1000 var runAsGroup int64 = 1000 var fsGroup int64 = 1000 - var securityContext = corev1.PodSecurityContext{ + securityContext := corev1.PodSecurityContext{ RunAsNonRoot: &runAsNonRoot, RunAsUser: &runAsUser, RunAsGroup: &runAsGroup, @@ -197,8 +196,8 @@ func NewForPrometheus(t *miniov2.Tenant, serviceName string) *appsv1.StatefulSet // and user will have to provide a serviceAccount that allows this if securityContext != nil && securityContext.RunAsUser != nil && securityContext.RunAsGroup != nil { var runAsUser int64 - var runAsNonRoot = false - var allowPrivilegeEscalation = true + runAsNonRoot := false + allowPrivilegeEscalation := true initContainerSecurityContext = corev1.SecurityContext{ RunAsUser: &runAsUser, RunAsNonRoot: &runAsNonRoot, diff --git a/testing/check-logs.sh b/testing/check-logs.sh index cd97bf0fed3..8029b39e7e5 100755 --- a/testing/check-logs.sh +++ b/testing/check-logs.sh @@ -17,6 +17,7 @@ SCRIPT_DIR=$(dirname "$0") export SCRIPT_DIR + source "${SCRIPT_DIR}/common.sh" function main() { @@ -34,19 +35,21 @@ function main() { i=0 while [[ $(kubectl get pods -n tenant-lite --selector=statefulset.kubernetes.io/pod-name=storage-lite-prometheus-0 -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do - ((i++)) - echo "waiting for storage-lite-prometheus-0" && sleep 1; - if [[ $i -eq 300 ]]; then - break - fi + ((i++)) + echo "waiting for storage-lite-prometheus-0" && sleep 1; + if [[ $i -eq 300 ]]; then + kubectl get pods -n tenant-lite -o wide + kubectl describe pods -n tenant-lite + break + fi done echo 'end - wait for prometheus to appears' echo 'Wait for pod to be ready for port forward' try kubectl wait --namespace tenant-lite \ - --for=condition=ready pod \ - --selector=statefulset.kubernetes.io/pod-name=storage-lite-ss-0-0 \ - --timeout=120s + --for=condition=ready pod \ + --selector=statefulset.kubernetes.io/pod-name=storage-lite-ss-0-0 \ + --timeout=120s echo 'port forward without the hop, directly from the tenant/pod' kubectl port-forward storage-lite-ss-0-0 9443 --namespace tenant-lite & @@ -67,35 +70,35 @@ function main() { echo 'Get token from MinIO Console' COOKIE=$( - curl 'https://localhost:9443/api/v1/login' -vs \ - -H 'content-type: application/json' \ - --data-raw '{"accessKey":"minio","secretKey":"minio123"}' --insecure 2>&1 | \ - grep "set-cookie: token=" | sed -e "s/< set-cookie: token=//g" | \ - awk -F ';' '{print $1}' - ) + curl 'https://localhost:9443/api/v1/login' -vs \ + -H 'content-type: application/json' \ + --data-raw '{"accessKey":"minio","secretKey":"minio123"}' --insecure 2>&1 | \ + grep "set-cookie: token=" | sed -e "s/< set-cookie: token=//g" | \ + awk -F ';' '{print $1}' + ) echo $COOKIE echo 'start - wait for prometheus to be ready' try kubectl wait --namespace tenant-lite \ - --for=condition=ready pod \ - --selector=statefulset.kubernetes.io/pod-name=storage-lite-prometheus-0 \ - --timeout=300s + --for=condition=ready pod \ + --selector=statefulset.kubernetes.io/pod-name=storage-lite-prometheus-0 \ + --timeout=300s echo 'end - wait for prometheus to be ready' echo 'start - print the entire output for debug' curl 'https://localhost:9443/api/v1/admin/info/widgets/66/?step=0&' \ - -H 'cookie: token='$COOKIE'' \ - --compressed \ - --insecure + -H 'cookie: token='$COOKIE'' \ + --compressed \ + --insecure echo 'end - print the entire output for debug' echo 'Verify Logs via API' RESULT=$( - curl 'https://localhost:9443/api/v1/logs/search?q=reqinfo&pageSize=100&pageNo=0&order=timeDesc' \ - -H 'cookie: token='$COOKIE'' \ - --compressed \ - --insecure | jq '.results[0].response_status' - ) + curl 'https://localhost:9443/api/v1/logs/search?q=reqinfo&pageSize=100&pageNo=0&order=timeDesc' \ + -H 'cookie: token='$COOKIE'' \ + --compressed \ + --insecure | jq '.results[0].response_status' + ) echo $RESULT EXPECTED_RESULT='"OK"' echo $EXPECTED_RESULT diff --git a/testing/check-prometheus.sh b/testing/check-prometheus.sh index eb7064a3de2..a9cd43124d0 100755 --- a/testing/check-prometheus.sh +++ b/testing/check-prometheus.sh @@ -17,6 +17,7 @@ SCRIPT_DIR=$(dirname "$0") export SCRIPT_DIR + source "${SCRIPT_DIR}/common.sh" function main() { @@ -30,23 +31,25 @@ function main() { check_tenant_status tenant-lite storage-lite - echo 'start - wait for prometheus to appears' + echo 'start - wait for prometheus to appear' i=0 while [[ $(kubectl get pods -n tenant-lite --selector=statefulset.kubernetes.io/pod-name=storage-lite-prometheus-0 -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do - ((i++)) - echo "waiting for storage-lite-prometheus-0" && sleep 1; - if [[ $i -eq 300 ]]; then - break - fi + ((i++)) + echo "waiting for storage-lite-prometheus-0" && sleep 1; + if [[ $i -eq 300 ]]; then + kubectl get pods -n tenant-lite -o wide + kubectl describe pods -n tenant-lite + break + fi done - echo 'end - wait for prometheus to appears' + echo 'end - wait for prometheus to appear' echo 'Wait for pod to be ready for port forward' try kubectl wait --namespace tenant-lite \ - --for=condition=ready pod \ - --selector=statefulset.kubernetes.io/pod-name=storage-lite-ss-0-0 \ - --timeout=120s + --for=condition=ready pod \ + --selector=statefulset.kubernetes.io/pod-name=storage-lite-ss-0-0 \ + --timeout=120s echo 'port forward without the hop, directly from the tenant/pod' kubectl port-forward storage-lite-ss-0-0 9443 --namespace tenant-lite & @@ -67,35 +70,35 @@ function main() { echo 'Get token from MinIO Console' COOKIE=$( - curl 'https://localhost:9443/api/v1/login' -vs \ - -H 'content-type: application/json' \ - --data-raw '{"accessKey":"minio","secretKey":"minio123"}' --insecure 2>&1 | \ - grep "set-cookie: token=" | sed -e "s/< set-cookie: token=//g" | \ - awk -F ';' '{print $1}' - ) + curl 'https://localhost:9443/api/v1/login' -vs \ + -H 'content-type: application/json' \ + --data-raw '{"accessKey":"minio","secretKey":"minio123"}' --insecure 2>&1 | \ + grep "set-cookie: token=" | sed -e "s/< set-cookie: token=//g" | \ + awk -F ';' '{print $1}' + ) echo $COOKIE echo 'start - wait for prometheus to be ready' try kubectl wait --namespace tenant-lite \ - --for=condition=ready pod \ - --selector=statefulset.kubernetes.io/pod-name=storage-lite-prometheus-0 \ - --timeout=300s + --for=condition=ready pod \ + --selector=statefulset.kubernetes.io/pod-name=storage-lite-prometheus-0 \ + --timeout=300s echo 'end - wait for prometheus to be ready' echo 'start - print the entire output for debug' curl 'https://localhost:9443/api/v1/admin/info/widgets/66/?step=0&' \ - -H 'cookie: token='$COOKIE'' \ - --compressed \ - --insecure + -H 'cookie: token='$COOKIE'' \ + --compressed \ + --insecure echo 'end - print the entire output for debug' echo 'Verify Prometheus via API' RESULT=$( - curl 'https://localhost:9443/api/v1/admin/info/widgets/66/?step=0&' \ - -H 'cookie: token='$COOKIE'' \ - --compressed \ - --insecure | jq '.title' - ) + curl 'https://localhost:9443/api/v1/admin/info/widgets/66/?step=0&' \ + -H 'cookie: token='$COOKIE'' \ + --compressed \ + --insecure | jq '.title' + ) echo $RESULT EXPECTED_RESULT='"Number of Buckets"' echo $EXPECTED_RESULT diff --git a/testing/common.sh b/testing/common.sh index f6f00c7f83e..0337c9a5d64 100644 --- a/testing/common.sh +++ b/testing/common.sh @@ -13,11 +13,22 @@ # You should have received a copy of the GNU Affero General Public License, version 3, # along with this program. If not, see +## this enables :dev tag for minio/operator container image. +CI="true" +export CI + +## Make sure to install things if not present already +sudo curl -#L "https://dl.k8s.io/release/v1.23.1/bin/linux/amd64/kubectl" -o /usr/local/bin/kubectl +sudo chmod +x /usr/local/bin/kubectl + +sudo curl -#L "https://dl.min.io/client/mc/release/linux-amd64/mc" -o /usr/local/bin/mc +sudo chmod +x /usr/local/bin/mc + yell() { echo "$0: $*" >&2; } die() { - yell "$*" - (kind delete cluster || true ) && exit 111 + yell "$*" + (kind delete cluster || true ) && exit 111 } try() { "$@" || die "cannot $*"; } @@ -33,9 +44,9 @@ function install_operator() { echo "check if helm will install the operator" if [ "$1" = "helm" ]; then helm install \ - --namespace minio-operator \ - --create-namespace \ - minio-operator minio/operator + --namespace minio-operator \ + --create-namespace \ + minio-operator minio/operator echo "key, value for pod selector in helm test" key=app.kubernetes.io/name @@ -64,9 +75,9 @@ function install_operator() { echo "Waiting for Operator Pods to come online (2m timeout)" try kubectl wait --namespace minio-operator \ - --for=condition=ready pod \ - --selector $key=$value \ - --timeout=120s + --for=condition=ready pod \ + --selector $key=$value \ + --timeout=120s echo "start - get data to verify proper image is being used" kubectl get pods --namespace minio-operator @@ -86,17 +97,17 @@ function wait_for_resource() { echo $command_to_wait while true; do - waitdone=$($command_to_wait | wc -l) - if [ "$waitdone" -ne 0 ]; then - echo "Found $waitdone pods" - break - fi - sleep 5 - totalwait=$((totalwait + 5)) - if [ "$totalwait" -gt 305 ]; then - echo "Unable to get resource after 5 minutes, exiting." - try false - fi + waitdone=$($command_to_wait | wc -l) + if [ "$waitdone" -ne 0 ]; then + echo "Found $waitdone pods" + break + fi + sleep 5 + totalwait=$((totalwait + 5)) + if [ "$totalwait" -gt 305 ]; then + echo "Unable to get resource after 5 minutes, exiting." + try false + fi done } @@ -131,7 +142,7 @@ function check_tenant_status() { echo "Tenant is created successfully, proceeding to validate 'mc admin info minio/'" - if [ $4 = "helm" ]; then + if [ "$4" = "helm" ]; then # File: operator/helm/tenant/values.yaml # Content: s3.bucketDNS: false echo "In helm values by default bucketDNS.s3 is disabled, skipping mc validation on helm test" @@ -151,7 +162,7 @@ function install_tenant() { key=app value=minio helm install --namespace tenant-ns \ - --create-namespace tenant minio/tenant + --create-namespace tenant minio/tenant else namespace=tenant-lite key=v1.min.io/tenant @@ -169,9 +180,9 @@ function install_tenant() { echo "Waiting for tenant pods to come online (5m timeout)" try kubectl wait --namespace $namespace \ - --for=condition=ready pod \ - --selector $key=$value \ - --timeout=300s + --for=condition=ready pod \ + --selector $key=$value \ + --timeout=300s echo "Build passes basic tenant creation" diff --git a/testing/console-tenant+kes.sh b/testing/console-tenant+kes.sh index d0c3951bdd2..50e9cf4893c 100755 --- a/testing/console-tenant+kes.sh +++ b/testing/console-tenant+kes.sh @@ -20,7 +20,6 @@ export SCRIPT_DIR source "${SCRIPT_DIR}/common.sh" - function check_tenant_status_old() { # Check MinIO is accessible @@ -49,86 +48,84 @@ function check_tenant_status_old() { function test_kes_tenant() { - echo "Installing vault" - - try kubectl apply -f "${SCRIPT_DIR}/../examples/vault/deployment.yaml" + echo "Installing vault" - kubectl get pods + try kubectl apply -f "${SCRIPT_DIR}/../examples/vault/deployment.yaml" - echo "Waiting for Vault Pods (10s)" - sleep 10 + kubectl get pods - kubectl get pods + echo "Waiting for Vault Pods (10s)" + sleep 10 + kubectl get pods - echo "Waiting for Vault (2m timeout)" - try kubectl wait --namespace default \ - --for=condition=ready pod \ - --selector=app=vault \ - --timeout=120s + echo "Waiting for Vault (2m timeout)" - echo "Vault is ready. Bootstrapping Vault..." + try kubectl wait --namespace default \ + --for=condition=ready pod \ + --selector=app=vault \ + --timeout=120s - VAULT_UNSEAL_KEY=$(kubectl logs -l app=vault | grep "Unseal Key: " | sed -e "s/Unseal Key: //g") - VAULT_ROOT_TOKEN=$(kubectl logs -l app=vault | grep "Root Token: " | sed -e "s/Root Token: //g") + echo "Vault is ready. Bootstrapping Vault..." - echo "Vault root: '$VAULT_ROOT_TOKEN'" + VAULT_ROOT_TOKEN=$(kubectl logs -l app=vault | grep "Root Token: " | sed -e "s/Root Token: //g") + echo "Vault root: '$VAULT_ROOT_TOKEN'" - try kubectl exec $(kubectl get pods -l app=vault | grep -v NAME | awk '{print $1}') -- sh -c 'VAULT_TOKEN='$VAULT_ROOT_TOKEN' VAULT_ADDR="http://127.0.0.1:8200" vault auth enable approle' - try kubectl exec $(kubectl get pods -l app=vault | grep -v NAME | awk '{print $1}') -- sh -c 'VAULT_TOKEN='$VAULT_ROOT_TOKEN' VAULT_ADDR="http://127.0.0.1:8200" vault secrets enable kv' + try kubectl exec $(kubectl get pods -l app=vault | grep -v NAME | awk '{print $1}') -- sh -c 'VAULT_TOKEN='$VAULT_ROOT_TOKEN' VAULT_ADDR="http://127.0.0.1:8200" vault auth enable approle' + try kubectl exec $(kubectl get pods -l app=vault | grep -v NAME | awk '{print $1}') -- sh -c 'VAULT_TOKEN='$VAULT_ROOT_TOKEN' VAULT_ADDR="http://127.0.0.1:8200" vault secrets enable kv' - # copy kes file - try kubectl cp "${SCRIPT_DIR}/../examples/vault/kes-policy.hcl" $(kubectl get pods -l app=vault | grep -v NAME | awk '{print $1}'):/kes-policy.hcl + # copy kes file + try kubectl cp "${SCRIPT_DIR}/../examples/vault/kes-policy.hcl" $(kubectl get pods -l app=vault | grep -v NAME | awk '{print $1}'):/kes-policy.hcl - try kubectl exec $(kubectl get pods -l app=vault | grep -v NAME | awk '{print $1}') -- sh -c 'VAULT_TOKEN='$VAULT_ROOT_TOKEN' VAULT_ADDR="http://127.0.0.1:8200" vault policy write kes-policy /kes-policy.hcl' - try kubectl exec $(kubectl get pods -l app=vault | grep -v NAME | awk '{print $1}') -- sh -c 'VAULT_TOKEN='$VAULT_ROOT_TOKEN' VAULT_ADDR="http://127.0.0.1:8200" vault write auth/approle/role/kes-role token_num_uses=0 secret_id_num_uses=0 period=5m policies=kes-policy' + try kubectl exec $(kubectl get pods -l app=vault | grep -v NAME | awk '{print $1}') -- sh -c 'VAULT_TOKEN='$VAULT_ROOT_TOKEN' VAULT_ADDR="http://127.0.0.1:8200" vault policy write kes-policy /kes-policy.hcl' + try kubectl exec $(kubectl get pods -l app=vault | grep -v NAME | awk '{print $1}') -- sh -c 'VAULT_TOKEN='$VAULT_ROOT_TOKEN' VAULT_ADDR="http://127.0.0.1:8200" vault write auth/approle/role/kes-role token_num_uses=0 secret_id_num_uses=0 period=5m policies=kes-policy' - ROLE_ID=$(kubectl exec $(kubectl get pods -l app=vault | grep -v NAME | awk '{print $1}') -- sh -c 'VAULT_TOKEN='$VAULT_ROOT_TOKEN' VAULT_ADDR="http://127.0.0.1:8200" vault read auth/approle/role/kes-role/role-id' | grep "role_id " | sed -e "s/role_id //g") - SECRET_ID=$(kubectl exec $(kubectl get pods -l app=vault | grep -v NAME | awk '{print $1}') -- sh -c 'VAULT_TOKEN='$VAULT_ROOT_TOKEN' VAULT_ADDR="http://127.0.0.1:8200" vault write -f auth/approle/role/kes-role/secret-id' | grep "secret_id " | sed -e "s/secret_id //g") + ROLE_ID=$(kubectl exec $(kubectl get pods -l app=vault | grep -v NAME | awk '{print $1}') -- sh -c 'VAULT_TOKEN='$VAULT_ROOT_TOKEN' VAULT_ADDR="http://127.0.0.1:8200" vault read auth/approle/role/kes-role/role-id' | grep "role_id " | sed -e "s/role_id //g") + SECRET_ID=$(kubectl exec $(kubectl get pods -l app=vault | grep -v NAME | awk '{print $1}') -- sh -c 'VAULT_TOKEN='$VAULT_ROOT_TOKEN' VAULT_ADDR="http://127.0.0.1:8200" vault write -f auth/approle/role/kes-role/secret-id' | grep "secret_id " | sed -e "s/secret_id //g") - echo "Port Forwarding console" - kubectl -n minio-operator port-forward svc/console 9090 & + echo "Port Forwarding console" + kubectl -n minio-operator port-forward svc/console 9090 & - SA_TOKEN=$(kubectl -n minio-operator get secret $(kubectl -n minio-operator get serviceaccount console-sa -o jsonpath="{.secrets[0].name}") -o jsonpath="{.data.token}" | base64 --decode) + SA_TOKEN=$(kubectl -n minio-operator get secret $(kubectl -n minio-operator get serviceaccount console-sa -o jsonpath="{.secrets[0].name}") -o jsonpath="{.data.token}" | base64 --decode) - COOKIE=$(curl 'http://localhost:9090/api/v1/login/operator' -X POST \ - -H 'Content-Type: application/json' \ - --data-raw '{"jwt":"'$SA_TOKEN'"}' -i | grep "Set-Cookie: token=" | sed -e "s/Set-Cookie: token=//g" | awk -F ';' '{print $1}') + COOKIE=$(curl 'http://localhost:9090/api/v1/login/operator' -X POST \ + -H 'Content-Type: application/json' \ + --data-raw '{"jwt":"'$SA_TOKEN'"}' -i | grep "Set-Cookie: token=" | sed -e "s/Set-Cookie: token=//g" | awk -F ';' '{print $1}') - echo "Creating Tenant" - CREDENTIALS=$(curl 'http://localhost:9090/api/v1/tenants' \ - -X POST \ - -H 'Content-Type: application/json' \ - -H 'Cookie: token='$COOKIE'' \ - --data-raw '{"name":"kes-tenant","namespace":"default","access_key":"","secret_key":"","access_keys":[],"secret_keys":[],"enable_tls":true,"enable_console":true,"enable_prometheus":true,"service_name":"","image":"","expose_minio":true,"expose_console":true,"pools":[{"name":"pool-0","servers":4,"volumes_per_server":1,"volume_configuration":{"size":26843545600,"storage_class_name":"standard"},"securityContext":null,"affinity":{"podAntiAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":[{"labelSelector":{"matchExpressions":[{"key":"v1.min.io/tenant","operator":"In","values":["kes-tenant"]},{"key":"v1.min.io/pool","operator":"In","values":["pool-0"]}]},"topologyKey":"kubernetes.io/hostname"}]}}}],"erasureCodingParity":2,"logSearchConfiguration":{"image":"","postgres_image":"","postgres_init_image":""},"prometheusConfiguration":{"image":"","sidecar_image":"","init_image":""},"tls":{"minio":[],"ca_certificates":[],"console_ca_certificates":[]},"encryption":{"replicas":"1","securityContext":{"runAsUser":"1000","runAsGroup":"1000","fsGroup":"1000","runAsNonRoot":true},"image":"","vault":{"endpoint":"http://vault.default.svc.cluster.local:8200","engine":"","namespace":"","prefix":"my-minio","approle":{"engine":"","id":"'$ROLE_ID'","secret":"'$SECRET_ID'","retry":0},"tls":{},"status":{"ping":0}}},"idp":{"keys":[{"access_key":"console","secret_key":"console123"}]}}') + echo "Creating Tenant" + CREDENTIALS=$(curl 'http://localhost:9090/api/v1/tenants' \ + -X POST \ + -H 'Content-Type: application/json' \ + -H 'Cookie: token='$COOKIE'' \ + --data-raw '{"name":"kes-tenant","namespace":"default","access_key":"","secret_key":"","access_keys":[],"secret_keys":[],"enable_tls":true,"enable_console":true,"enable_prometheus":true,"service_name":"","image":"","expose_minio":true,"expose_console":true,"pools":[{"name":"pool-0","servers":4,"volumes_per_server":1,"volume_configuration":{"size":26843545600,"storage_class_name":"standard"},"securityContext":null,"affinity":{"podAntiAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":[{"labelSelector":{"matchExpressions":[{"key":"v1.min.io/tenant","operator":"In","values":["kes-tenant"]},{"key":"v1.min.io/pool","operator":"In","values":["pool-0"]}]},"topologyKey":"kubernetes.io/hostname"}]}}}],"erasureCodingParity":2,"logSearchConfiguration":{"image":"","postgres_image":"","postgres_init_image":""},"prometheusConfiguration":{"image":"","sidecar_image":"","init_image":""},"tls":{"minio":[],"ca_certificates":[],"console_ca_certificates":[]},"encryption":{"replicas":"1","securityContext":{"runAsUser":"1000","runAsGroup":"1000","fsGroup":"1000","runAsNonRoot":true},"image":"","vault":{"endpoint":"http://vault.default.svc.cluster.local:8200","engine":"","namespace":"","prefix":"my-minio","approle":{"engine":"","id":"'$ROLE_ID'","secret":"'$SECRET_ID'","retry":0},"tls":{},"status":{"ping":0}}},"idp":{"keys":[{"access_key":"console","secret_key":"console123"}]}}') - echo $CREDENTIALS + echo $CREDENTIALS - check_tenant_status default kes-tenant + check_tenant_status default kes-tenant - echo "Port Forwarding tenant" - try kubectl port-forward $(kubectl get pods -l v1.min.io/tenant=kes-tenant | grep -v NAME | awk '{print $1}' | head -1) 9000 & + echo "Port Forwarding tenant" + try kubectl port-forward $(kubectl get pods -l v1.min.io/tenant=kes-tenant | grep -v NAME | awk '{print $1}' | head -1) 9000 & - USER=$(kubectl -n default get secrets kes-tenant-env-configuration -o go-template='{{index .data "config.env"|base64decode }}' | grep 'export MINIO_ROOT_USER="' | sed -e 's/export MINIO_ROOT_USER="//g' | sed -e 's/"//g') - PASSWORD=$(kubectl -n default get secrets kes-tenant-env-configuration -o go-template='{{index .data "config.env"|base64decode }}' | grep 'export MINIO_ROOT_PASSWORD="' | sed -e 's/export MINIO_ROOT_PASSWORD="//g' | sed -e 's/"//g') + USER=$(kubectl -n default get secrets kes-tenant-env-configuration -o go-template='{{index .data "config.env"|base64decode }}' | grep 'export MINIO_ROOT_USER="' | sed -e 's/export MINIO_ROOT_USER="//g' | sed -e 's/"//g') + PASSWORD=$(kubectl -n default get secrets kes-tenant-env-configuration -o go-template='{{index .data "config.env"|base64decode }}' | grep 'export MINIO_ROOT_PASSWORD="' | sed -e 's/export MINIO_ROOT_PASSWORD="//g' | sed -e 's/"//g') - totalwait=0 - until (mc config host add kestest https://localhost:9000 $USER $PASSWORD --insecure); do - echo "...waiting... for 5secs" && sleep 5 + totalwait=0 + until (mc config host add kestest https://localhost:9000 $USER $PASSWORD --insecure); do + echo "...waiting... for 5secs" && sleep 5 - totalwait=$((totalwait + 5)) + totalwait=$((totalwait + 5)) if [ "$totalwait" -gt 305 ]; then echo "Unable to register mc tenant after 5 minutes, exiting." try false fi - done; - try mc admin kms key status kestest --insecure + done; + try mc admin kms key status kestest --insecure } function main() {