{"id":43229236,"url":"https://github.com/xdavidwu/kubectl-mutated","last_synced_at":"2026-02-01T10:02:20.552Z","repository":{"id":300499408,"uuid":"1006134961","full_name":"xdavidwu/kubectl-mutated","owner":"xdavidwu","description":"The answer to \"Are we GitOps yet?\"","archived":false,"fork":false,"pushed_at":"2025-08-11T12:31:20.000Z","size":149,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-19T09:55:28.404Z","etag":null,"topics":["gitops","kubectl","kubectl-plugins","kubernetes","managed-fields"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xdavidwu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-21T15:15:23.000Z","updated_at":"2025-08-11T12:31:23.000Z","dependencies_parsed_at":"2025-06-22T03:31:08.709Z","dependency_job_id":"742d2eb2-ab66-4c48-9950-8f84e089c44e","html_url":"https://github.com/xdavidwu/kubectl-mutated","commit_stats":null,"previous_names":["xdavidwu/kubectl-mutated"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xdavidwu/kubectl-mutated","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdavidwu%2Fkubectl-mutated","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdavidwu%2Fkubectl-mutated/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdavidwu%2Fkubectl-mutated/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdavidwu%2Fkubectl-mutated/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xdavidwu","download_url":"https://codeload.github.com/xdavidwu/kubectl-mutated/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdavidwu%2Fkubectl-mutated/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28975278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T09:57:52.632Z","status":"ssl_error","status_checked_at":"2026-02-01T09:57:49.143Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["gitops","kubectl","kubectl-plugins","kubernetes","managed-fields"],"created_at":"2026-02-01T10:02:20.474Z","updated_at":"2026-02-01T10:02:20.546Z","avatar_url":"https://github.com/xdavidwu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kubectl-mutated\n\nShow what resources have been mutated by a field manager that might be operated manually, like kubectl\n\nSome GitOps or CD solutions ensure only fields specified in definitions are in sync, by the nature of \"apply\" operation. If you manually edit other fields that are absent in the golden definitions while debugging, they will stick and it is easy to forget to write them back into the definitions.\n\nOperator pattern products may have a similar problems too. In Kubernetes, it is common to use \"apply\" to manage only the fields of interest, and make it possible for other entities, including humans, to manage other fields.\n\nThis tool helps to find what fields of resources are managed by human, to make sure that resources are fully managed by machine, keeping them deterministic and reproducible.\n\nThere are other ways to prevent manual editing of resources. `kustomize-controller` of Flux v2 [revokes kubectl managed fields ownership](https://github.com/fluxcd/kustomize-controller/pull/527) to undo changes from kubectl, even on fields not specified on GitOps. The managers-to-revoke lists can be further extended via `--override-manager`.\n\nOn identifying manually managed fields, this tool is still a more comprehensive solution. It inspects all resources, not just the ones directly managed by some controllers.\n\n## Usage\n\n```sh\nkubectl mutated [flags]\n```\n\n## Examples\n\n```sh\n# List such resources under current namespace\nkubectl mutated\n\n# List such resources under namespace \"my-space\"\nkubectl mutated -n my-space\n\n# List such resources of all types under any namespaces, including cluster-scoped resources\nkubectl mutated --all-namespaces\n\n# Output in YAML highlighting such fields\nkubectl mutated -o hyaml\n\n# Output in YAML filtered to such fields\nkubectl mutated -o fyaml\n```\n\n## FAQs\n\n- What if my CD scripts also use `kubectl`?\n\nSet `--field-manager` of `kubectl` to something else in your scripts.\n\n- What if I do want some resources, such as secrets, to be managed by hand?\n\nUse a different field manager like above, or set a label like `managed-by: hand` and run `kubectl mutated` with `--selector 'managed-by!=hand'`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxdavidwu%2Fkubectl-mutated","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxdavidwu%2Fkubectl-mutated","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxdavidwu%2Fkubectl-mutated/lists"}