From 4a4386e00976afa9f58105fe5cf388ba7a42c2d9 Mon Sep 17 00:00:00 2001 From: Anton Ovchinnikov Date: Tue, 28 Nov 2023 14:14:19 +0100 Subject: [PATCH] fix: tonyo -> getsentry --- .github/workflows/build-push.yaml | 16 ++++---- README.md | 62 +++++++++++++++---------------- go.mod | 2 +- k8s/manifests/deployment.yaml | 2 +- sentry.go | 2 +- 5 files changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/workflows/build-push.yaml b/.github/workflows/build-push.yaml index b6993f1..e8022e1 100644 --- a/.github/workflows/build-push.yaml +++ b/.github/workflows/build-push.yaml @@ -37,11 +37,11 @@ jobs: id: buildx uses: docker/setup-buildx-action@f03ac48505955848960e80bbb68046aa35c7b9e7 # v2.4.1 - - name: Log in to Docker Hub - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - username: tonyo - password: ${{ secrets.DOCKER_PASSWORD }} + # - name: Log in to Docker Hub + # uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + # with: + # username: sentrybuilder + # password: ${{ secrets.DOCKER_PASSWORD }} - name: Log in to the Container registry uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 @@ -60,8 +60,8 @@ jobs: platforms: "${{ matrix.arch }}" push: ${{ github.ref == 'refs/heads/main' }} tags: | - tonyo/sentry-kubernetes:latest - tonyo/sentry-kubernetes:${{ github.sha }} + getsentry/sentry-kubernetes:latest + getsentry/sentry-kubernetes:${{ github.sha }} ghcr.io/${{ github.repository }}:latest ghcr.io/${{ github.repository }}:${{ github.sha }} @@ -73,5 +73,5 @@ jobs: # - name: Generate SBOM # uses: anchore/sbom-action@07978da4bdb4faa726e52dfc6b1bed63d4b56479 # v0.13.3 # with: - # image: tonyo/sentry-kubernetes:latest + # image: getsentry/sentry-kubernetes:latest # format: text diff --git a/README.md b/README.md index 2e03c2d..d43e140 100644 --- a/README.md +++ b/README.md @@ -57,74 +57,74 @@ If you don't want to report certain kinds of events to Sentry, you can configure 1. Install necessary dependencies to run Kubernetes locally 1. Install `docker` and start the docker daemon - + [https://docs.docker.com/engine/install/](https://docs.docker.com/engine/install/) - + `docker` is a service that manages containers and is used by Kubernetes to create nodes (since `kind` actually create Kubernetes “nodes” as docker containers rather than VMs) - + 2. Install `kind` and add it to PATH - + [https://kind.sigs.k8s.io/docs/user/quick-start/](https://kind.sigs.k8s.io/docs/user/quick-start/) - + `kind` is a tool for running local Kubernetes clusters and we use it here for testing. The container runtime used by it is `containerd`, which is the same runtime used now by Docker. - + 3. Install `kubectl`, which is the command line tool we use to interact with Kubernetes clusters ran locally by `kind` - + [https://kubernetes.io/docs/tasks/tools/](https://kubernetes.io/docs/tasks/tools/) - + 2. Run Kubernetes cluster locally for development purposes 1. Create a Kubernetes cluster with `kind` using the command (the cluster name is “kind” by default) - + `kind create cluster` - + b. Output information about the created cluster named “kind” or some cluster name you have chosen using the following command (replacing `` with `kind` if default used) - + `kubectl cluster-info --context kind-` - + You should see an output similar to the following: - + ```bash Kubernetes control plane is running at https://127.0.0.1:61502 CoreDNS is running at https://127.0.0.1:61502/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy ``` - + 3. Run the `sentry-kubernetes` Go module (which must be performed after the Kubernetes cluster is already running because the module requires the `kubeconfig` file) 1. Clone the `sentry-kubernetes` repository - - `git clone https://github.com/tonyo/sentry-kubernetes.git` - + + `git clone https://github.com/getsentry/sentry-kubernetes.git` + b. Pass a valid Sentry DSN to the an environment variable named `SENTRY_DSN` ([https://docs.sentry.io/product/sentry-basics/concepts/dsn-explainer/](https://docs.sentry.io/product/sentry-basics/concepts/dsn-explainer/)) - + c. At the root of the repository directory, build the Go module with the command - + `make build` - + d. Run the module outside of the k8s cluster by executing the command - + `go run .` - + which now starts up the process that automatically detects the cluster configuration in order to detect events - + 4. Add error-producing pods to test event capturing 1. Create resources (e.g. pods or deployments) using existing manifests meant to produce errors to be captured by `sentry-kubernetes`. For example, we can apply the manifest for a pod that exhibits crash loop behavior with the command - + `kubectl apply -f ./k8s/errors/pod-crashloop.yaml` - + b. Check that the pod is created using the command - + `kubectl get pods` - + which should produce an output similar to the following: - + ```bash NAME READY STATUS RESTARTS AGE pod-crashloop 0/1 CrashLoopBackOff 32 (33s ago) 3h10m ``` - + Notice that the Status is `CrashLoopBackOff`, which is the intended state for our purpose - + c. Check that the `sentry-kubernetes` process capture this crash loop error by checking for the an output similar to the following: - + ```bash [Sentry] 2023/11/08 12:07:53 Using release from Git: abc123 12:07PM INF Auto-detecting cluster configuration... diff --git a/go.mod b/go.mod index 3ec177c..24626fd 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/tonyo/sentry-kubernetes +module github.com/getsentry/sentry-kubernetes go 1.20 diff --git a/k8s/manifests/deployment.yaml b/k8s/manifests/deployment.yaml index f7de62c..286f876 100644 --- a/k8s/manifests/deployment.yaml +++ b/k8s/manifests/deployment.yaml @@ -17,7 +17,7 @@ spec: app: sentry-kubernetes spec: containers: - - image: tonyo/sentry-kubernetes:b7bf56753286880bb47a9caaa8621a3bf6c6b4d5 + - image: getsentry/sentry-kubernetes:b7bf56753286880bb47a9caaa8621a3bf6c6b4d5 name: sentry-kubernetes env: - name: SENTRY_K8S_LOG_LEVEL diff --git a/sentry.go b/sentry.go index 2089a8b..4de5d95 100644 --- a/sentry.go +++ b/sentry.go @@ -11,7 +11,7 @@ import ( func beforeSend(event *sentry.Event, hint *sentry.EventHint) *sentry.Event { // Update SDK info - event.Sdk.Name = "tonyo.sentry-kubernetes" + event.Sdk.Name = "getsentry.sentry-kubernetes" event.Sdk.Version = version // Clear modules/packages