{"id":37226110,"url":"https://github.com/sergioifg94/gokrm","last_synced_at":"2026-01-15T01:52:46.508Z","repository":{"id":113611821,"uuid":"416463453","full_name":"sergioifg94/gokrm","owner":"sergioifg94","description":"An object-Kubernetes resource-mapper for Golang","archived":false,"fork":false,"pushed_at":"2021-10-13T09:47:24.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T17:49:01.663Z","etag":null,"topics":["go","golang","kubernetes","operators","reflection"],"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/sergioifg94.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}},"created_at":"2021-10-12T19:02:43.000Z","updated_at":"2022-03-01T14:05:11.000Z","dependencies_parsed_at":"2024-06-21T19:09:44.333Z","dependency_job_id":null,"html_url":"https://github.com/sergioifg94/gokrm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sergioifg94/gokrm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergioifg94%2Fgokrm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergioifg94%2Fgokrm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergioifg94%2Fgokrm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergioifg94%2Fgokrm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergioifg94","download_url":"https://codeload.github.com/sergioifg94/gokrm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergioifg94%2Fgokrm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28441031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:55:22.719Z","status":"ssl_error","status_checked_at":"2026-01-15T00:55:20.945Z","response_time":107,"last_error":"SSL_read: 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":["go","golang","kubernetes","operators","reflection"],"created_at":"2026-01-15T01:52:45.161Z","updated_at":"2026-01-15T01:52:46.500Z","avatar_url":"https://github.com/sergioifg94.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gokrm : An Object-Kubernetes Resource-Mapper for Go\n\ngokrm (pronounced _go-kay-rem_) is a Go library that provides tooling to build declarative, simple reconcilers for Kubernetes resources, using a single source of truth that can be a custom resource or a configuration value, and reflection, to dynamically introspect the soure type and generate the mapped resources.\n\n## Example\n\nThe following is an example of a `SourceType` mapped into a `Deployment` and `Service`:\n\n```go\n// Type declaration\ntype sourceType struct {\n  metav1.ObjectMeta\n\n  Image     string `gokrmTarget:\"Deployment\" gokrmTargetField:\"Spec.Template.Spec.Containers[0].Image\"`\n  Replicas  *int32 `gokrmTarget:\"Deployment\" gokrmTargetField:\"Spec.Replicas\"`\n  ClusterIP string `gokrmTarget:\"Service\" gokrmTargetField:\"Spec.ClusterIP\"`\n  Port      int32  `gokrmTarget:\"Service\" gokrmTargetField:\"Spec.Ports[0].Port\"`\n}\n```\n\n\u003e Note the `gokrmTarget` and `gokrmTargetField` tags. They indicate where to map these fields to.\n\nAn example value\n\n```go\nsource := SourceType{\n  ObjectMeta: metav1.ObjectMeta{\n    Name:      \"test\",\n    Namespace: \"default\",\n  },\n  Replicas:  intptr(10),\n  ClusterIP: \"1.1.1.1\",\n  Image:     \"image:latest\",\n  Port:      8080,\n}\n```\n\nWill result in the following resources being generated:\n\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  creationTimestamp: null\n  name: test\n  namespace: default\nspec:\n  replicas: 10\n  selector: null\n  strategy: {}\n  template:\n    metadata:\n      creationTimestamp: null\n    spec:\n      containers:\n      - image: image:latest\n        name: \"\"\n        resources: {}\nstatus: {}\n---\napiVersion: v1\nkind: Service\nmetadata:\n  creationTimestamp: null\n  name: test\n  namespace: default\nspec:\n  clusterIP: 1.1.1.1\n  ports:\n  - port: 8080\n    targetPort: 0\nstatus:\n  loadBalancer: {}\n\n```\n\n## Usage","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergioifg94%2Fgokrm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergioifg94%2Fgokrm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergioifg94%2Fgokrm/lists"}