From a4ca0d802a7dfe906089adf4bc5d95d0c288c471 Mon Sep 17 00:00:00 2001 From: Balint Molnar Date: Fri, 26 Apr 2019 09:57:37 +0200 Subject: [PATCH] Initial commit for k8s-objectmatcher --- .editorconfig | 15 + .github/ISSUE_TEMPLATE/bug_report.md | 20 ++ .github/ISSUE_TEMPLATE/feature_request.md | 17 + .github/ISSUE_TEMPLATE/support_request.md | 9 + .github/PULL_REQUEST_TEMPLATE.md | 33 ++ .github/SUPPORT.md | 12 + .github/support_issue.png | Bin 0 -> 41229 bytes .idea/go.imports.xml | 9 + .idea/k8s-objectmatcher.iml | 8 + .idea/misc.xml | 9 + .idea/modules.xml | 8 + .idea/workspace.xml | 374 ++++++++++++++++++++++ CODE_OF_CONDUCT.md | 46 +++ CONTRIBUTING.md | 18 ++ LICENSE | 201 ++++++++++++ Makefile | 13 + README.md | 54 ++++ clusterrole.go | 65 ++++ clusterrolebinding.go | 68 ++++ configmap.go | 68 ++++ crd.go | 65 ++++ daemonset.go | 65 ++++ deployment.go | 68 ++++ go.mod | 13 + go.sum | 224 +++++++++++++ hpa.go | 65 ++++ mutatingwebhook.go | 93 ++++++ objectmatch.go | 312 ++++++++++++++++++ pdb.go | 65 ++++ role.go | 65 ++++ rolebinding.go | 68 ++++ scripts/check-header.sh | 37 +++ service.go | 70 ++++ serviceaccount.go | 62 ++++ unstructured.go | 53 +++ 35 files changed, 2372 insertions(+) create mode 100644 .editorconfig create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/support_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/SUPPORT.md create mode 100644 .github/support_issue.png create mode 100644 .idea/go.imports.xml create mode 100644 .idea/k8s-objectmatcher.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/workspace.xml create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 README.md create mode 100644 clusterrole.go create mode 100644 clusterrolebinding.go create mode 100644 configmap.go create mode 100644 crd.go create mode 100644 daemonset.go create mode 100644 deployment.go create mode 100644 go.mod create mode 100644 go.sum create mode 100644 hpa.go create mode 100644 mutatingwebhook.go create mode 100644 objectmatch.go create mode 100644 pdb.go create mode 100644 role.go create mode 100644 rolebinding.go create mode 100755 scripts/check-header.sh create mode 100644 service.go create mode 100644 serviceaccount.go create mode 100644 unstructured.go diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..6d0b6d3 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.go] +indent_style = tab + +[{Makefile,*.mk}] +indent_style = tab diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..27766e4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,20 @@ +--- +name: Bug report +about: Create a report to help us improve the K8S-objectmatcher + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**Steps to reproduce the issue:** +Please describe the steps to reproduce the issue. + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Additional context** +Add any other context about the problem like release numberm version, branch, etc. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..1605bcd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,17 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like to see** +A clear and concise description of what would you like to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 0000000..634ca84 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -0,0 +1,9 @@ +--- +name: ⛔ Support request +about: See https://banzaicloud.com/support/ for support channels +--- + +We use GitHub issues to discuss K8S-objectmatcher bugs and new features. +For support requests please use the channels listed in [SUPPORT.md](https://github.com/banzaicloud/k8s-objectmatcher/blob/master/.github/SUPPORT.md) + +Thanks! diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..89deeaa --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,33 @@ +| Q | A +| --------------- | --- +| Bug fix? | no|yes +| New feature? | no|yes +| API breaks? | no|yes +| Deprecations? | no|yes +| Related tickets | fixes #X, partially #Y, mentioned in #Z +| License | Apache 2.0 + + +### What's in this PR? + + + +### Why? + + + +### Additional context + + + +### Checklist + + +- [ ] Implementation tested +- [ ] Error handling code meets the [guideline](https://github.com/banzaicloud/pipeline/blob/master/docs/error-handling-guide.md) +- [ ] Logging code meets the guideline +- [ ] User guide and development docs updated (if needed) + +### To Do + +- [ ] If the PR is not complete but you want to discuss the approach, list what remains to be done here diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md new file mode 100644 index 0000000..bcd6bfa --- /dev/null +++ b/.github/SUPPORT.md @@ -0,0 +1,12 @@ +# Support + +If you are looking for support for the K8S-objectmatcher , here are a few options: + +- [GitHub](https://github.com/banzaicloud/k8s-objectmatcher/issues) +- [Slack](https://slack.banzaicloud.io/) + +You can also open a support ticket from within the Pipeline platform: + +![](support_issue.png) + +Last, but not least you can send us an email from our [Contact](https://banzaicloud.com/contact/) page. diff --git a/.github/support_issue.png b/.github/support_issue.png new file mode 100644 index 0000000000000000000000000000000000000000..aa5282b0667f94e1f70617f62ab7020ce3617032 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qaabd8ocP-XyuNopPcT>qLW1+aN|QqZXqybe3V+SuL)o<@XnT1TL$W%7 zXHKYkdKO)?sO-=B-RnY%$6OLcyuoIBnBQNUGzi_A+^>N=+;4xBykG}fpXrGA>Qd@! z6YwBQ_5^v7OwDyg0Y*M(q6F&WM}a2<6!rU}qV6_(k7Z?E{kwPhjLbYSZ0ziN-ybGx zlXB#cAIunzfsPy%J^ZU7r31=U(8M!A+x@L2Krs5ln(Op2k%sNuxmKVDv+I7R9*VbP zKY`^P5K0vY3oGs4z@3}GB-}HCnf6T&XwypffkADZKjxrMhyw}~dodE6Uf4;nvNC8hg=H6`x%Vtyy Rx>DE|Ne literal 0 HcmV?d00001 diff --git a/.idea/go.imports.xml b/.idea/go.imports.xml new file mode 100644 index 0000000..b653761 --- /dev/null +++ b/.idea/go.imports.xml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/.idea/k8s-objectmatcher.iml b/.idea/k8s-objectmatcher.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/.idea/k8s-objectmatcher.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..0ecb5c3 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..1ee857f --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..f47ef02 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,374 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Istio + k8s-objectmatcher + istio + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..aa926ac --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at info@banzaicloud.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..488e4b4 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,18 @@ +### Issues + +Please format your issues in such a way as to help others who might be facing similar challenges. +Give your issues meaningful titles, that offer context and helps us and the community to understand and quickly ramp up on it. + +We are grateful for any issues submitted. Questions, feature requests or ideas are welcomed. + +### Pull Requests + +Try to keep pull requests tidy, and be prepared for feedback. Everyone is welcomed to contribute to K8S-objectmatcher. + +#### Formatting Go Code + +To get your pull request merged, Golang files must be formatted using the `go fmt` tool. + +#### Linting + +Go code must pass [`lint`](https://github.com/golang/lint) checks. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f49a4e1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c03076c --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ + +all: license fmt vet + +license: + ./scripts/check-header.sh + +# Run go fmt against code +fmt: + go fmt ./... + +# Run go vet against code +vet: + go vet ./... diff --git a/README.md b/README.md new file mode 100644 index 0000000..f8eeef2 --- /dev/null +++ b/README.md @@ -0,0 +1,54 @@ +![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg) + +# K8S-ObjectMatcher + +K8S-ObjectMatcher is a library which helps to match Kubernetes objects. + +### Motivation + +Here at BanzaiCloud we love operators. While writing more complex operators, we encountered a huge amount of +unnecessary k8s object update. Most of the operators are using `reflect.DeepEquals` to match the given object Spec. +Unfortunately, this solution is not perfect because every k8s object amended with different default values while submitted. + +### Supported Objects + +- ClusterRole +- ClusterRoleBindins +- ConfigMap +- CustomResourceDefinition +- DaemonSet +- Deployment +- HorizontalPodAutoScaler +- MutatingWebhook +- Role +- RoleBinding +- Pod +- PersistentVolumeClaim +- Service +- ServiceAccount +- PodDisruptionBudget +- Unstructured + +## Contributing + +If you find this project useful here's how you can help: + +- Send a pull request with your new features and bug fixes +- Help new users with issues they may encounter +- Support the development of this project and star this repo! + +## License + +Copyright (c) 2017-2019 [Banzai Cloud, Inc.](https://banzaicloud.com) + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/clusterrole.go b/clusterrole.go new file mode 100644 index 0000000..01073fa --- /dev/null +++ b/clusterrole.go @@ -0,0 +1,65 @@ +/* +Copyright 2019 Banzai Cloud. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package objectmatch + +import ( + "encoding/json" + + "github.com/goph/emperror" + rbacv1 "k8s.io/api/rbac/v1" +) + +type clusterRoleMatcher struct { + objectMatcher ObjectMatcher +} + +func NewClusterRoleMatcher(objectMatcher ObjectMatcher) *clusterRoleMatcher { + return &clusterRoleMatcher{ + objectMatcher: objectMatcher, + } +} + +// Match compares two rbacv1.ClusterRole objects +func (m clusterRoleMatcher) Match(old, new *rbacv1.ClusterRole) (bool, error) { + type ClusterRole struct { + ObjectMeta + Rules []rbacv1.PolicyRule `json:"rules"` + } + + oldData, err := json.Marshal(ClusterRole{ + ObjectMeta: m.objectMatcher.GetObjectMeta(old.ObjectMeta), + Rules: old.Rules, + }) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal old object", "name", old.Name) + } + newObject := ClusterRole{ + ObjectMeta: m.objectMatcher.GetObjectMeta(new.ObjectMeta), + Rules: new.Rules, + } + newData, err := json.Marshal(newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal new object", "name", new.Name) + } + + matched, err := m.objectMatcher.MatchJSON(oldData, newData, newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not match objects", "name", new.Name) + } + + return matched, nil +} diff --git a/clusterrolebinding.go b/clusterrolebinding.go new file mode 100644 index 0000000..7231197 --- /dev/null +++ b/clusterrolebinding.go @@ -0,0 +1,68 @@ +/* +Copyright 2019 Banzai Cloud. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package objectmatch + +import ( + "encoding/json" + + "github.com/goph/emperror" + rbacv1 "k8s.io/api/rbac/v1" +) + +type clusterRoleBindingMatcher struct { + objectMatcher ObjectMatcher +} + +func NewClusterRoleBindingMatcher(objectMatcher ObjectMatcher) *clusterRoleBindingMatcher { + return &clusterRoleBindingMatcher{ + objectMatcher: objectMatcher, + } +} + +// Match compares two rbacv1.ClusterRoleBinding objects +func (m clusterRoleBindingMatcher) Match(old, new *rbacv1.ClusterRoleBinding) (bool, error) { + type ClusterRoleBinding struct { + ObjectMeta + Subjects []rbacv1.Subject `json:"subjects,omitempty"` + RoleRef rbacv1.RoleRef `json:"roleRef"` + } + + oldData, err := json.Marshal(ClusterRoleBinding{ + ObjectMeta: m.objectMatcher.GetObjectMeta(old.ObjectMeta), + Subjects: old.Subjects, + RoleRef: old.RoleRef, + }) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal old object", "name", old.Name) + } + newObject := ClusterRoleBinding{ + ObjectMeta: m.objectMatcher.GetObjectMeta(new.ObjectMeta), + Subjects: new.Subjects, + RoleRef: new.RoleRef, + } + newData, err := json.Marshal(newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal new object", "name", new.Name) + } + + matched, err := m.objectMatcher.MatchJSON(oldData, newData, newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not match objects", "name", new.Name) + } + + return matched, nil +} diff --git a/configmap.go b/configmap.go new file mode 100644 index 0000000..bf7cb01 --- /dev/null +++ b/configmap.go @@ -0,0 +1,68 @@ +/* +Copyright 2019 Banzai Cloud. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package objectmatch + +import ( + "encoding/json" + + "github.com/goph/emperror" + corev1 "k8s.io/api/core/v1" +) + +type configMapMatcher struct { + objectMatcher ObjectMatcher +} + +func NewConfigMapMatcher(objectMatcher ObjectMatcher) *configMapMatcher { + return &configMapMatcher{ + objectMatcher: objectMatcher, + } +} + +// Match compares two corev1.ConfigMap objects +func (m configMapMatcher) Match(old, new *corev1.ConfigMap) (bool, error) { + type ConfigMap struct { + ObjectMeta + Data map[string]string `json:"data"` + BinaryData map[string][]byte `json:"binaryData"` + } + + oldData, err := json.Marshal(ConfigMap{ + ObjectMeta: m.objectMatcher.GetObjectMeta(old.ObjectMeta), + Data: old.Data, + BinaryData: old.BinaryData, + }) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal old object", "name", old.Name) + } + newConfigMap := ConfigMap{ + ObjectMeta: m.objectMatcher.GetObjectMeta(new.ObjectMeta), + Data: new.Data, + BinaryData: new.BinaryData, + } + newData, err := json.Marshal(newConfigMap) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal new object", "name", new.Name) + } + + matched, err := m.objectMatcher.MatchJSON(oldData, newData, newConfigMap) + if err != nil { + return false, emperror.WrapWith(err, "could not match objects", "name", new.Name) + } + + return matched, nil +} diff --git a/crd.go b/crd.go new file mode 100644 index 0000000..ff0340c --- /dev/null +++ b/crd.go @@ -0,0 +1,65 @@ +/* +Copyright 2019 Banzai Cloud. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package objectmatch + +import ( + "encoding/json" + + "github.com/goph/emperror" + extensionsobj "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" +) + +type crdMatcher struct { + objectMatcher ObjectMatcher +} + +func NewCRDMatcher(objectMatcher ObjectMatcher) *crdMatcher { + return &crdMatcher{ + objectMatcher: objectMatcher, + } +} + +// Match compares two extensionsobj.CustomResourceDefinition objects +func (m crdMatcher) Match(old, new *extensionsobj.CustomResourceDefinition) (bool, error) { + type CRD struct { + ObjectMeta + Spec extensionsobj.CustomResourceDefinitionSpec + } + + oldData, err := json.Marshal(CRD{ + ObjectMeta: m.objectMatcher.GetObjectMeta(old.ObjectMeta), + Spec: old.Spec, + }) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal old object", "name", old.Name) + } + newObject := CRD{ + ObjectMeta: m.objectMatcher.GetObjectMeta(new.ObjectMeta), + Spec: new.Spec, + } + newData, err := json.Marshal(newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal new object", "name", new.Name) + } + + matched, err := m.objectMatcher.MatchJSON(oldData, newData, newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not match objects", "name", new.Name) + } + + return matched, nil +} diff --git a/daemonset.go b/daemonset.go new file mode 100644 index 0000000..aa804c1 --- /dev/null +++ b/daemonset.go @@ -0,0 +1,65 @@ +/* +Copyright 2019 Banzai Cloud. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package objectmatch + +import ( + "encoding/json" + + "github.com/goph/emperror" + appsv1 "k8s.io/api/apps/v1" +) + +type daemonSetMatcher struct { + objectMatcher ObjectMatcher +} + +func NewDaemonSetMatcher(objectMatcher ObjectMatcher) *daemonSetMatcher { + return &daemonSetMatcher{ + objectMatcher: objectMatcher, + } +} + +// Match compares two appsv1.ClusterDaemonSet objects +func (m daemonSetMatcher) Match(old, new *appsv1.DaemonSet) (bool, error) { + type DaemonSet struct { + ObjectMeta + Spec appsv1.DaemonSetSpec + } + + oldData, err := json.Marshal(DaemonSet{ + ObjectMeta: m.objectMatcher.GetObjectMeta(old.ObjectMeta), + Spec: old.Spec, + }) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal old object", "name", old.Name) + } + newObject := DaemonSet{ + ObjectMeta: m.objectMatcher.GetObjectMeta(new.ObjectMeta), + Spec: new.Spec, + } + newData, err := json.Marshal(newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal new object", "name", new.Name) + } + + matched, err := m.objectMatcher.MatchJSON(oldData, newData, newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not match objects", "name", new.Name) + } + + return matched, nil +} diff --git a/deployment.go b/deployment.go new file mode 100644 index 0000000..2bc1b18 --- /dev/null +++ b/deployment.go @@ -0,0 +1,68 @@ +/* +Copyright 2019 Banzai Cloud. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package objectmatch + +import ( + "encoding/json" + + "github.com/goph/emperror" + appsv1 "k8s.io/api/apps/v1" +) + +type deploymentMatcher struct { + objectMatcher ObjectMatcher +} + +func NewDeploymentMatcher(objectMatcher ObjectMatcher) *deploymentMatcher { + return &deploymentMatcher{ + objectMatcher: objectMatcher, + } +} + +// Match compares two appsv1.Deployment objects +func (m deploymentMatcher) Match(old, new *appsv1.Deployment) (bool, error) { + type Deployment struct { + ObjectMeta + Spec appsv1.DeploymentSpec + } + + delete(old.ObjectMeta.Annotations, "deployment.kubernetes.io/revision") + delete(old.ObjectMeta.Annotations, "control-plane.alpha.kubernetes.io/leader") + + oldData, err := json.Marshal(Deployment{ + ObjectMeta: m.objectMatcher.GetObjectMeta(old.ObjectMeta), + Spec: old.Spec, + }) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal old object", "name", old.Name) + } + newObject := Deployment{ + ObjectMeta: m.objectMatcher.GetObjectMeta(new.ObjectMeta), + Spec: new.Spec, + } + newData, err := json.Marshal(newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal new object", "name", new.Name) + } + + matched, err := m.objectMatcher.MatchJSON(oldData, newData, newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not match objects", "name", new.Name) + } + + return matched, nil +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..a389f69 --- /dev/null +++ b/go.mod @@ -0,0 +1,13 @@ +module k8s-objectmatcher + +go 1.12 + +require ( + github.com/evanphx/json-patch v4.1.0+incompatible + github.com/go-logr/logr v0.1.0 + github.com/goph/emperror v0.17.1 + github.com/pkg/errors v0.8.1 + k8s.io/api v0.0.0-20190425012535-181e1f9c52c1 + k8s.io/apiextensions-apiserver v0.0.0-20190426053235-842c4571cde0 + k8s.io/apimachinery v0.0.0-20190425132440-17f84483f500 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..fd89dbd --- /dev/null +++ b/go.sum @@ -0,0 +1,224 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-autorest v11.1.2+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/BurntSushi/toml v0.3.0/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/airbrake/gobrake v3.6.1+incompatible/go.mod h1:wM4gu3Cn0W0K7GUuVWnlXZU11AGBXMILnrdOU8Kn00o= +github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= +github.com/bugsnag/bugsnag-go v1.4.0/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= +github.com/bugsnag/panicwrap v1.2.0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= +github.com/certifi/gocertifi v0.0.0-20190105021004-abcd57078448/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4= +github.com/coreos/bbolt v1.3.1-coreos.6/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-oidc v0.0.0-20180117170138-065b426bd416/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= +github.com/coreos/go-semver v0.0.0-20180108230905-e214231b295a/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v0.0.0-20160705203006-01aeca54ebda/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= +github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.1.0+incompatible h1:K1MDoo4AZ4wU0GIU/fPmtZg7VpzLjCxu+UwBD1FvwOc= +github.com/evanphx/json-patch v4.1.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= +github.com/ghodss/yaml v0.0.0-20180820084758-c7ce16629ff4/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= +github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.17.2/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.17.2/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.19.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.17.2/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= +github.com/go-openapi/runtime v0.17.2/go.mod h1:QO936ZXeisByFmZEO1IS1Dqhtf4QV1sYYFtIq6Ld86Q= +github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.17.2/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.17.2/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/validate v0.17.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= +github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= +github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415 h1:WSBJMqJbLxsn+bTCPyPYZfqHdJmc8MK4wrBjMft6BAM= +github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/btree v0.0.0-20160524151835-7d79101e329e/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck= +github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= +github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/goph/emperror v0.17.1 h1:6lOybhIvG/BB6VGoWfdv30FVZeZFBBZ9VvgzGXLVkyY= +github.com/goph/emperror v0.17.1/go.mod h1:+ZbQ+fUNO/6FNiUo0ujtMjhgad9Xa6fQL9KhH4LNHic= +github.com/gophercloud/gophercloud v0.0.0-20190126172459-c818fa66e4c8/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20190222133341-cfaf5686ec79/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v0.0.0-20170330212424-2500245aa611/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.3.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jonboulle/clockwork v0.0.0-20141017032234-72f9bd7c4e0c/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be h1:AHimNtVIpiBjPUhEF5KNCkrUyqTSA5zWUl8sQ2bfGBE= +github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= +github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v0.0.0-20190113212917-5533ce8a0da3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= +github.com/pquerna/ffjson v0.0.0-20180717144149-af8b230fcd20/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M= +github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= +github.com/rollbar/rollbar-go v1.0.2/go.mod h1:AcFs5f0I+c71bpHlXNNDbOWJiKwjFDtISeXco0L5PKQ= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/soheilhy/cmux v0.1.3/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spf13/cobra v0.0.0-20180319062004-c439c4fa0937/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v0.0.0-20171019201919-bdcc60b419d1/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= +github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +go.uber.org/atomic v0.0.0-20181018215023-8dc6146f7569/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v0.0.0-20180122172545-ddea229ff1df/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v0.0.0-20180814183419-67bc79d13d15/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181025213731-e84da0312774/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190206173232-65e2d4e15006/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313 h1:pczuHS43Cp2ktBEEmLwScxgjWsBSzdaQiKzUyf3DTTc= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db h1:6/JqlYfC1CCaLnGceQTI+sDGhC9UBSPAsBqI0Gun6kU= +golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20161028155119-f51c12702a4d/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20170731182057-09f6ed296fc6/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/grpc v1.13.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/inf.v0 v0.9.0 h1:3zYtXIO92bvsdS3ggAdA8Gb4Azj0YU+TVY1uGYNFA8o= +gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/natefinch/lumberjack.v2 v2.0.0-20150622162204-20b71e5b60d7/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/square/go-jose.v2 v2.0.0-20180411045311-89060dee6a84/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg= +gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +k8s.io/api v0.0.0-20190425012535-181e1f9c52c1 h1:VfWCVGGx0+ll/JC2oT+5ClpHdiLKLhuko1l7LKG4dh4= +k8s.io/api v0.0.0-20190425012535-181e1f9c52c1/go.mod h1:AhUc3Ph6fhRc0SCpt0Hwv0E+Q8QiEAASkXKwfmT2JwU= +k8s.io/apiextensions-apiserver v0.0.0-20190426053235-842c4571cde0 h1:blst2tV97kE1/Mxaxx3zzh6zUGpxCbGNq0CdFf9/N8s= +k8s.io/apiextensions-apiserver v0.0.0-20190426053235-842c4571cde0/go.mod h1:IPM+7P9C3mY4uik+2wHMNbydKfSZpl9Hnu0Ze0447Wg= +k8s.io/apimachinery v0.0.0-20190424052434-11f1676e3da4/go.mod h1:5CBnzrKYGHzv9ZsSKmQ8wHt4XI4/TUBPDwYM9FlZMyw= +k8s.io/apimachinery v0.0.0-20190424212440-527a9d33701e/go.mod h1:5CBnzrKYGHzv9ZsSKmQ8wHt4XI4/TUBPDwYM9FlZMyw= +k8s.io/apimachinery v0.0.0-20190425132440-17f84483f500 h1:WP0qwo6Cks8BJpy/B2EOUWOyuVoGEYu3x9kVpON7wTs= +k8s.io/apimachinery v0.0.0-20190425132440-17f84483f500/go.mod h1:5CBnzrKYGHzv9ZsSKmQ8wHt4XI4/TUBPDwYM9FlZMyw= +k8s.io/apiserver v0.0.0-20190426012941-33871ad74f4b/go.mod h1:omlj40TPI/OV4YFwPP09JuOkEkKbpS5bNE2T2sPeY80= +k8s.io/client-go v0.0.0-20190425172711-65184652c889/go.mod h1:PeVFCnjeDy6EwLN+wdDIZd1DwDY6jnkpQt9psMo5YRU= +k8s.io/code-generator v0.0.0-20190419212335-ff26e7842f9d/go.mod h1:rVrFWfTVftGH7bb972nWC6N4QkJ4LU7FOXu8GH2UkJo= +k8s.io/component-base v0.0.0-20190424053038-9fe063da3132/go.mod h1:pi2NQz+AaW5UMjaswai1Hfzqzhh7bV6ssi3X3k4s03g= +k8s.io/gengo v0.0.0-20190116091435-f8a0810f38af/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE= +k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 h1:TRb4wNWoBVrH9plmkp2q86FIDppkbrEXdXlxU3a3BMI= +k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= +k8s.io/utils v0.0.0-20190221042446-c2654d5206da h1:ElyM7RPonbKnQqOcw7dG2IK5uvQQn3b/WPHqD5mBvP4= +k8s.io/utils v0.0.0-20190221042446-c2654d5206da/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= +modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= +modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= +modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= +modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= +modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +sigs.k8s.io/structured-merge-diff v0.0.0-20190302045857-e85c7b244fd2/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/hpa.go b/hpa.go new file mode 100644 index 0000000..12a8d40 --- /dev/null +++ b/hpa.go @@ -0,0 +1,65 @@ +/* +Copyright 2019 Banzai Cloud. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package objectmatch + +import ( + "encoding/json" + + "github.com/goph/emperror" + autoscalev2beta1 "k8s.io/api/autoscaling/v2beta1" +) + +type horizontalPodAutoscalerMatcher struct { + objectMatcher ObjectMatcher +} + +func NewHorizontalPodAutoscalerMatcher(objectMatcher ObjectMatcher) *horizontalPodAutoscalerMatcher { + return &horizontalPodAutoscalerMatcher{ + objectMatcher: objectMatcher, + } +} + +// Match compares two autoscalev2beta1.HorizontalPodAutoscaler objects +func (m horizontalPodAutoscalerMatcher) Match(old, new *autoscalev2beta1.HorizontalPodAutoscaler) (bool, error) { + type HorizontalPodAutoscaler struct { + ObjectMeta + Spec autoscalev2beta1.HorizontalPodAutoscalerSpec + } + + oldData, err := json.Marshal(HorizontalPodAutoscaler{ + ObjectMeta: m.objectMatcher.GetObjectMeta(old.ObjectMeta), + Spec: old.Spec, + }) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal old object", "name", old.Name) + } + newObject := HorizontalPodAutoscaler{ + ObjectMeta: m.objectMatcher.GetObjectMeta(new.ObjectMeta), + Spec: new.Spec, + } + newData, err := json.Marshal(newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal new object", "name", new.Name) + } + + matched, err := m.objectMatcher.MatchJSON(oldData, newData, newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not match objects", "name", new.Name) + } + + return matched, nil +} diff --git a/mutatingwebhook.go b/mutatingwebhook.go new file mode 100644 index 0000000..ea01379 --- /dev/null +++ b/mutatingwebhook.go @@ -0,0 +1,93 @@ +/* +Copyright 2019 Banzai Cloud. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package objectmatch + +import ( + "encoding/json" + + "github.com/goph/emperror" + admissionv1beta1 "k8s.io/api/admissionregistration/v1beta1" +) + +type mutatingWebhookConfigurationMatcher struct { + objectMatcher ObjectMatcher +} + +func NewMutatingWebhookConfigurationMatcher(objectMatcher ObjectMatcher) *mutatingWebhookConfigurationMatcher { + return &mutatingWebhookConfigurationMatcher{ + objectMatcher: objectMatcher, + } +} + +// Match compares two admissionv1beta1.MutatingWebhookConfiguration objects +func (m mutatingWebhookConfigurationMatcher) Match(old, new *admissionv1beta1.MutatingWebhookConfiguration) (bool, error) { + type MutatingWebhookConfiguration struct { + ObjectMeta + Webhooks []admissionv1beta1.Webhook `json:"webhooks,omitempty" patchStrategy:"merge" patchMergeKey:"name"` + } + + old.Webhooks = nullCABundleConditionally(old.Webhooks, new.Webhooks) + + oldData, err := json.Marshal(MutatingWebhookConfiguration{ + ObjectMeta: m.objectMatcher.GetObjectMeta(old.ObjectMeta), + Webhooks: old.Webhooks, + }) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal old object", "name", old.Name) + } + + newObject := MutatingWebhookConfiguration{ + ObjectMeta: m.objectMatcher.GetObjectMeta(new.ObjectMeta), + Webhooks: new.Webhooks, + } + newData, err := json.Marshal(newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal new object", "name", new.Name) + } + + matched, err := m.objectMatcher.MatchJSON(oldData, newData, newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not match objects", "name", new.Name) + } + + return matched, nil +} + +// nullCABundleConditionally nils ClientConfig.CABundle value in the old object if it is nil in the new to avoid conflict +func nullCABundleConditionally(oldWebhooks, newWebhooks []admissionv1beta1.Webhook) []admissionv1beta1.Webhook { + for i, wh := range oldWebhooks { + nwh := getWebhookByName(wh.Name, newWebhooks) + if nwh == nil || nwh.ClientConfig.CABundle != nil { + continue + } + wh.ClientConfig.CABundle = nil + oldWebhooks[i] = wh + } + + return oldWebhooks +} + +// getWebhookByName gets webhook from webhooks by its name +func getWebhookByName(name string, webhooks []admissionv1beta1.Webhook) *admissionv1beta1.Webhook { + for _, webhook := range webhooks { + if webhook.Name == name { + return &webhook + } + } + + return nil +} diff --git a/objectmatch.go b/objectmatch.go new file mode 100644 index 0000000..ad9e068 --- /dev/null +++ b/objectmatch.go @@ -0,0 +1,312 @@ +/* +Copyright 2019 Banzai Cloud. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package objectmatch + +import ( + "encoding/json" + "reflect" + + jsonpatch "github.com/evanphx/json-patch" + "github.com/go-logr/logr" + "github.com/goph/emperror" + "github.com/pkg/errors" + admissionv1beta1 "k8s.io/api/admissionregistration/v1beta1" + appsv1 "k8s.io/api/apps/v1" + autoscalev2beta1 "k8s.io/api/autoscaling/v2beta1" + corev1 "k8s.io/api/core/v1" + policyv1beta1 "k8s.io/api/policy/v1beta1" + rbacv1 "k8s.io/api/rbac/v1" + extensionsobj "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/util/strategicpatch" +) + +type ObjectMatcher interface { + Match(old, new interface{}) (bool, error) + GetObjectMeta(objectMeta metav1.ObjectMeta) ObjectMeta + MatchJSON(old, new []byte, obj interface{}) (bool, error) +} + +type objectMatcher struct { + logger logr.Logger +} + +func New(logger logr.Logger) ObjectMatcher { + return &objectMatcher{ + logger: logger, + } +} + +func (om *objectMatcher) Match(old, new interface{}) (bool, error) { + if reflect.TypeOf(old) != reflect.TypeOf(new) { + return false, emperror.With(errors.New("old and new object types mismatch"), "oldType", reflect.TypeOf(old), "newType", reflect.TypeOf(new)) + } + + switch old.(type) { + default: + return false, nil + case *unstructured.Unstructured: + oldObject := old.(*unstructured.Unstructured) + newObject := new.(*unstructured.Unstructured) + + m := NewUnstructuredMatcher(om) + ok, err := m.Match(oldObject, newObject) + if err != nil { + return false, errors.WithStack(err) + } + return ok, nil + case *corev1.ServiceAccount: + oldObject := old.(*corev1.ServiceAccount) + newObject := new.(*corev1.ServiceAccount) + + m := NewServiceAccountMatcher(om) + ok, err := m.Match(oldObject, newObject) + if err != nil { + return false, errors.WithStack(err) + } + return ok, nil + case *rbacv1.ClusterRole: + oldObject := old.(*rbacv1.ClusterRole) + newObject := new.(*rbacv1.ClusterRole) + + m := NewClusterRoleMatcher(om) + ok, err := m.Match(oldObject, newObject) + if err != nil { + return false, errors.WithStack(err) + } + return ok, nil + case *rbacv1.ClusterRoleBinding: + oldObject := old.(*rbacv1.ClusterRoleBinding) + newObject := new.(*rbacv1.ClusterRoleBinding) + + m := NewClusterRoleBindingMatcher(om) + ok, err := m.Match(oldObject, newObject) + if err != nil { + return false, errors.WithStack(err) + } + return ok, nil + case *appsv1.Deployment: + oldObject := old.(*appsv1.Deployment) + newObject := new.(*appsv1.Deployment) + + m := NewDeploymentMatcher(om) + ok, err := m.Match(oldObject, newObject) + if err != nil { + return false, errors.WithStack(err) + } + return ok, nil + case *corev1.Service: + oldObject := old.(*corev1.Service) + newObject := new.(*corev1.Service) + + m := NewServiceMatcher(om) + ok, err := m.Match(oldObject, newObject) + if err != nil { + return false, errors.WithStack(err) + } + return ok, nil + case *corev1.ConfigMap: + oldObject := old.(*corev1.ConfigMap) + newObject := new.(*corev1.ConfigMap) + + m := NewConfigMapMatcher(om) + ok, err := m.Match(oldObject, newObject) + if err != nil { + return false, errors.WithStack(err) + } + return ok, nil + case *extensionsobj.CustomResourceDefinition: + oldObject := old.(*extensionsobj.CustomResourceDefinition) + newObject := new.(*extensionsobj.CustomResourceDefinition) + + m := NewCRDMatcher(om) + ok, err := m.Match(oldObject, newObject) + if err != nil { + return false, errors.WithStack(err) + } + return ok, nil + case *autoscalev2beta1.HorizontalPodAutoscaler: + oldObject := old.(*autoscalev2beta1.HorizontalPodAutoscaler) + newObject := new.(*autoscalev2beta1.HorizontalPodAutoscaler) + + m := NewHorizontalPodAutoscalerMatcher(om) + ok, err := m.Match(oldObject, newObject) + if err != nil { + return false, errors.WithStack(err) + } + return ok, nil + case *admissionv1beta1.MutatingWebhookConfiguration: + oldObject := old.(*admissionv1beta1.MutatingWebhookConfiguration) + newObject := new.(*admissionv1beta1.MutatingWebhookConfiguration) + + m := NewMutatingWebhookConfigurationMatcher(om) + ok, err := m.Match(oldObject, newObject) + if err != nil { + return false, errors.WithStack(err) + } + return ok, nil + case *policyv1beta1.PodDisruptionBudget: + oldObject := old.(*policyv1beta1.PodDisruptionBudget) + newObject := new.(*policyv1beta1.PodDisruptionBudget) + + m := NewPodDisruptionBudgetMatcher(om) + ok, err := m.Match(oldObject, newObject) + if err != nil { + return false, errors.WithStack(err) + } + return ok, nil + case *appsv1.DaemonSet: + oldObject := old.(*appsv1.DaemonSet) + newObject := new.(*appsv1.DaemonSet) + + m := NewDaemonSetMatcher(om) + ok, err := m.Match(oldObject, newObject) + if err != nil { + return false, errors.WithStack(err) + } + return ok, nil + case *rbacv1.Role: + oldObject := old.(*rbacv1.Role) + newObject := new.(*rbacv1.Role) + + m := NewRoleMatcher(om) + ok, err := m.Match(oldObject, newObject) + if err != nil { + return false, errors.WithStack(err) + } + return ok, nil + case *rbacv1.RoleBinding: + oldObject := old.(*rbacv1.RoleBinding) + newObject := new.(*rbacv1.RoleBinding) + + m := NewRoleBindingMatcher(om) + ok, err := m.Match(oldObject, newObject) + if err != nil { + return false, errors.WithStack(err) + } + return ok, nil + } +} + +type ObjectMeta struct { + Labels map[string]string `json:"labels,omitempty"` + Annotations map[string]string `json:"annotations,omitempty"` + OwnerReferences []metav1.OwnerReference `json:"ownerReferences,omitempty"` +} + +func (om *objectMatcher) GetObjectMeta(objectMeta metav1.ObjectMeta) ObjectMeta { + if len(objectMeta.Annotations) == 0 { + objectMeta.Annotations = make(map[string]string) + } + + if len(objectMeta.Labels) == 0 { + objectMeta.Labels = make(map[string]string) + } + + return ObjectMeta{ + Labels: objectMeta.Labels, + Annotations: objectMeta.Annotations, + OwnerReferences: objectMeta.OwnerReferences, + } +} + +func (om *objectMatcher) MatchJSON(old, new []byte, obj interface{}) (bool, error) { + var patch []byte + var err error + + _, unstructed := obj.(*unstructured.Unstructured) + if unstructed { + patch, err = jsonpatch.CreateMergePatch(old, new) + if err != nil { + return false, emperror.Wrap(err, "could not create json merge patch") + } + } else { + patch, err = strategicpatch.CreateTwoWayMergePatch(old, new, obj) + if err != nil { + return false, emperror.Wrap(err, "could not create two way merge patch") + } + } + + patch, _, err = om.deleteNullInJsonPatch(patch) + if err != nil { + return false, emperror.Wrap(err, "could not remove nil values from json merge patch") + } + + if string(patch) == "{}" { + return true, nil + } + + om.logger.V(1).Info("objects differs", "diff", string(patch), "old", string(old), "new", string(new)) + + return false, nil +} + +func (om *objectMatcher) deleteNullInJsonPatch(patch []byte) ([]byte, map[string]interface{}, error) { + var patchMap map[string]interface{} + + err := json.Unmarshal(patch, &patchMap) + if err != nil { + return nil, nil, emperror.Wrap(err, "could not unmarshal json patch") + } + + filteredMap, err := om.deleteNullInObj(patchMap) + if err != nil { + return nil, nil, emperror.Wrap(err, "could not delete null values from patch map") + } + + o, err := json.Marshal(filteredMap) + if err != nil { + return nil, nil, emperror.Wrap(err, "could not marshal filtered patch map") + } + + return o, filteredMap, err +} + +func (om *objectMatcher) deleteNullInObj(m map[string]interface{}) (map[string]interface{}, error) { + var err error + filteredMap := make(map[string]interface{}) + + for key, val := range m { + if val == nil { + continue + } + + switch typedVal := val.(type) { + default: + return nil, errors.Errorf("unknown type: %v", reflect.TypeOf(typedVal)) + case []interface{}, string, float64, bool, int64, nil: + filteredMap[key] = val + case map[string]interface{}: + if len(typedVal) == 0 { + filteredMap[key] = typedVal + continue + } + + var filteredSubMap map[string]interface{} + filteredSubMap, err = om.deleteNullInObj(typedVal) + if err != nil { + return nil, emperror.Wrap(err, "could not delete null values from filtered sub map") + } + + if len(filteredSubMap) != 0 { + filteredMap[key] = filteredSubMap + } + } + } + return filteredMap, nil +} diff --git a/pdb.go b/pdb.go new file mode 100644 index 0000000..f00735d --- /dev/null +++ b/pdb.go @@ -0,0 +1,65 @@ +/* +Copyright 2019 Banzai Cloud. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package objectmatch + +import ( + "encoding/json" + + "github.com/goph/emperror" + policyv1beta1 "k8s.io/api/policy/v1beta1" +) + +type podDisruptionBudgetMatcher struct { + objectMatcher ObjectMatcher +} + +func NewPodDisruptionBudgetMatcher(objectMatcher ObjectMatcher) *podDisruptionBudgetMatcher { + return &podDisruptionBudgetMatcher{ + objectMatcher: objectMatcher, + } +} + +// Match compares two autoscalev2beta1.HorizontalPodAutoscaler objects +func (m podDisruptionBudgetMatcher) Match(old, new *policyv1beta1.PodDisruptionBudget) (bool, error) { + type PodDisruptionBudgetMatcher struct { + ObjectMeta + Spec policyv1beta1.PodDisruptionBudgetSpec + } + + oldData, err := json.Marshal(PodDisruptionBudgetMatcher{ + ObjectMeta: m.objectMatcher.GetObjectMeta(old.ObjectMeta), + Spec: old.Spec, + }) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal old object", "name", old.Name) + } + newObject := PodDisruptionBudgetMatcher{ + ObjectMeta: m.objectMatcher.GetObjectMeta(new.ObjectMeta), + Spec: new.Spec, + } + newData, err := json.Marshal(newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal new object", "name", new.Name) + } + + matched, err := m.objectMatcher.MatchJSON(oldData, newData, newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not match objects", "name", new.Name) + } + + return matched, nil +} diff --git a/role.go b/role.go new file mode 100644 index 0000000..57701f6 --- /dev/null +++ b/role.go @@ -0,0 +1,65 @@ +/* +Copyright 2019 Banzai Cloud. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package objectmatch + +import ( + "encoding/json" + + "github.com/goph/emperror" + rbacv1 "k8s.io/api/rbac/v1" +) + +type roleMatcher struct { + objectMatcher ObjectMatcher +} + +func NewRoleMatcher(objectMatcher ObjectMatcher) *roleMatcher { + return &roleMatcher{ + objectMatcher: objectMatcher, + } +} + +// Match compares two rbacv1.ClusterRole objects +func (m roleMatcher) Match(old, new *rbacv1.Role) (bool, error) { + type Role struct { + ObjectMeta + Rules []rbacv1.PolicyRule `json:"rules"` + } + + oldData, err := json.Marshal(Role{ + ObjectMeta: m.objectMatcher.GetObjectMeta(old.ObjectMeta), + Rules: old.Rules, + }) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal old object", "name", old.Name) + } + newObject := Role{ + ObjectMeta: m.objectMatcher.GetObjectMeta(new.ObjectMeta), + Rules: new.Rules, + } + newData, err := json.Marshal(newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal new object", "name", new.Name) + } + + matched, err := m.objectMatcher.MatchJSON(oldData, newData, newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not match objects", "name", new.Name) + } + + return matched, nil +} diff --git a/rolebinding.go b/rolebinding.go new file mode 100644 index 0000000..362f377 --- /dev/null +++ b/rolebinding.go @@ -0,0 +1,68 @@ +/* +Copyright 2019 Banzai Cloud. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package objectmatch + +import ( + "encoding/json" + + "github.com/goph/emperror" + rbacv1 "k8s.io/api/rbac/v1" +) + +type roleBindingMatcher struct { + objectMatcher ObjectMatcher +} + +func NewRoleBindingMatcher(objectMatcher ObjectMatcher) *roleBindingMatcher { + return &roleBindingMatcher{ + objectMatcher: objectMatcher, + } +} + +// Match compares two rbacv1.RoleBinding objects +func (m roleBindingMatcher) Match(old, new *rbacv1.RoleBinding) (bool, error) { + type RoleBinding struct { + ObjectMeta + Subjects []rbacv1.Subject `json:"subjects,omitempty"` + RoleRef rbacv1.RoleRef `json:"roleRef"` + } + + oldData, err := json.Marshal(RoleBinding{ + ObjectMeta: m.objectMatcher.GetObjectMeta(old.ObjectMeta), + Subjects: old.Subjects, + RoleRef: old.RoleRef, + }) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal old object", "name", old.Name) + } + newObject := RoleBinding{ + ObjectMeta: m.objectMatcher.GetObjectMeta(new.ObjectMeta), + Subjects: new.Subjects, + RoleRef: new.RoleRef, + } + newData, err := json.Marshal(newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal new object", "name", new.Name) + } + + matched, err := m.objectMatcher.MatchJSON(oldData, newData, newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not match objects", "name", new.Name) + } + + return matched, nil +} diff --git a/scripts/check-header.sh b/scripts/check-header.sh new file mode 100755 index 0000000..332dfd1 --- /dev/null +++ b/scripts/check-header.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +read -r -d '' EXPECTED </dev/null; then + # Replace the actual year with DATE so we can ignore the year when + # checking for the license header. + HEADER=$(head -n 15 $FILE | sed -E -e 's/Copyright [0-9]+/Copyright DATE/') + if [ "$HEADER" != "$EXPECTED" ]; then + echo "incorrect license header: $FILE" + STATUS=1 + fi + fi +done + +exit $STATUS \ No newline at end of file diff --git a/service.go b/service.go new file mode 100644 index 0000000..2d1d57d --- /dev/null +++ b/service.go @@ -0,0 +1,70 @@ +/* +Copyright 2019 Banzai Cloud. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package objectmatch + +import ( + "encoding/json" + "reflect" + + "github.com/goph/emperror" + corev1 "k8s.io/api/core/v1" +) + +type serviceMatcher struct { + objectMatcher ObjectMatcher +} + +func NewServiceMatcher(objectMatcher ObjectMatcher) *serviceMatcher { + return &serviceMatcher{ + objectMatcher: objectMatcher, + } +} + +// Match compares two corev1.Service objects +func (m serviceMatcher) Match(old, new *corev1.Service) (bool, error) { + type Service struct { + ObjectMeta + Spec corev1.ServiceSpec + } + + if !reflect.DeepEqual(m.objectMatcher.GetObjectMeta(old.ObjectMeta), m.objectMatcher.GetObjectMeta(new.ObjectMeta)) { + return false, nil + } + + oldData, err := json.Marshal(Service{ + ObjectMeta: m.objectMatcher.GetObjectMeta(old.ObjectMeta), + Spec: old.Spec, + }) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal old object", "name", old.Name) + } + newObject := Service{ + ObjectMeta: m.objectMatcher.GetObjectMeta(new.ObjectMeta), + Spec: new.Spec, + } + newData, err := json.Marshal(newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal new object", "name", new.Name) + } + + matched, err := m.objectMatcher.MatchJSON(oldData, newData, newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not match objects", "name", new.Name) + } + + return matched, nil +} diff --git a/serviceaccount.go b/serviceaccount.go new file mode 100644 index 0000000..262f770 --- /dev/null +++ b/serviceaccount.go @@ -0,0 +1,62 @@ +/* +Copyright 2019 Banzai Cloud. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package objectmatch + +import ( + "encoding/json" + + "github.com/goph/emperror" + corev1 "k8s.io/api/core/v1" +) + +type serviceAccountMatcher struct { + objectMatcher ObjectMatcher +} + +func NewServiceAccountMatcher(objectMatcher ObjectMatcher) *serviceAccountMatcher { + return &serviceAccountMatcher{ + objectMatcher: objectMatcher, + } +} + +// Match compares two corev1.ServiceAccount objects +func (m serviceAccountMatcher) Match(old, new *corev1.ServiceAccount) (bool, error) { + type ServiceAccount struct { + ObjectMeta + } + + oldData, err := json.Marshal(ServiceAccount{ + ObjectMeta: m.objectMatcher.GetObjectMeta(old.ObjectMeta), + }) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal old object", "name", old.Name) + } + newObject := ServiceAccount{ + ObjectMeta: m.objectMatcher.GetObjectMeta(new.ObjectMeta), + } + newData, err := json.Marshal(newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal new object", "name", new.Name) + } + + matched, err := m.objectMatcher.MatchJSON(oldData, newData, newObject) + if err != nil { + return false, emperror.WrapWith(err, "could not match objects", "name", new.Name) + } + + return matched, nil +} diff --git a/unstructured.go b/unstructured.go new file mode 100644 index 0000000..466f4ed --- /dev/null +++ b/unstructured.go @@ -0,0 +1,53 @@ +/* +Copyright 2019 Banzai Cloud. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package objectmatch + +import ( + "encoding/json" + + "github.com/goph/emperror" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" +) + +type unstructuredMatcher struct { + objectMatcher ObjectMatcher +} + +func NewUnstructuredMatcher(objectMatcher ObjectMatcher) *unstructuredMatcher { + return &unstructuredMatcher{ + objectMatcher: objectMatcher, + } +} + +// Match compares two unstructured.Unstructured objects +func (m unstructuredMatcher) Match(old, new *unstructured.Unstructured) (bool, error) { + oldData, err := json.Marshal(old) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal old object", "name", old.GetName()) + } + newData, err := json.Marshal(new) + if err != nil { + return false, emperror.WrapWith(err, "could not marshal new object", "name", new.GetName()) + } + + matched, err := m.objectMatcher.MatchJSON(oldData, newData, new) + if err != nil { + return false, emperror.WrapWith(err, "could not match objects", "name", new.GetName()) + } + + return matched, nil +}