@@ -23,9 +23,7 @@ limitations under the License.
23
23
package cronjob
24
24
25
25
import (
26
- "encoding/json"
27
26
"fmt"
28
- "net/url"
29
27
30
28
batchv1beta1 "k8s.io/api/batch/v1beta1"
31
29
corev1 "k8s.io/api/core/v1"
@@ -209,84 +207,6 @@ func (t *TotallyABool) UnmarshalJSON(in []byte) error {
209
207
return nil
210
208
}
211
209
212
- // +kubebuilder:validation:Type=string
213
- // URL wraps url.URL.
214
- // It has custom json marshal methods that enable it to be used in K8s CRDs
215
- // such that the CRD resource will have the URL but operator code can can work with url.URL struct
216
- type URL struct {
217
- url.URL
218
- }
219
-
220
- func (u * URL ) MarshalJSON () ([]byte , error ) {
221
- return []byte (fmt .Sprintf ("%q" , u .String ())), nil
222
- }
223
-
224
- func (u * URL ) UnmarshalJSON (b []byte ) error {
225
- var ref string
226
- if err := json .Unmarshal (b , & ref ); err != nil {
227
- return err
228
- }
229
- if ref == "" {
230
- * u = URL {}
231
- return nil
232
- }
233
-
234
- r , err := url .Parse (ref )
235
- if err != nil {
236
- return err
237
- } else if r != nil {
238
- * u = URL {* r }
239
- } else {
240
- * u = URL {}
241
- }
242
- return nil
243
- }
244
-
245
- func (u * URL ) String () string {
246
- if u == nil {
247
- return ""
248
- }
249
- return u .URL .String ()
250
- }
251
-
252
- // +kubebuilder:validation:Type=string
253
- // URL2 is an alias of url.URL.
254
- // It has custom json marshal methods that enable it to be used in K8s CRDs
255
- // such that the CRD resource will have the URL but operator code can can work with url.URL struct
256
- type URL2 url.URL
257
-
258
- func (u * URL2 ) MarshalJSON () ([]byte , error ) {
259
- return []byte (fmt .Sprintf ("%q" , u .String ())), nil
260
- }
261
-
262
- func (u * URL2 ) UnmarshalJSON (b []byte ) error {
263
- var ref string
264
- if err := json .Unmarshal (b , & ref ); err != nil {
265
- return err
266
- }
267
- if ref == "" {
268
- * u = URL2 {}
269
- return nil
270
- }
271
-
272
- r , err := url .Parse (ref )
273
- if err != nil {
274
- return err
275
- } else if r != nil {
276
- * u = * (* URL2 )(r )
277
- } else {
278
- * u = URL2 {}
279
- }
280
- return nil
281
- }
282
-
283
- func (u * URL2 ) String () string {
284
- if u == nil {
285
- return ""
286
- }
287
- return (* url .URL )(u ).String ()
288
- }
289
-
290
210
// ConcurrencyPolicy describes how the job will be handled.
291
211
// Only one of the following concurrent policies may be specified.
292
212
// If none of the following policies is specified, the default one
@@ -323,14 +243,6 @@ type CronJobStatus struct {
323
243
// with microsecond precision.
324
244
// +optional
325
245
LastScheduleMicroTime * metav1.MicroTime `json:"lastScheduleMicroTime,omitempty"`
326
-
327
- // LastActiveLogURL specifies the logging url for the last started job
328
- // +optional
329
- LastActiveLogURL * URL `json:"lastActiveLogURL,omitempty"`
330
-
331
- // LastActiveLogURL2 specifies the logging url for the last started job
332
- // +optional
333
- LastActiveLogURL2 * URL2 `json:"lastActiveLogURL2,omitempty"`
334
246
}
335
247
336
248
// +kubebuilder:object:root=true
0 commit comments