Skip to content

Commit

Permalink
feat(runtime): extract & design runtime mod from app mod. (#311)
Browse files Browse the repository at this point in the history
* extra runtime mod from app mod

* update runtime apis

Signed-off-by: maslow <wangfugen@126.com>
  • Loading branch information
maslow authored Sep 7, 2022
1 parent 1dcd72a commit ab8c969
Show file tree
Hide file tree
Showing 80 changed files with 3,173 additions and 955 deletions.
36 changes: 0 additions & 36 deletions controllers/application/PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,4 @@ resources:
kind: Specification
path: github.com/labring/laf/controllers/application/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: laf.dev
group: application
kind: Runtime
path: github.com/labring/laf/controllers/application/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: laf.dev
group: application
kind: RuntimePackage
path: github.com/labring/laf/controllers/application/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: laf.dev
group: application
kind: CloudFunction
path: github.com/labring/laf/controllers/application/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: laf.dev
group: application
kind: Trigger
path: github.com/labring/laf/controllers/application/api/v1
version: v1
version: "3"
3 changes: 2 additions & 1 deletion controllers/application/api/v1/application_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1

import (
v1 "github.com/labring/laf/controllers/runtime/api/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -79,7 +80,7 @@ type ApplicationStatus struct {
State ApplicationState `json:"state"`

// Runtime for the application
Runtime RuntimeSpec `json:"runtime"`
Runtime v1.RuntimeSpec `json:"runtime"`
}

//+kubebuilder:object:root=true
Expand Down
67 changes: 0 additions & 67 deletions controllers/application/api/v1/runtimepackage_types.go

This file was deleted.

25 changes: 12 additions & 13 deletions controllers/application/api/v1/specification_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1

import (
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand All @@ -32,39 +33,37 @@ type SpecificationSpec struct {
DisplayName string `json:"displayName"`

// Request CPU for the specification
RequestCPU int32 `json:"requestCPU"`
RequestCPU resource.Quantity `json:"requestCPU"`

// Request Memory for the specification
RequestMemory int64 `json:"requestMemory"`
RequestMemory resource.Quantity `json:"requestMemory"`

// Limit CPU for the specification
LimitCPU int32 `json:"limitCPU"`
LimitCPU resource.Quantity `json:"limitCPU"`

// Limit Memory for the specification
LimitMemory int64 `json:"limitMemory"`
LimitMemory resource.Quantity `json:"limitMemory"`

// Database capacity for the specification
DatabaseCapacity int64 `json:"databaseCapacity"`
DatabaseCapacity resource.Quantity `json:"databaseCapacity"`

// Storage capacity for the specification
StorageCapacity int64 `json:"storageCapacity"`
StorageCapacity resource.Quantity `json:"storageCapacity"`

// Network Bandwidth Outbound for the specification
NetworkBandwidthOutbound int64 `json:"networkBandwidthOutbound"`
NetworkBandwidthOutbound resource.Quantity `json:"networkBandwidthOutbound,omitempty"`

// Network Bandwidth Inbound for the specification
NetworkBandwidthInbound int64 `json:"networkBandwidthInbound"`
NetworkBandwidthInbound resource.Quantity `json:"networkBandwidthInbound,omitempty"`

// Network Traffic Outbound for the specification
//+kubebuilder:validation:Minimum=0
//+kubebuilder:validation:Default=0
NetworkTrafficOutbound int64 `json:"networkTrafficOutbound"`
NetworkTrafficOutbound resource.Quantity `json:"networkTrafficOutbound"`

// Priority for the specification.
// The default value is 0, which means that the specification is not currently available for creating new applications.
//+kubebuilder:validation:Minimum=0
//+kubebuilder:validation:Maximum=100
//+kubebuilder:validation:Default=0
//+kubebuilder:validation:Maximum=1000
//+kubebuilder:validation:Default=10
Priority int32 `json:"priority"`
}

Expand Down
Loading

0 comments on commit ab8c969

Please sign in to comment.