{"id":22271584,"url":"https://github.com/appthrust/kubernetes-list-type-map-and-server-side-apply","last_synced_at":"2025-03-25T15:53:39.263Z","repository":{"id":265671889,"uuid":"715859285","full_name":"appthrust/kubernetes-list-type-map-and-server-side-apply","owner":"appthrust","description":"Kubernetes: `listType=map` And Server-side Apply Demo","archived":false,"fork":false,"pushed_at":"2023-11-08T01:17:02.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-19T13:45:04.616Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appthrust.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-11-08T01:16:44.000Z","updated_at":"2023-11-08T01:17:06.000Z","dependencies_parsed_at":"2024-11-30T12:46:34.151Z","dependency_job_id":"4fca72de-8c24-4100-b472-7c917e470e8e","html_url":"https://github.com/appthrust/kubernetes-list-type-map-and-server-side-apply","commit_stats":null,"previous_names":["appthrust/kubernetes-list-type-map-and-server-side-apply"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appthrust%2Fkubernetes-list-type-map-and-server-side-apply","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appthrust%2Fkubernetes-list-type-map-and-server-side-apply/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appthrust%2Fkubernetes-list-type-map-and-server-side-apply/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appthrust%2Fkubernetes-list-type-map-and-server-side-apply/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appthrust","download_url":"https://codeload.github.com/appthrust/kubernetes-list-type-map-and-server-side-apply/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245495820,"owners_count":20624807,"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":[],"created_at":"2024-12-03T12:12:37.783Z","updated_at":"2025-03-25T15:53:39.246Z","avatar_url":"https://github.com/appthrust.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubernetes: `listType=map` And Server-side Apply Demo\n\n## How to run\n\nCRD `document.suin.jp` を作成します:\n\n```bash\ncargo run --bin apply_crd\n```\n\nCR `example` を作成します:\n\n```bash\ncargo run --bin create\n```\n\nすると、次のようなCRが作成されます:\n\n```yaml\n\napiVersion: suin.jp/v1\nkind: Document\nmetadata:\n  # ...\n  name: example\n  namespace: default\n  # ...\nspec:\n  tags:\n    - key: key1\n      value: value1\n    - key: key2\n      value: value2\n    - key: key3\n      value: value3\n    - key: key4\n      value: value4\n  title: Example document\n```\n\nこのCRは2つのマネージャーによって管理されています。マネージャーはそれぞれ異なるタグを持っています:\n\n- マネージャー1: `manager-1`\n  - タグ: `key1`, `key2`\n- マネージャー2: `manager-2`\n  - タグ: `key3`, `key4`\n\nCR `example` を更新します:\n\n```bash\ncargo run --bin update\n```\n\nこの処理では、次のことをします。\n\n- マネージャー1はタグ `key2` を `new-value2!` に更新します。\n  - `key1`はペイロードに含まれていません。\n- マネージャー2はタグ `key4` を `new-value4!` に更新します。\n  - `key3`はペイロードに含まれていません。\n\nこの処理の詳細は[update.rs](./src/update.rs)を参照してください。\n\nすると、次のような差分が発生します:\n\n```diff\nmanager-1でApplyした場合のdiff:\n title: Example document\n tags:\n-- key: key1\n-  value: value1\n - key: key2\n-  value: value2\n+  value: new-value2!\n - key: key3\n   value: value3\n - key: key4\n   value: value4\n\nmanager-2でApplyした場合のdiff:\n title: Example document\n tags:\n - key: key1\n   value: value1\n - key: key2\n   value: value2\n-- key: key3\n-  value: value3\n - key: key4\n-  value: value4\n+  value: new-value4!\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappthrust%2Fkubernetes-list-type-map-and-server-side-apply","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappthrust%2Fkubernetes-list-type-map-and-server-side-apply","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappthrust%2Fkubernetes-list-type-map-and-server-side-apply/lists"}