@@ -42,8 +42,8 @@ const AppWrapperPlural string = "appwrappers"
4242// which AppWrapper it belongs to.
4343const AppWrapperAnnotationKey = "appwrapper.mcad.ibm.com/appwrapper-name"
4444
45- //+kubebuilder:object:root=true
46- //+kubebuilder:subresource:status
45+ // +kubebuilder:object:root=true
46+ // +kubebuilder:subresource:status
4747
4848// Definition of AppWrapper class
4949// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@@ -54,7 +54,7 @@ type AppWrapper struct {
5454Status AppWrapperStatus `json:"status,omitempty"`
5555}
5656
57- //+kubebuilder:object:root=true
57+ // +kubebuilder:object:root=true
5858
5959// AppWrapperList is a collection of AppWrappers.
6060// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@@ -89,8 +89,6 @@ type AppWrapperResourceList struct {
8989metav1.TypeMeta `json:",inline"`
9090metav1.ListMeta `json:"metadata"`
9191
92- // +optional
93- Items []AppWrapperResource `json:"Items"`
9492// +optional
9593GenericItems []AppWrapperGenericResource `json:"GenericItems"`
9694}
@@ -100,42 +98,7 @@ type AppWrapperService struct {
10098Spec v1.ServiceSpec `json:"spec"`
10199}
102100
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
139102type AppWrapperGenericResource struct {
140103metav1.TypeMeta `json:",inline"`
141104metav1.ObjectMeta `json:"metadata"`
@@ -161,25 +124,25 @@ type AppWrapperGenericResource struct {
161124// +kubebuilder:validation:Format=float
162125PrioritySlope float64 `json:"priorityslope"`
163126
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
166129// +optional
167130// +kubebuilder:pruning:PreserveUnknownFields
168131// +kubebuilder:validation:EmbeddedResource
169132GenericTemplate runtime.RawExtension `json:"generictemplate"`
170133
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
172135// of standard k8s resources
173136CustomPodResources []CustomPodResourceTemplate `json:"custompodresources,omitempty"`
174137
175- //Optional field for users to determine completion status of item
138+ // Optional field for users to determine completion status of item
176139CompletionStatus string `json:"completionstatus,omitempty"`
177140}
178141
179142type CustomPodResourceTemplate struct {
180143Replicas int `json:"replicas"`
181- //todo: replace with
182- //Containers []Container Contain v1.ResourceRequirements
144+ // todo: replace with
145+ // Containers []Container Contain v1.ResourceRequirements
183146Requests v1.ResourceList `json:"requests"`
184147
185148// +optional
@@ -190,17 +153,7 @@ type CustomPodResourceTemplate struct {
190153type ResourceType string
191154
192155const (
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"
204157)
205158
206159// AppWrapperStatus represents the current state of a AppWrapper
@@ -224,13 +177,13 @@ type AppWrapperStatus struct {
224177// +optional
225178MinAvailable int32 `json:"template,omitempty" protobuf:"bytes,4,opt,name=template"`
226179
227- //Can run?
180+ // Can run?
228181CanRun bool `json:"canrun,omitempty" protobuf:"bytes,1,opt,name=canrun"`
229182
230- //Is Dispatched?
183+ // Is Dispatched?
231184IsDispatched bool `json:"isdispatched,omitempty" protobuf:"bytes,1,opt,name=isdispatched"`
232185
233- //State - Pending, Running, Failed, Deleted
186+ // State - Pending, Running, Failed, Deleted
234187State AppWrapperState `json:"state,omitempty"`
235188
236189Message string `json:"message,omitempty"`
0 commit comments