Skip to content

Commit bd620ed

Browse files
WIP: Changes Webhooks - Add Hub and Spoke
1 parent 81ce166 commit bd620ed

File tree

64 files changed

+1248
-4995
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1248
-4995
lines changed

docs/book/src/multiversion-tutorial/testdata/project/PROJECT

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ resources:
3030
path: tutorial.kubebuilder.io/project/api/v2
3131
version: v2
3232
webhooks:
33-
conversion: true
3433
defaulting: true
3534
validation: true
3635
webhookVersion: v1

docs/book/src/multiversion-tutorial/testdata/project/api/v1/cronjob_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ import (
3434

3535
// +kubebuilder:docs-gen:collapse=Imports
3636

37+
38+
3739
// CronJobSpec defines the desired state of CronJob.
3840
type CronJobSpec struct {
3941
// +kubebuilder:validation:MinLength=0
@@ -79,6 +81,8 @@ type CronJobSpec struct {
7981
FailedJobsHistoryLimit *int32 `json:"failedJobsHistoryLimit,omitempty"`
8082
}
8183

84+
85+
8286
// ConcurrencyPolicy describes how the job will be handled.
8387
// Only one of the following concurrent policies may be specified.
8488
// If none of the following policies is specified, the default one
@@ -98,6 +102,8 @@ const (
98102
ReplaceConcurrent ConcurrencyPolicy = "Replace"
99103
)
100104

105+
106+
101107
// CronJobStatus defines the observed state of CronJob.
102108
type CronJobStatus struct {
103109
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster

docs/book/src/multiversion-tutorial/testdata/project/api/v2/cronjob_conversion.go

Lines changed: 0 additions & 137 deletions
This file was deleted.

docs/book/src/multiversion-tutorial/testdata/project/api/v2/cronjob_types.go

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -47,44 +47,46 @@ type CronJobSpec struct {
4747
/*
4848
*/
4949

50-
// +kubebuilder:validation:Minimum=0
5150

52-
// Optional deadline in seconds for starting the job if it misses scheduled
53-
// time for any reason. Missed jobs executions will be counted as failed ones.
54-
// +optional
55-
StartingDeadlineSeconds *int64 `json:"startingDeadlineSeconds,omitempty"`
51+
52+
// +kubebuilder:validation:Minimum=0
5653

57-
// Specifies how to treat concurrent executions of a Job.
58-
// Valid values are:
59-
// - "Allow" (default): allows CronJobs to run concurrently;
60-
// - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
61-
// - "Replace": cancels currently running job and replaces it with a new one
62-
// +optional
63-
ConcurrencyPolicy ConcurrencyPolicy `json:"concurrencyPolicy,omitempty"`
54+
// Optional deadline in seconds for starting the job if it misses scheduled
55+
// time for any reason. Missed jobs executions will be counted as failed ones.
56+
// +optional
57+
StartingDeadlineSeconds *int64 `json:"startingDeadlineSeconds,omitempty"`
6458

65-
// This flag tells the controller to suspend subsequent executions, it does
66-
// not apply to already started executions. Defaults to false.
67-
// +optional
68-
Suspend *bool `json:"suspend,omitempty"`
59+
// Specifies how to treat concurrent executions of a Job.
60+
// Valid values are:
61+
// - "Allow" (default): allows CronJobs to run concurrently;
62+
// - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
63+
// - "Replace": cancels currently running job and replaces it with a new one
64+
// +optional
65+
ConcurrencyPolicy ConcurrencyPolicy `json:"concurrencyPolicy,omitempty"`
6966

70-
// Specifies the job that will be created when executing a CronJob.
71-
JobTemplate batchv1.JobTemplateSpec `json:"jobTemplate"`
67+
// This flag tells the controller to suspend subsequent executions, it does
68+
// not apply to already started executions. Defaults to false.
69+
// +optional
70+
Suspend *bool `json:"suspend,omitempty"`
7271

73-
// +kubebuilder:validation:Minimum=0
72+
// Specifies the job that will be created when executing a CronJob.
73+
JobTemplate batchv1.JobTemplateSpec `json:"jobTemplate"`
7474

75-
// The number of successful finished jobs to retain.
76-
// This is a pointer to distinguish between explicit zero and not specified.
77-
// +optional
78-
SuccessfulJobsHistoryLimit *int32 `json:"successfulJobsHistoryLimit,omitempty"`
75+
// +kubebuilder:validation:Minimum=0
7976

80-
// +kubebuilder:validation:Minimum=0
77+
// The number of successful finished jobs to retain.
78+
// This is a pointer to distinguish between explicit zero and not specified.
79+
// +optional
80+
SuccessfulJobsHistoryLimit *int32 `json:"successfulJobsHistoryLimit,omitempty"`
8181

82-
// The number of failed finished jobs to retain.
83-
// This is a pointer to distinguish between explicit zero and not specified.
84-
// +optional
85-
FailedJobsHistoryLimit *int32 `json:"failedJobsHistoryLimit,omitempty"`
82+
// +kubebuilder:validation:Minimum=0
83+
84+
// The number of failed finished jobs to retain.
85+
// This is a pointer to distinguish between explicit zero and not specified.
86+
// +optional
87+
FailedJobsHistoryLimit *int32 `json:"failedJobsHistoryLimit,omitempty"`
8688

87-
// +kubebuilder:docs-gen:collapse=The rest of Spec
89+
// +kubebuilder:docs-gen:collapse=The rest of Spec
8890

8991
}
9092

@@ -159,6 +161,7 @@ type CronJobStatus struct {
159161
LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"`
160162
}
161163

164+
162165
// +kubebuilder:object:root=true
163166
// +kubebuilder:subresource:status
164167
// +versionName=v2
@@ -184,4 +187,4 @@ func init() {
184187
SchemeBuilder.Register(&CronJob{}, &CronJobList{})
185188
}
186189

187-
// +kubebuilder:docs-gen:collapse=Other Types
190+
// +kubebuilder:docs-gen:collapse=Other Types

docs/book/src/multiversion-tutorial/testdata/project/api/v2/zz_generated.deepcopy.go

Lines changed: 2 additions & 74 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)