Skip to content

Commit 3362689

Browse files
committed
address comments
1 parent 3654ffc commit 3362689

File tree

3 files changed

+83
-3
lines changed

3 files changed

+83
-3
lines changed

pkg/crd/markers/package.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func init() {
3434
must(markers.MakeDefinition("kubebuilder:validation:Required", markers.DescribesPackage, struct{}{})).
3535
WithHelp(markers.SimpleHelp("CRD validation", "specifies that all fields in this package are required by default.")),
3636

37-
must(markers.MakeDefinition("kubebuilder:skip", markers.DescribesPackage, false)).
38-
WithHelp(markers.SimpleHelp("CRD", "skip this package.")),
37+
must(markers.MakeDefinition("kubebuilder:skip", markers.DescribesPackage, struct{}{})).
38+
WithHelp(markers.SimpleHelp("CRD", "don't consider this package as an API version.")),
3939
)
4040
}

pkg/crd/testdata/cronjob_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717

1818
// +groupName=testdata.kubebuilder.io
1919
// +versionName=v1
20-
// +kubebuilder:skip=true
2120
package cronjob
2221

2322
import (
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/*
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
*/
15+
16+
//go:generate controller-gen crd paths=. output:dir=.
17+
18+
// +kubebuilder:skip
19+
package internal_version
20+
21+
import (
22+
batchv1beta1 "k8s.io/api/batch/v1beta1"
23+
corev1 "k8s.io/api/core/v1"
24+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
25+
)
26+
27+
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
28+
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
29+
30+
// CronJobSpec defines the desired state of CronJob
31+
type CronJobSpec struct {
32+
// The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
33+
Schedule string
34+
}
35+
36+
// CronJobStatus defines the observed state of CronJob
37+
type CronJobStatus struct {
38+
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
39+
// Important: Run "make" to regenerate code after modifying this file
40+
41+
// A list of pointers to currently running jobs.
42+
// +optional
43+
Active []corev1.ObjectReference
44+
45+
// Information when was the last time the job was successfully scheduled.
46+
// +optional
47+
LastScheduleTime *metav1.Time
48+
49+
// Information about the last time the job was successfully scheduled,
50+
// with microsecond precision.
51+
// +optional
52+
LastScheduleMicroTime *metav1.MicroTime
53+
}
54+
55+
// +kubebuilder:object:root=true
56+
// +kubebuilder:subresource:status
57+
// +kubebuilder:resource
58+
59+
// CronJob is the Schema for the cronjobs API
60+
type CronJob struct {
61+
/*
62+
*/
63+
metav1.TypeMeta
64+
metav1.ObjectMeta
65+
66+
Spec CronJobSpec
67+
Status CronJobStatus
68+
}
69+
70+
// +kubebuilder:object:root=true
71+
72+
// CronJobList contains a list of CronJob
73+
type CronJobList struct {
74+
metav1.TypeMeta `json:",inline"`
75+
metav1.ListMeta `json:"metadata,omitempty"`
76+
Items []CronJob `json:"items"`
77+
}
78+
79+
func init() {
80+
SchemeBuilder.Register(&CronJob{}, &CronJobList{})
81+
}

0 commit comments

Comments
 (0)