{"id":18868834,"url":"https://github.com/tom24d/eventing-dockerhub","last_synced_at":"2025-07-31T17:35:40.137Z","repository":{"id":37020508,"uuid":"263226974","full_name":"tom24d/eventing-dockerhub","owner":"tom24d","description":"DockerHub as a knative event-source","archived":false,"fork":false,"pushed_at":"2023-11-15T00:36:08.000Z","size":28775,"stargazers_count":6,"open_issues_count":5,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-28T04:01:51.888Z","etag":null,"topics":["cloudevents","dockerhub","golang","knative","kubernetes"],"latest_commit_sha":null,"homepage":"","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/tom24d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-05-12T03:54:18.000Z","updated_at":"2024-01-23T07:41:26.000Z","dependencies_parsed_at":"2023-09-29T02:09:27.355Z","dependency_job_id":"0c091625-3462-4075-9065-7af01944b125","html_url":"https://github.com/tom24d/eventing-dockerhub","commit_stats":{"total_commits":318,"total_committers":7,"mean_commits":45.42857142857143,"dds":"0.28616352201257866","last_synced_commit":"01eb6718dc694fc690bbc54b0c564768ebc17c39"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":"knative-extensions/sample-source","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom24d%2Feventing-dockerhub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom24d%2Feventing-dockerhub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom24d%2Feventing-dockerhub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom24d%2Feventing-dockerhub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tom24d","download_url":"https://codeload.github.com/tom24d/eventing-dockerhub/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248897234,"owners_count":21179562,"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":["cloudevents","dockerhub","golang","knative","kubernetes"],"created_at":"2024-11-08T05:14:54.911Z","updated_at":"2025-04-14T14:31:58.797Z","avatar_url":"https://github.com/tom24d.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Knative Eventing DockerHub Source\n\nKnative Eventing `DockerHubSource` defines an event source that transforms webhook events\nfrom hub.docker.com into CloudEvents and deliver to the specified sink in the configuration yaml.\n\nTo learn more about Knative, please visit\n[Knative docs](https://github.com/knative/docs) repository.\n\nIf you are interested in contributing, see [CONTRIBUTING.md](./CONTRIBUTING.md)\nand [DEVELOPMENT.md](./DEVELOPMENT.md).\n\nThe initial idea comes from [JBoss community](https://docs.jboss.org/display/GSOC/Google+Summer+of+Code+2020+ideas#GoogleSummerofCode2020ideas-Knative-Eventsourcesforcontainerregistries,pipelinesandbuilds).  \nThis is a part of [Google Summer of Code 2020 project](https://summerofcode.withgoogle.com/projects/?sp-search=tom24d#5186775800086528).  \nThe demonstration video is [here](https://youtu.be/iU1Jnq0fq8A).  \n\n## Before you begin\n\n`DockerHubSource` installation requires two knative component on your kubernetes cluster.  \nPlus, you need a build tool `ko`.\n\n- Knative Serving core v0.16+  \n- Knative Eventing core v0.16+  \n- [ko](https://github.com/google/ko)  \n\n\n## Installation  \nInstall DockerHubSource from the source:\n\n```bash\nko apply -f config\n```\n\n## DockerHubSource usage example\n\nApplying example(autoCallback enabled)\n\n```bash\nkubectl apply -f ./example/normal-display.yaml\nkubectl apply -f ./example/source.yaml\n```\n\nThe examples also have `callback-display.yaml` to try `disableAutoCallback=true` mode.  \nUnder the circumstance that the appropriate sink is in the `source.yaml`, `callback-display.yaml` needs `ko` in order to apply.  \n\nYou can see the resource is created via: `kubectl get dockerhubsource`.  \n```\n% kubectl get dockerhubsources.sources.knative.dev\nNAME               READY   REASON   URL                                          AGE\ndockerhub-source   True             http://\u003cyour-endpoint-for-DockerHubSource\u003e   17s\n\n```  \n\nCopy `http://\u003cyour-endpoint-for-DockerHubSource\u003e` to configure dockerhub webhook. See [DockerHub Reference](https://docs.docker.com/docker-hub/webhooks/).  \n\n## API Reference\n\n### v1alpha1\n\n|Field|Description|\n|:---|:---|\n|`apiVersion`  \u003cbr\u003estring| `sources.knative.dev/v1alpha1`|\n|`kind` \u003cbr\u003e string| `DockerHubSource`|\n|`metadata` \u003cbr\u003e [Kubernetes\u003cbr\u003emeta/v1.metadata](https://github.com/knative/docs/blob/master/docs/reference/eventing/eventing-contrib.md#duck.knative.dev/v1.CloudEventOverrides)| Refer to the Kubernetes API documentation for the fields of the `metadata` field.|\n|`Spec` \u003cbr\u003e DockerHubSourceSpec| \u003ctable\u003e \u003ctr\u003e \u003ctd\u003e\u003ccode\u003e disableAutoCallback \u003c/code\u003e \u003cbr\u003e bool\u003c/td\u003e \u003ctd\u003e (Optional) \u003cbr\u003e DisableAutoCallback configures whether the adapter works with automatic callback feature. \u003cbr\u003eDocker Hub webhook needs validation callback to continually receive its chain. If the field is false, the adapter automatically sends a corresponding callback. Whichever the event gets delivered successfully or not, callback status is always `success`.  \u003cbr\u003eIf unspecified, this will default to false.\u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e\u003ccode\u003e SourceSpec \u003c/code\u003e \u003cbr\u003e \u003ca href=\"https://github.com/knative/docs/blob/master/docs/reference/eventing/eventing-contrib.md#duck.knative.dev/v1.SourceSpec\"\u003eSourceSpec\u003c/a\u003e\u003c/td\u003e \u003ctd\u003e(Members of SourceSpec are embedded into this type.)\u003c/td\u003e \u003c/tr\u003e \u003c/table\u003e|\n|`Status` \u003cbr\u003e DockerHubSourceStatus| \u003ctable\u003e  \u003ctr\u003e \u003ctd\u003e\u003ccode\u003e SourceStatus \u003c/code\u003e \u003cbr\u003e \u003ca href=\"https://github.com/knative/docs/blob/master/docs/reference/eventing/eventing-contrib.md#duck.knative.dev/v1.SourceStatus\"\u003eSourceStatus\u003c/a\u003e\u003c/td\u003e \u003ctd\u003e(Members of SourceStatus are embedded into this type.)\u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e\u003ccode\u003e AutoCallbackDisabled \u003c/code\u003e \u003cbr\u003e bool\u003c/td\u003e \u003ctd\u003e  AutoCallbackDisabled is the status whether automatic callback is disabled.\u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e\u003ccode\u003e URL \u003c/code\u003e \u003cbr\u003e knative.dev/pkg/apis.URL\u003c/td\u003e \u003ctd\u003e (Optional) \u003cbr\u003e URL is the current active allocated URL that has been configured for the Source endpoint.\u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e\u003ccode\u003e ReceiveAdapterServiceName \u003c/code\u003e \u003cbr\u003e string\u003c/td\u003e \u003ctd\u003e (Optional) \u003cbr\u003e ReceiveAdapterServiceName holds knative service name to allocate same URL as before when accidentally deleted. \u003cbr\u003e Further context is in [#37](https://github.com/tom24d/eventing-dockerhub/pull/37). \u003c/td\u003e \u003c/tr\u003e \u003c/table\u003e|\n\n---\n### Example CloudEvent payload\n\n```\nValidation: valid\nContext Attributes,\n  specversion: 1.0\n  type: tom24d.source.dockerhub.push\n  source: https://hub.docker.com/r/tom24d/postwebhook\n  subject: tom24d\n  id: fd4c1670-b126-4289-b025-61579ceeee3d\n  time: 2020-06-19T05:32:48Z\n  datacontenttype: application/json\nExtensions,\n  tag: latest\nData,\n  {\n    \"callback_url\": \"https://registry.hub.docker.com/u/tom24d/postwebhook/hook/2g51gffa2h1b4eh3ed355je0bc4g0e2h/\",\n    \"push_data\": {\n      \"images\": [],\n      \"pushed_at\": 1592544800,\n      \"pusher\": \"tom24d\",\n      \"tag\": \"latest\"\n    },\n    \"repository\": {\n      \"comment_count\": 0,\n      \"date_created\": 1591154200,\n      \"description\": \"[test] dockerhub website description.\",\n      \"dockerfile\": \"\",\n      \"full_description\": \"\",\n      \"is_official\": false,\n      \"is_private\": false,\n      \"is_trusted\": false,\n      \"name\": \"postwebhook\",\n      \"namespace\": \"tom24d\",\n      \"owner\": \"tom24d\",\n      \"repo_name\": \"tom24d/postwebhook\",\n      \"repo_url\": \"https://hub.docker.com/r/tom24d/postwebhook\",\n      \"star_count\": 0,\n      \"status\": \"Active\"\n    }\n  }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom24d%2Feventing-dockerhub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftom24d%2Feventing-dockerhub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom24d%2Feventing-dockerhub/lists"}