Skip to content

Commit

Permalink
fix: continue on error instead of return
Browse files Browse the repository at this point in the history
and adding local dev instructions in dev guide
  • Loading branch information
pauldotyu committed Jan 30, 2025
1 parent ee3c9bf commit 4e60bd8
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 deletions.
41 changes: 40 additions & 1 deletion docs/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,46 @@ following command for code regeneration.
make codegen
```

### Deploying and testing your changes on a cluster
### Deploying and testing your changes on a local dev cluster

Make sure you have a local dev cluster running and have the current kubeconfig context set to the local cluster as the following steps will use that to load the images and deploy the controller. The local dev cluster can be Minikube, Kind, or K3D.

#### 1. Building images

If you want a fresh build before building the container image, run the following commands to delete any existing binaries.

```
rm -rf dist
```

The following command will build the images and load/import it into the local cluster.

```
make image
```

#### 2. Make the manifests

To generate the manifests, run the following command:

```
make manifests
```

#### 3. Deploy the custom resource definitions (CRDs) and custom build of the controller

Run the following command to deploy the CRDs and controller:

```
make start
```

> ![NOTE]
> This command will build the images so you don't need to run `make image` before running `make start`.
### Deploying and testing your changes on managed clusters in the cloud

You might want to test certain changes on a managed cluster in the cloud. For example, testing Microsoft Entra ID Workload Identity on AKS. The following steps will guide you through that process.

#### 1. Building images

Expand Down
6 changes: 3 additions & 3 deletions pkg/eventsources/sources/azureeventshub/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (el *EventListener) StartListening(ctx context.Context, dispatch func([]byt

if err != nil && !errors.Is(err, context.DeadlineExceeded) {
log.Errorw("failed to receive events from partition", "partitionID", partitionID, zap.Error(err))
return
continue
}

for _, event := range receivedEvents {
Expand All @@ -145,14 +145,14 @@ func (el *EventListener) StartListening(ctx context.Context, dispatch func([]byt
if err != nil {
el.Metrics.EventProcessingFailed(el.GetEventSourceName(), el.GetEventName())
log.Errorw("failed to marshal the event data", "eventSource", el.GetEventName(), "messageID", *event.MessageID, zap.Error(err))
return
continue
}

log.Info("dispatching the event to eventbus...")
if err = dispatch(eventBytes); err != nil {
el.Metrics.EventProcessingFailed(el.GetEventSourceName(), el.GetEventName())
log.Errorw("failed to dispatch Azure EventHub event", zap.Error(err))
return
continue
}
}
}
Expand Down

0 comments on commit 4e60bd8

Please sign in to comment.