Define JobRequest resource#17
Merged
Merged
Conversation
AP-Hunt
reviewed
May 20, 2026
| Conditions []metav1.Condition `json:"conditions,omitempty"` | ||
| JobName string `json:"jobName,omitempty"` | ||
| // +kubebuilder:validation:Enum=Requested;Approved;Rejected;Started;Completed;Failed | ||
| State string `json:"state,omitempty"` |
Member
There was a problem hiding this comment.
Is it idiomatic Go to use type aliases to constrain, or at least suggest, valid values?
type Status = string
var (
StatusRequested Status = "Requested"
StatusApproved = "Approved"
// ...
)
Member
Author
There was a problem hiding this comment.
The validation here ends up in the CRD, so you'd need to define the set of valid options twice. I'm going to leave it as is for now, and if creating a type alias makes it easier to implement the actual operator logic, it could be added later
nimalank7
reviewed
May 20, 2026
nimalank7
reviewed
May 20, 2026
nimalank7
reviewed
May 20, 2026
33b916f to
7e4d366
Compare
Also fix a load of incorrect package names across the project
7e4d366 to
f942c27
Compare
jfharden
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also fix a load of incorrect package names across the project
This is a first pass. This resource definition needs some adjustments (more validation, comments, etc)
alphagov/govuk-infrastructure#4173