mirror of
https://github.com/labring/sealos.git
synced 2026-10-30 18:09:56 +08:00
feat: add runtime version and state. (#5169)
* feat: add jwt secret in devbox secret. * add runtime version and state.
This commit is contained in:
@@ -72,12 +72,19 @@ type Component struct {
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
type RuntimeState string
|
||||
|
||||
const (
|
||||
RuntimeStateActive RuntimeState = "active"
|
||||
RuntimeStateDeprecated RuntimeState = "deprecated"
|
||||
)
|
||||
|
||||
// RuntimeSpec defines the desired state of Runtime
|
||||
type RuntimeSpec struct {
|
||||
// +kubebuilder:validation:Required
|
||||
Version string `json:"version"`
|
||||
// +kubebuilder:validation:Required
|
||||
ClassRef string `json:"classRef"`
|
||||
// +kubebuilder:validation:Required
|
||||
Version string `json:"version"`
|
||||
|
||||
// +kubebuilder:validation:Optional
|
||||
Components []Component `json:"components,omitempty"`
|
||||
@@ -88,6 +95,13 @@ type RuntimeSpec struct {
|
||||
|
||||
// +kubebuilder:validation:Required
|
||||
Config Config `json:"config"`
|
||||
|
||||
// +kubebuilder:validation:Optional
|
||||
RuntimeVersion string `json:"runtimeVersion,omitempty"`
|
||||
// +kubebuilder:validation:Optional
|
||||
// +kubebuilder:validation:Enum=active;deprecated
|
||||
// +kubebuilder:default=active
|
||||
State RuntimeState `json:"state,omitempty"`
|
||||
}
|
||||
|
||||
// RuntimeStatus defines the observed state of Runtime
|
||||
@@ -98,6 +112,10 @@ type RuntimeStatus struct {
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="Class",type=string,JSONPath=`.spec.classRef`
|
||||
// +kubebuilder:printcolumn:name="Version",type=string,JSONPath=`.spec.version`
|
||||
// +kubebuilder:printcolumn:name="RuntimeVersion",type=string,JSONPath=`.spec.runtimeVersion`
|
||||
// +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.spec.state`
|
||||
|
||||
// Runtime is the Schema for the runtimes API
|
||||
type Runtime struct {
|
||||
|
||||
@@ -28,7 +28,20 @@ spec:
|
||||
singular: runtime
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1alpha1
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .spec.classRef
|
||||
name: Class
|
||||
type: string
|
||||
- jsonPath: .spec.version
|
||||
name: Version
|
||||
type: string
|
||||
- jsonPath: .spec.runtimeVersion
|
||||
name: RuntimeVersion
|
||||
type: string
|
||||
- jsonPath: .spec.state
|
||||
name: State
|
||||
type: string
|
||||
name: v1alpha1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: Runtime is the Schema for the runtimes API
|
||||
@@ -2002,6 +2015,14 @@ spec:
|
||||
type: object
|
||||
description:
|
||||
type: string
|
||||
runtimeVersion:
|
||||
type: string
|
||||
state:
|
||||
default: active
|
||||
enum:
|
||||
- active
|
||||
- deprecated
|
||||
type: string
|
||||
version:
|
||||
type: string
|
||||
required:
|
||||
|
||||
@@ -3129,7 +3129,20 @@ spec:
|
||||
singular: runtime
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1alpha1
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .spec.classRef
|
||||
name: Class
|
||||
type: string
|
||||
- jsonPath: .spec.version
|
||||
name: Version
|
||||
type: string
|
||||
- jsonPath: .spec.runtimeVersion
|
||||
name: RuntimeVersion
|
||||
type: string
|
||||
- jsonPath: .spec.state
|
||||
name: State
|
||||
type: string
|
||||
name: v1alpha1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: Runtime is the Schema for the runtimes API
|
||||
@@ -5103,6 +5116,14 @@ spec:
|
||||
type: object
|
||||
description:
|
||||
type: string
|
||||
runtimeVersion:
|
||||
type: string
|
||||
state:
|
||||
default: active
|
||||
enum:
|
||||
- active
|
||||
- deprecated
|
||||
type: string
|
||||
version:
|
||||
type: string
|
||||
required:
|
||||
|
||||
Reference in New Issue
Block a user