Skip to content

Add support for managing base job templates#194

Merged
chrisguidry merged 6 commits intoPrefectHQ:mainfrom
tinkerborg:base-job-templates
Sep 16, 2025
Merged

Add support for managing base job templates#194
chrisguidry merged 6 commits intoPrefectHQ:mainfrom
tinkerborg:base-job-templates

Conversation

@tinkerborg
Copy link
Contributor

This implements support for managing workpool base job templates.

Opening as a draft for now and will convert to regular PR after finishing unit tests.

fixes #189

Copy link
Collaborator

@chrisguidry chrisguidry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty solid from my seat, would just like to see some more unit tests if you have the bandwidth.

type PrefectWorkPoolStatus struct {
// Id is the workPool ID from Prefect
// +optional
Id *string `json:"id,omitempty"`
Copy link
Collaborator

@chrisguidry chrisguidry Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 How were we getting away without the Id before? I guess the API mostly deals in work pool names rather than IDs, but this is a good addition for sure.

Value *runtime.RawExtension `json:"value,omitempty"`
}

// TODO - no admission webhook yet
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great call, we've been needing this for a while, I made an issue for it: #195

Copy link
Collaborator

@chrisguidry chrisguidry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the direction! Tag me when you're ready for a review 🙇

@tinkerborg
Copy link
Contributor Author

Love the direction! Tag me when you're ready for a review 🙇

Sorry for the delay.. ready! @chrisguidry

Copy link
Collaborator

@chrisguidry chrisguidry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this one, @tinkerborg!

@chrisguidry chrisguidry merged commit 68fee77 into PrefectHQ:main Sep 16, 2025
8 checks passed
@tinkerborg tinkerborg deleted the base-job-templates branch September 16, 2025 12:40
@chrisguidry
Copy link
Collaborator

@tinkerborg and @Blarc, this is merged now and there are dev versions of the image and chart available:

Image: prefecthq/prefect-operator-dev:latest,prefecthq/prefect-operator-dev:68fee77
Chart: 2025.9.16122710-dev

Once we've had some chances to test this out, I'll cut a release.

@mitchnielsen mitchnielsen added the enhancement New feature or request label Dec 11, 2025
mitchnielsen added a commit that referenced this pull request Dec 17, 2025
The operator needs to read ConfigMaps from any namespace where users
deploy PrefectWorkPools or PrefectServers. This was missed when PR #194
added ConfigMap watching for base job templates - the controller calls
`Watches(&corev1.ConfigMap{}, ...)` which requires cluster-wide list/watch
permissions to sync the informer at startup.

Without these permissions, the operator fails with RBAC errors and enters
CrashLoopBackOff.

Closes #234

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
mitchnielsen added a commit that referenced this pull request Dec 17, 2025
## Summary

The operator needs to read ConfigMaps from any namespace where users
deploy PrefectWorkPools or PrefectServers. This was missed when PR #194
added ConfigMap watching for base job templates - the controller calls
`Watches(&corev1.ConfigMap{}, ...)` which requires cluster-wide
list/watch permissions to sync the informer at startup.

Without these permissions, the operator fails with RBAC errors and
enters CrashLoopBackOff.

The existing unit tests didn't catch this because envtest doesn't
enforce RBAC - it's a simulated API server that grants all permissions.
This kind of issue only surfaces when deploying to a real cluster. To
confirm this, I deployed to a local cluster:

```
$ kubectl get pods -n prefect-system
NAME                                READY   STATUS    RESTARTS   AGE
prefect-operator-564fbfd7c9-kr5k6   1/1     Running   0          4m30s
```

Closes #234

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update WorkPool's Job Configuration

3 participants