{"id":37856523,"url":"https://github.com/pilillo/mastro-operator","last_synced_at":"2026-01-16T16:27:30.243Z","repository":{"id":83297495,"uuid":"386647026","full_name":"pilillo/mastro-operator","owner":"pilillo","description":null,"archived":false,"fork":false,"pushed_at":"2021-07-16T17:19:04.000Z","size":9195,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-19T16:42:05.088Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pilillo.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-07-16T13:29:36.000Z","updated_at":"2021-07-16T17:19:07.000Z","dependencies_parsed_at":"2023-03-12T17:54:25.455Z","dependency_job_id":null,"html_url":"https://github.com/pilillo/mastro-operator","commit_stats":{"total_commits":2,"total_committers":2,"mean_commits":1.0,"dds":0.5,"last_synced_commit":"6933aecb4acc609991692db27681a35ee4f23e2f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pilillo/mastro-operator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilillo%2Fmastro-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilillo%2Fmastro-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilillo%2Fmastro-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilillo%2Fmastro-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pilillo","download_url":"https://codeload.github.com/pilillo/mastro-operator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilillo%2Fmastro-operator/sbom","scorecard":{"id":733901,"data":{"date":"2025-08-11","repo":{"name":"github.com/pilillo/mastro-operator","commit":"6933aecb4acc609991692db27681a35ee4f23e2f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/2 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: bin/controller-gen:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: Dockerfile:2","Warn: containerImage not pinned by hash: Dockerfile:22: pin your Docker image by updating gcr.io/distroless/static:nonroot to gcr.io/distroless/static:nonroot@sha256:cdf4daaf154e3e27cfffc799c16f343a384228f38646928a1513d925f473cb46","Info:   0 out of   2 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T15:11:23.928Z","repository_id":83297495,"created_at":"2025-08-22T15:11:23.929Z","updated_at":"2025-08-22T15:11:23.929Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","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":[],"created_at":"2026-01-16T16:27:29.448Z","updated_at":"2026-01-16T16:27:30.231Z","avatar_url":"https://github.com/pilillo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mastro-operator\n\nA walk through the creation an example operator using the operator SDK.\n\n## Install the operator-sdk bin\n* Download a suitable binary from [here](https://github.com/operator-framework/operator-sdk/releases)\n* `sudo chmod +x /usr/local/bin/operator-sdk`\n\n## Init a new operator project\n```\nexport GO111MODULE=on\noperator-sdk init \\\n--domain=data-mill.cloud \\\n--repo=github.com/pilillo/mastro-operator \\\n--license apache2 \\\n--owner \"pilillo\"\n```\n\n## Create a new resource API\n```\noperator-sdk create api \\\n    --version=v1alpha1 \\\n    --kind=Catalogue\n```\n\nA skeleton for the CR definition is now available at the `api/v1alpha1` subfolder.  \nA skeleton for the controller is now available at the `controllers/catalogue_controller.go` subfolder.\n\n## Generate CRD code at any modification of the struct type\n```\nmake generate\n```\n\n## Generate RBAC manifests after setting the `+kubebuilder:rbac` markers\n```\nmake manifests\n```\n\n## Controller\n\nThe `catalogue_controller.go` defines the controller logic:\n\nThe function `SetupWithManager` defines a new controller and specifies to watch **For** resources of kind `datamillcloudv1alpha1.Catalogue`.  \nThus, upon any add/update/delete event the reconcile loop will be sent a reconcile *Request* for the object.\nAdditional resources can be watched (using *Owns*) as well as additional options can be set using *WithOptions* (see [here](https://sdk.operatorframework.io/docs/building-operators/golang/tutorial/#implement-the-controller))\n\n```go\n// SetupWithManager sets up the controller with the Manager.\nfunc (r *CatalogueReconciler) SetupWithManager(mgr ctrl.Manager) error {\n\treturn ctrl.NewControllerManagedBy(mgr).\n\t\tFor(\u0026datamillcloudv1alpha1.Catalogue{}).\n\t\tComplete(r)\n}\n```\n\nThe *Reconcile* function implements the reconcile loop, which is passed the *Request* argument (a namespace/name key).\n\n```go\nfunc (r *CatalogueReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {\n\t_ = log.FromContext(ctx)\n\n\t// your logic here\n\n\treturn ctrl.Result{}, nil\n}\n```\n\nSo we can directly retrieve the watched resource and act accordingly:\n```go\nfunc (r *CatalogueReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {\n\t_ = log.FromContext(ctx)\n\n\t// your logic here\n\tcatalogue := \u0026datamillcloudv1alpha1.Catalogue{}\n\terr := r.Get(ctx, req.NamespacedName, catalogue)\n\tif err != nil {\n\t\treturn ctrl.Result{}, err\n\t}\n\n\treturn ctrl.Result{}, nil\n}\n```\n\nBased on the returned error, the Request may be requeued and the reconcile triggered again:\n```go\n// Reconcile successful - don't requeue\nreturn ctrl.Result{}, nil\n// Reconcile failed due to error - requeue\nreturn ctrl.Result{}, err\n// Requeue for any reason other than an error\nreturn ctrl.Result{Requeue: true}, nil\n```\n\n## Testing the operator\nThe operator can be run either outside or on the cluster.  \n\nTo install the CRD:\n```bash\nmake install\n```\n\nTo run the controller on the host (outside the cluster):\n```bash\nmake run .\n```\n\nTo deploy the controller as deployment on the cluster:\n```bash\nmake deploy\n```\n\nAlternatively, the [operator lifecycle manager (OLM)](https://sdk.operatorframework.io/docs/olm-integration/quickstart-bundle/#enabling-olm) can be used similarly to,  \nrun locally\n```bash\noperator-sdk run --local\n```\n\n## Building the operator\nTo build the operator image and push it to the desired registry the Makefile can be used.  \nSpecifically:\n```bash\nexport IMG=datamillcloud/mastro-operator:v0.0.1\nmake docker-build\nmake docker-push\n```\n\nwhich will build and push the image to Dockerhub.  \nThe Makefile is like follows:  \n```bash\ndocker-build: test ## Build docker image with the manager.\n\tdocker build -t ${IMG} .\n\ndocker-push: ## Push docker image with the manager.\n\tdocker push ${IMG}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilillo%2Fmastro-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpilillo%2Fmastro-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilillo%2Fmastro-operator/lists"}