@@ -42,8 +42,8 @@ const AppWrapperPlural string = "appwrappers"
42
42
// which AppWrapper it belongs to.
43
43
const AppWrapperAnnotationKey = "appwrapper.mcad.ibm.com/appwrapper-name"
44
44
45
- //+kubebuilder:object:root=true
46
- //+kubebuilder:subresource:status
45
+ // +kubebuilder:object:root=true
46
+ // +kubebuilder:subresource:status
47
47
48
48
// Definition of AppWrapper class
49
49
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@@ -54,7 +54,7 @@ type AppWrapper struct {
54
54
Status AppWrapperStatus `json:"status,omitempty"`
55
55
}
56
56
57
- //+kubebuilder:object:root=true
57
+ // +kubebuilder:object:root=true
58
58
59
59
// AppWrapperList is a collection of AppWrappers.
60
60
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@@ -89,8 +89,6 @@ type AppWrapperResourceList struct {
89
89
metav1.TypeMeta `json:",inline"`
90
90
metav1.ListMeta `json:"metadata"`
91
91
92
- // +optional
93
- Items []AppWrapperResource `json:"Items"`
94
92
// +optional
95
93
GenericItems []AppWrapperGenericResource `json:"GenericItems"`
96
94
}
@@ -100,42 +98,7 @@ type AppWrapperService struct {
100
98
Spec v1.ServiceSpec `json:"spec"`
101
99
}
102
100
103
- // AppWrapperResource is App Wrapper aggregation resource
104
- //todo: To be depricated
105
- type AppWrapperResource struct {
106
- metav1.TypeMeta `json:",inline"`
107
- metav1.ObjectMeta `json:"metadata"`
108
- // Replicas is the number of desired replicas
109
- Replicas int32 `json:"replicas,omitempty" protobuf:"bytes,2,opt,name=replicas"`
110
-
111
- // The minimal available pods to run for this AppWrapper; the default value is nil
112
- MinAvailable * int32 `json:"minavailable,omitempty" protobuf:"bytes,3,opt,name=minavailable"`
113
-
114
- // The number of allocated replicas from this resource type
115
- // +optional
116
- AllocatedReplicas int32 `json:"allocatedreplicas"`
117
-
118
- // +kubebuilder:validation:Type=number
119
- // +kubebuilder:validation:Format=float
120
- // +optional
121
- Priority float64 `json:"priority,omitempty"`
122
-
123
- // The increasing rate of priority value for this resource
124
- // +kubebuilder:validation:Type=number
125
- // +kubebuilder:validation:Format=float
126
- PrioritySlope float64 `json:"priorityslope"`
127
-
128
- //The type of the resource (is the resource a Pod, a ReplicaSet, a ... ?)
129
- // +optional
130
- Type ResourceType `json:"type"`
131
-
132
- //The template for the resource; it is now a raw text because we don't know for what resource
133
- //it should be instantiated
134
- // +kubebuilder:pruning:PreserveUnknownFields
135
- Template runtime.RawExtension `json:"template"`
136
- }
137
-
138
- // AppWrapperResource is App Wrapper aggregation resource
101
+ // AppWrapperGenericResource is App Wrapper aggregation resource
139
102
type AppWrapperGenericResource struct {
140
103
metav1.TypeMeta `json:",inline"`
141
104
metav1.ObjectMeta `json:"metadata"`
@@ -161,25 +124,25 @@ type AppWrapperGenericResource struct {
161
124
// +kubebuilder:validation:Format=float
162
125
PrioritySlope float64 `json:"priorityslope"`
163
126
164
- //The template for the resource; it is now a raw text because we don't know for what resource
165
- //it should be instantiated
127
+ // The template for the resource; it is now a raw text because we don't know for what resource
128
+ // it should be instantiated
166
129
// +optional
167
130
// +kubebuilder:pruning:PreserveUnknownFields
168
131
// +kubebuilder:validation:EmbeddedResource
169
132
GenericTemplate runtime.RawExtension `json:"generictemplate"`
170
133
171
- //Optional section that specifies resource requirements for non-standard k8s resources, follows same format as that
134
+ // Optional section that specifies resource requirements for non-standard k8s resources, follows same format as that
172
135
// of standard k8s resources
173
136
CustomPodResources []CustomPodResourceTemplate `json:"custompodresources,omitempty"`
174
137
175
- //Optional field for users to determine completion status of item
138
+ // Optional field for users to determine completion status of item
176
139
CompletionStatus string `json:"completionstatus,omitempty"`
177
140
}
178
141
179
142
type CustomPodResourceTemplate struct {
180
143
Replicas int `json:"replicas"`
181
- //todo: replace with
182
- //Containers []Container Contain v1.ResourceRequirements
144
+ // todo: replace with
145
+ // Containers []Container Contain v1.ResourceRequirements
183
146
Requests v1.ResourceList `json:"requests"`
184
147
185
148
// +optional
@@ -190,17 +153,7 @@ type CustomPodResourceTemplate struct {
190
153
type ResourceType string
191
154
192
155
const (
193
- ResourceTypePod ResourceType = "Pod"
194
- ResourceTypeService ResourceType = "Service"
195
- ResourceTypeSecret ResourceType = "Secret"
196
- ResourceTypeStatefulSet ResourceType = "StatefulSet"
197
- ResourceTypeDeployment ResourceType = "Deployment"
198
- ResourceTypeReplicaSet ResourceType = "ReplicaSet"
199
- ResourceTypePersistentVolume ResourceType = "PersistentVolume"
200
- ResourceTypePersistentVolumeClaim ResourceType = "PersistentVolumeClaim"
201
- ResourceTypeNamespace ResourceType = "Namespace"
202
- ResourceTypeConfigMap ResourceType = "ConfigMap"
203
- ResourceTypeNetworkPolicy ResourceType = "NetworkPolicy"
156
+ ResourceTypePod ResourceType = "Pod"
204
157
)
205
158
206
159
// AppWrapperStatus represents the current state of a AppWrapper
@@ -224,13 +177,13 @@ type AppWrapperStatus struct {
224
177
// +optional
225
178
MinAvailable int32 `json:"template,omitempty" protobuf:"bytes,4,opt,name=template"`
226
179
227
- //Can run?
180
+ // Can run?
228
181
CanRun bool `json:"canrun,omitempty" protobuf:"bytes,1,opt,name=canrun"`
229
182
230
- //Is Dispatched?
183
+ // Is Dispatched?
231
184
IsDispatched bool `json:"isdispatched,omitempty" protobuf:"bytes,1,opt,name=isdispatched"`
232
185
233
- //State - Pending, Running, Failed, Deleted
186
+ // State - Pending, Running, Failed, Deleted
234
187
State AppWrapperState `json:"state,omitempty"`
235
188
236
189
Message string `json:"message,omitempty"`
@@ -264,7 +217,7 @@ type AppWrapperStatus struct {
264
217
// Represents the latest available observations of pods under appwrapper
265
218
PendingPodConditions []PendingPodSpec `json:"pendingpodconditions"`
266
219
267
- //Resources consumed
220
+ // Resources consumed
268
221
269
222
TotalCPU float64 `json:"totalcpu,omitempty"`
270
223
@@ -275,7 +228,7 @@ type AppWrapperStatus struct {
275
228
276
229
type AppWrapperState string
277
230
278
- //enqueued, active, deleting, succeeded, failed
231
+ // enqueued, active, deleting, succeeded, failed
279
232
const (
280
233
AppWrapperStateEnqueued AppWrapperState = "Pending"
281
234
AppWrapperStateActive AppWrapperState = "Running"
0 commit comments