{"id":25971394,"url":"https://github.com/eclipse/che-operator","last_synced_at":"2025-03-05T00:01:47.215Z","repository":{"id":37031871,"uuid":"158560707","full_name":"eclipse-che/che-operator","owner":"eclipse-che","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-29T14:07:16.000Z","size":44441,"stargazers_count":66,"open_issues_count":7,"forks_count":88,"subscribers_count":28,"default_branch":"main","last_synced_at":"2024-10-29T17:14:36.595Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eclipse-che.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-21T14:30:42.000Z","updated_at":"2024-10-28T12:52:44.000Z","dependencies_parsed_at":"2024-03-18T09:40:55.939Z","dependency_job_id":"4321a40d-b7f3-421f-a7e7-db1556d2f42a","html_url":"https://github.com/eclipse-che/che-operator","commit_stats":null,"previous_names":["eclipse/che-operator"],"tags_count":173,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-che%2Fche-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-che%2Fche-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-che%2Fche-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-che%2Fche-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eclipse-che","download_url":"https://codeload.github.com/eclipse-che/che-operator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241940550,"owners_count":20045881,"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":"2025-03-05T00:01:22.693Z","updated_at":"2025-03-05T00:01:47.125Z","avatar_url":"https://github.com/eclipse-che.png","language":"Go","funding_links":[],"categories":["Repository is obsolete"],"sub_categories":["Awesome Operators in the Wild"],"readme":"[![Contribute](https://www.eclipse.org/che/contribute.svg)](https://workspaces.openshift.com#https://github.com/eclipse-che/che-operator)\n[![Dev](https://img.shields.io/static/v1?label=Open%20in\u0026message=Che%20dogfooding%20server%20(with%20VS%20Code)\u0026logo=eclipseche\u0026color=FDB940\u0026labelColor=525C86)](https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com#https://github.com/eclipse-che/che-operator)\n\n# Che/Red Hat OpenShift Dev Spaces Operator\n\n[![codecov](https://codecov.io/gh/eclipse-che/che-operator/branch/main/graph/badge.svg?token=IlYvrVU5nB)](https://codecov.io/gh/eclipse-che/che-operator)\n\n- [Description](#Description)\n- [Development](#Development)\n  - [Update golang dependencies](#Update-golang-dependencies)\n  - [Run unit tests](#Run-unit-tests)\n  - [Format the code and fix imports](#Format-the-code-and-fix-imports)\n  - [Update development resources](#Update-development-resources)\n  - [Build Che operator image](#Build-Che-operator-image)\n  - [Deploy Che operator](#Deploy-Che-operator)\n  - [Update Che operator](#Update-Che-operator)\n  - [Debug Che operator](#Debug-Che-operator)\n  - [Validation licenses for runtime dependencies](#Validation-licenses-for-runtime-dependencies)\n- [Builds](#Builds)\n- [License](#License)\n \n\n## Description\n\nChe/Red Hat OpenShift Dev Spaces operator uses [Operator SDK](https://github.com/operator-framework/operator-sdk) and [Go Kube client](https://github.com/kubernetes/client-go) to deploy, update and manage K8S/OpenShift resources that constitute a multi-user Eclipse Che/Red Hat OpenShift Dev Spaces cluster.\n\nThe operator watches for a Custom Resource of Kind `CheCluster`, and operator controller executes its business logic when a new Che object is created, namely:\n\n* creates k8s/OpenShift objects\n* verifies successful deployment of Postgres, Devfile/Plugin registries, Dashboard and Che server\n* updates CR status (passwords, URLs, provisioning statuses etc.)\n* etc\n\nChe operator is implemented using [operator framework](https://github.com/operator-framework) and the Go programming language. Eclipse Che configuration defined using a custom resource definition object and stored in the custom Kubernetes resource named `checluster`(or plural `checlusters`) in the Kubernetes API group `org.eclipse.che`. Che operator extends Kubernetes API to embed Eclipse Che to Kubernetes cluster in a native way.\n\n## Development\n\n### Update golang dependencies\n\n```bash\nmake update-go-dependencies\n```\n\nNew golang dependencies in the vendor folder should be committed and included in the pull request.\n\n**Note:** freeze all new transitive dependencies using \"replaces\" in `go.mod` file section\nto prevent CQ issues.\n\n### Run unit tests\n\n```bash\nmake test\n```\n\n### Format the code and fix imports\n\n```bash\nmake fmt\n```\n\n### Update development resources\n\nYou have to update development resources \nif you updated any files in `config` folder or `api/v2/checluster_types.go` file.\nTo generate new resource, run the following command:\n\n```bash\nmake update-dev-resources\n```\n\n### Build Che operator image\n\n```bash\nmake docker-build docker-push IMG=\u003cYOUR_OPERATOR_IMAGE\u003e\n```\n\n### Deploy Che operator\n\nFor OpenShift cluster:\n\n```bash\nbuild/scripts/olm/test-catalog-from-sources.sh\n```\n\nFor Kubernetes cluster:\n\n```bash\nmake gen-chectl-tmpl TEMPLATES=\u003cOPERATOR_RESOURCES_PATH\u003e\nchectl server:deploy -p (k8s|minikube|microk8s|docker-desktop) --che-operator-image=\u003cYOUR_OPERATOR_IMAGE\u003e --templates \u003cOPERATOR_RESOURCES_PATH\u003e\n```\n\n### Update Che operator\n\nYou can modify any Kubernetes object using the UI (for example OpenShift web console) \nor you can also modify Kubernetes objects using the terminal:\n\n```bash\nkubectl edit checluster eclipse-che -n \u003cECLIPSE-CHE-NAMESPACE\u003e\n```\n\nor:\n\n```bash\nkubectl patch checluster/eclipse-che --type=merge -p '\u003cPATCH_JSON\u003e' -n \u003cECLIPSE-CHE-NAMESPACE\u003e\n```\n\n### Debug Che operator\n\nYou can run/debug this operator on your local machine (without deploying to a k8s cluster).\n\n\n```bash\nmake debug\n```\n\nThen use VSCode debug configuration `Che Operator` to attach to a running process.\n\n\n### Validation licenses for runtime dependencies\n\nChe operator is an Eclipse Foundation project. So we have to use only open source runtime dependencies with Eclipse compatible license https://www.eclipse.org/legal/licenses.php.\nRuntime dependencies license validation process described here: https://www.eclipse.org/projects/handbook/#ip-third-party\nTo merge code with third party dependencies you have to follow process: https://www.eclipse.org/projects/handbook/#ip-prereq-diligence\nWhen you are using new golang dependencies you have to validate the license for transitive dependencies too.\nYou can skip license validation for test dependencies.\nAll new dependencies you can find using git diff in the go.sum file.\n\nSometimes in the go.sum file you can find few versions for the same dependency:\n\n```go.sum\n...\ngithub.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=\ngithub.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk=\n...\n```\n\nIn this case will be used only one version(the highest) in the runtime, so you need to validate license for only one of them(the latest).\nBut also you can find module path https://golang.org/ref/mod#module-path with major version suffix in the go.sum file:\n\n```go.sum\n...\ngithub.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=\ngithub.com/evanphx/json-patch/v5 v5.1.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=\n...\n```\n\nIn this case we have the same dependency, but with different major versions suffix.\nMain project module uses both these versions in runtime. So both of them should be validated.\n\nAlso there is some useful golang commands to take a look full list dependencies:\n\n```bash\n$ go list -mod=mod -m all\n```\n\nThis command returns all test and runtime dependencies. Like mentioned above, you can skip test dependencies.\n\nIf you want to know dependencies relation you can build dependencies graph:\n\n```bash\n$ go mod graph\n```\n\n\u003e IMPORTANT: Dependencies validation information should be stored in the `DEPENDENCIES.md` file.\n\n## Builds\n\nThis repo contains several [actions](https://github.com/eclipse-che/che-operator/actions), including:\n* [![release latest stable](https://github.com/eclipse-che/che-operator/actions/workflows/release.yml/badge.svg)](https://github.com/eclipse-che/che-operator/actions/workflows/release.yml)\n* [![next builds](https://github.com/eclipse-che/che-operator/actions/workflows/build-next-images.yaml/badge.svg)](https://github.com/eclipse-che/che-operator/actions/workflows/build-next-images.yaml)\n* [![PR](https://github.com/eclipse-che/che-operator/actions/workflows/pr-check.yml/badge.svg)](https://github.com/eclipse-che/che-operator/actions/workflows/pr-check.yml)\n\nDownstream builds can be found at the link below, which is _internal to Red Hat_. Stable builds can be found by replacing the 3.x with a specific version like 3.2.  \n\n* [operator_3.x](https://main-jenkins-csb-crwqe.apps.ocp-c1.prod.psi.redhat.com/job/DS_CI/job/operator_3.x/)\n* [operator-bundle_3.x](https://main-jenkins-csb-crwqe.apps.ocp-c1.prod.psi.redhat.com/job/DS_CI/job/operator-bundle_3.x/)\n\nSee also:\n* [dsc_3.x](https://main-jenkins-csb-crwqe.apps.ocp-c1.prod.psi.redhat.com/job/DS_CI/job/dsc_3.x) (downstream equivalent of [chectl](https://github.com/redhat-developer/devspaces-chectl/))\n\n\n## License\n\nChe is open sourced under the Eclipse Public License 2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feclipse%2Fche-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feclipse%2Fche-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feclipse%2Fche-operator/lists"}