Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Commit 8e8ecb9

Browse files
authored
Merge pull request #171 from jumpstarter-dev/fix-crds
Fix crd generation to put files in the right directory
2 parents 441f24d + 0761a8b commit 8e8ecb9

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ help: ## Display this help.
4949

5050
.PHONY: manifests
5151
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
52-
$(CONTROLLER_GEN) rbac:roleName=jumpstarter-manager-role crd webhook paths="./..." \
53-
output:crd:artifacts:config=deploy/helm/jumpstarter/charts/jumpstarter-controller/templates/crds/ \
52+
$(CONTROLLER_GEN) rbac:roleName=jumpstarter-manager-role crd webhook paths="./api/..." paths="./internal/..." \
53+
output:crd:artifacts:config=deploy/helm/jumpstarter/crds/ \
5454
output:rbac:artifacts:config=deploy/helm/jumpstarter/charts/jumpstarter-controller/templates/rbac/
5555

5656
.PHONY: generate
5757
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
58-
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
58+
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./api/..." paths="./internal/..."
5959

6060
.PHONY: fmt
6161
fmt: ## Run go fmt against code.

deploy/helm/jumpstarter/crds/jumpstarter.dev_leases.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ spec:
4949
spec:
5050
description: LeaseSpec defines the desired state of Lease
5151
properties:
52+
beginTime:
53+
description: |-
54+
Requested start time. If omitted, lease starts when exporter is acquired.
55+
Immutable after lease starts (cannot change the past).
56+
format: date-time
57+
type: string
5258
clientRef:
5359
description: The client that is requesting the lease
5460
properties:
@@ -64,7 +70,16 @@ spec:
6470
type: object
6571
x-kubernetes-map-type: atomic
6672
duration:
67-
description: The desired duration of the lease
73+
description: |-
74+
Duration of the lease. Must be positive when provided.
75+
Can be omitted (nil) when both BeginTime and EndTime are provided,
76+
in which case it's calculated as EndTime - BeginTime.
77+
type: string
78+
endTime:
79+
description: |-
80+
Requested end time. If specified with BeginTime, Duration is calculated.
81+
Can be updated to extend or shorten active leases.
82+
format: date-time
6883
type: string
6984
release:
7085
description: The release flag requests the controller to end the lease
@@ -118,7 +133,6 @@ spec:
118133
x-kubernetes-map-type: atomic
119134
required:
120135
- clientRef
121-
- duration
122136
- selector
123137
type: object
124138
status:
@@ -127,7 +141,7 @@ spec:
127141
beginTime:
128142
description: |-
129143
If the lease has been acquired an exporter name is assigned
130-
and then and then it can be used, it will be empty while still pending
144+
and then it can be used, it will be empty while still pending
131145
format: date-time
132146
type: string
133147
conditions:

internal/controller/suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
6363

6464
By("bootstrapping test environment")
6565
testEnv = &envtest.Environment{
66-
CRDDirectoryPaths: []string{filepath.Join("..", "..", "deploy", "helm", "jumpstarter", "charts", "jumpstarter-controller", "templates", "crds")},
66+
CRDDirectoryPaths: []string{filepath.Join("..", "..", "deploy", "helm", "jumpstarter", "crds")},
6767
ErrorIfCRDPathMissing: true,
6868

6969
// The BinaryAssetsDirectory is only required if you want to run the tests directly

0 commit comments

Comments
 (0)