{"id":20325439,"url":"https://github.com/getyourguide/istio-config-validator","last_synced_at":"2025-04-11T19:51:05.474Z","repository":{"id":37085939,"uuid":"267548711","full_name":"getyourguide/istio-config-validator","owner":"getyourguide","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-08T14:54:02.000Z","size":644,"stargazers_count":39,"open_issues_count":6,"forks_count":6,"subscribers_count":62,"default_branch":"main","last_synced_at":"2024-04-08T18:17:05.311Z","etag":null,"topics":["go121","istio","sre","validation","virtualservice"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getyourguide.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-05-28T09:30:51.000Z","updated_at":"2024-04-15T14:32:27.331Z","dependencies_parsed_at":"2024-01-22T15:32:18.255Z","dependency_job_id":"59938548-00c4-4b2b-91ee-038bbae8a1eb","html_url":"https://github.com/getyourguide/istio-config-validator","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getyourguide%2Fistio-config-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getyourguide%2Fistio-config-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getyourguide%2Fistio-config-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getyourguide%2Fistio-config-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getyourguide","download_url":"https://codeload.github.com/getyourguide/istio-config-validator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224682704,"owners_count":17352397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go121","istio","sre","validation","virtualservice"],"created_at":"2024-11-14T19:39:49.587Z","updated_at":"2024-11-14T19:39:50.283Z","avatar_url":"https://github.com/getyourguide.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# istio-config-validator\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/getyourguide/istio-config-validator)](https://goreportcard.com/report/github.com/getyourguide/istio-config-validator)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/6bee3a704e8648949523cdcfcefacc1f)](https://www.codacy.com?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=getyourguide/istio-config-validator\u0026amp;utm_campaign=Badge_Grade)\n[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/6bee3a704e8648949523cdcfcefacc1f)](https://www.codacy.com?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=getyourguide/istio-config-validator\u0026utm_campaign=Badge_Coverage)\n\n\u003e The `istio-config-validator` tool is a **Work In Progress** project.\n\nIt provides to developers and cluster operators a way to test their changes in VirtualServices. We do it by mocking Istio/Envoy behavior to decide to which destination the request would go to. Eg:\n\n```yaml\napiVersion: networking.istio.io/v1alpha3\nkind: VirtualService\nmetadata:\n  name: example\n  namespace: example\nspec:\n  hosts:\n    - www.example.com\n    - example.com\n  http:\n    - match:\n        - uri:\n            regex: /users(/.*)?\n          headers:\n            x-user-type:\n              exact: qa\n      route:\n        - destination:\n            host: users.users.svc.cluster.local\n            port:\n              number: 80\n    - route:\n        - destination:\n            host: monolith.monolith.svc.cluster.local\n```\n\nGiven the above `VirtualService`, developers can introduce test cases that covers the intended behavior as the following:\n\n```yaml\ntestCases:\n  - description: Only QA users should go to the new Users microservice.\n    wantMatch: true\n    request:\n      authority: [\"www.example.com\", \"example.com\"]\n      method: [\"GET\", \"OPTIONS\", \"POST\"]\n      uri: [\"/users\", \"/users/\"]\n      headers:\n        x-user-type: qa\n    route:\n    - destination:\n        host: users.users.svc.cluster.local\n        port:\n          number: 80\n  - description: Fallback other user types to the monolith\n    wantMatch: true\n    request:\n      authority: [\"www.example.com\", \"example.com\"]\n      method: [\"GET\", \"OPTIONS\", \"POST\"]\n      uri: [\"/users\", \"/users/\"]\n    route:\n    - destination:\n        host: monolith.monolith.svc.cluster.local\n```\n\nHave a look in the [TestCase Reference](docs/test-cases.md) to learn more how to define the tests.\n\n## Installation\n\nEither install the go package\n\n```\n# go install github.com/getyourguide/istio-config-validator/cmd/istio-config-validator@latest\n```\n\nOr alternatively install the docker image\n\n```\n# docker pull getyourguide/istio-config-validator:latest\n```\n\n## Usage\n\n```\n# istio-config-validator -h\nUsage: istio-config-validator -t \u003ctestcases1.yml|testcasesdir1\u003e [-t \u003ctestcases2.yml|testcasesdir2\u003e ...] \u003cistioconfig1.yml|istioconfigdir1\u003e [\u003cistioconfig2.yml|istioconfigdir2\u003e ...]\n\n  -t value\n        Testcase files/folders\n```\n\n```\n# istio-config-validator -t examples/virtualservice_test.yml examples/virtualservice.yml\n2020-05-29T18:45:39.261018Z     info    running test: happy path users\n2020-05-29T18:45:39.261106Z     info    PASS input:[{www.example.com GET /users map[x-user-id:abc123]}]\n2020-05-29T18:45:39.261128Z     info    PASS input:[{www.example.com GET /users/ map[x-user-id:abc123]}]\n2020-05-29T18:45:39.261141Z     info    PASS input:[{www.example.com POST /users map[x-user-id:abc123]}]\n2020-05-29T18:45:39.261157Z     info    PASS input:[{www.example.com POST /users/ map[x-user-id:abc123]}]\n2020-05-29T18:45:39.261169Z     info    PASS input:[{example.com GET /users map[x-user-id:abc123]}]\n2020-05-29T18:45:39.261184Z     info    PASS input:[{example.com GET /users/ map[x-user-id:abc123]}]\n2020-05-29T18:45:39.261207Z     info    PASS input:[{example.com POST /users map[x-user-id:abc123]}]\n2020-05-29T18:45:39.261220Z     info    PASS input:[{example.com POST /users/ map[x-user-id:abc123]}]\n===========================\n2020-05-29T18:45:39.261228Z     info    running test: Partner service only accepts GET or OPTIONS\n2020-05-29T18:45:39.261256Z     info    PASS input:[{example.com PUT /partners map[]}]\n2020-05-29T18:45:39.261274Z     info    PASS input:[{example.com PUT /partners/1 map[]}]\n2020-05-29T18:45:39.261284Z     info    PASS input:[{example.com POST /partners map[]}]\n2020-05-29T18:45:39.261900Z     info    PASS input:[{example.com POST /partners/1 map[]}]\n2020-05-29T18:45:39.261940Z     info    PASS input:[{example.com PATCH /partners map[]}]\n2020-05-29T18:45:39.261984Z     info    PASS input:[{example.com PATCH /partners/1 map[]}]\n===========================\n```\n\n## Contributing\n\nIf you're interested in contributing to this project or running a dev version, have a look into the [CONTRIBUTING](CONTRIBUTING.md) document\n\n## Known Limitations\n\nThe API for test cases does not cover all aspects of VirtualServices.\n\n- Supported [HTTPMatchRequests](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPMatchRequest) fields to match requests against are: `authority`, `method`, `headers` and `uri`.\n  - Not supported ones: `scheme`, `port`, `queryParams`, etc.\n\n- Supported assert against [HTTPRouteDestination](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPRouteDestination), [HTTPRewrite](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPRewrite), [HTTPFaultInjection](https://istio.io/latest/docs/reference/config/networking/virtual-service/#HTTPFaultInjection), [Headers](https://istio.io/latest/docs/reference/config/networking/virtual-service/#Headers), [Delegate](https://istio.io/latest/docs/reference/config/networking/virtual-service/#Delegate) and [HTTPRedirect](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPRedirect).\n\n## Security\n\nFor sensitive security matters please contact [security@getyourguide.com](mailto:security@getyourguide.com).\n\n## Legal\n\nCopyright 2020 GetYourGuide GmbH.\n\nistio-config-validator is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetyourguide%2Fistio-config-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetyourguide%2Fistio-config-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetyourguide%2Fistio-config-validator/lists"}