@@ -48,49 +48,73 @@ const CronjobSpecExplaination = `
48
48
the fields.
49
49
*/
50
50
`
51
-
52
51
const CronjobSpecStruct = `
53
52
//+kubebuilder:validation:MinLength=0
54
53
55
54
// The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
56
- Schedule string` + " `" + ` json:"schedule"` + "`" + `
55
+ Schedule string ` + "` json:\ " schedule\ " `" + `
57
56
58
57
//+kubebuilder:validation:Minimum=0
59
58
60
59
// Optional deadline in seconds for starting the job if it misses scheduled
61
60
// time for any reason. Missed jobs executions will be counted as failed ones.
62
61
// +optional
63
- StartingDeadlineSeconds *int64` + " `" + ` json:"startingDeadlineSeconds,omitempty"` + "`" + `
62
+ StartingDeadlineSeconds *int64 ` + "` json:\ " startingDeadlineSeconds,omitempty\ " `" + `
64
63
65
64
// Specifies how to treat concurrent executions of a Job.
66
65
// Valid values are:
67
66
// - "Allow" (default): allows CronJobs to run concurrently;
68
67
// - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
69
68
// - "Replace": cancels currently running job and replaces it with a new one
70
69
// +optional
71
- ConcurrencyPolicy ConcurrencyPolicy` + " `" + ` json:"concurrencyPolicy,omitempty"` + "`" + `
70
+ ConcurrencyPolicy ConcurrencyPolicy ` + "` json:\ " concurrencyPolicy,omitempty\ " `" + `
72
71
73
72
// This flag tells the controller to suspend subsequent executions, it does
74
73
// not apply to already started executions. Defaults to false.
75
74
// +optional
76
- Suspend *bool` + " `" + ` json:"suspend,omitempty"` + "`" + `
75
+ Suspend *bool ` + "` json:\ " suspend,omitempty\ " `" + `
77
76
78
77
// Specifies the job that will be created when executing a CronJob.
79
- JobTemplate batchv1.JobTemplateSpec` + " `" + ` json:"jobTemplate"` + "`" + `
78
+ JobTemplate batchv1.JobTemplateSpec ` + "` json:\ " jobTemplate\ " `" + `
80
79
81
80
//+kubebuilder:validation:Minimum=0
82
81
83
82
// The number of successful finished jobs to retain.
84
83
// This is a pointer to distinguish between explicit zero and not specified.
85
84
// +optional
86
- SuccessfulJobsHistoryLimit *int32` + " `" + ` json:"successfulJobsHistoryLimit,omitempty"` + "`" + `
85
+ SuccessfulJobsHistoryLimit *int32 ` + "` json:\ " successfulJobsHistoryLimit,omitempty\ " `" + `
87
86
88
87
//+kubebuilder:validation:Minimum=0
89
88
90
89
// The number of failed finished jobs to retain.
91
90
// This is a pointer to distinguish between explicit zero and not specified.
92
91
// +optional
93
- FailedJobsHistoryLimit *int32` + " `" + `json:"failedJobsHistoryLimit,omitempty"` + "`" + `
92
+ FailedJobsHistoryLimit *int32 ` + "`json:\" failedJobsHistoryLimit,omitempty\" `" + `
93
+ }
94
+
95
+ // PodSpec is a description of a pod
96
+ type PodSpec struct {
97
+ // List of references to secrets in the same namespace to use for pulling any of the images used by this pod.
98
+ // +kubebuilder:validation:Required
99
+ ImagePullSecrets []corev1.LocalObjectReference ` + "`json:\" imagePullSecrets\" `" + `
100
+
101
+ // HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified.
102
+ // +kubebuilder:validation:Required
103
+ HostAliases []corev1.HostAlias ` + "`json:\" hostAliases\" `" + `
104
+ }
105
+
106
+ // LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.
107
+ type LocalObjectReference struct {
108
+ // Name of the referent.
109
+ // +kubebuilder:validation:Required
110
+ Name string ` + "`json:\" name\" `" + `
111
+ }
112
+
113
+ // HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.
114
+ type HostAlias struct {
115
+ // IP address of the host file entry.
116
+ // +kubebuilder:validation:Required
117
+ IP string ` + "`json:\" ip\" `" + `
94
118
}
95
119
96
120
/*
@@ -124,7 +148,7 @@ const (
124
148
we want users or other controllers to be able to easily obtain.
125
149
126
150
We'll keep a list of actively running jobs, as well as the last time that we successfully
127
- ran our job. Notice that we use` + " `" + ` metav1.Time` + "`" + ` instead of` + " `" + ` time.Time` + " `" + ` to get the stable
151
+ ran our job. Notice that we use ` + "` metav1.Time`" + ` instead of ` + "` time.Time`" + ` to get the stable
128
152
serialization, as mentioned above.
129
153
*/`
130
154
0 commit comments