diff --git a/controllers/devbox/api/v1alpha1/devbox_types.go b/controllers/devbox/api/v1alpha1/devbox_types.go index 3ddc39ca11d..79fc078cc43 100644 --- a/controllers/devbox/api/v1alpha1/devbox_types.go +++ b/controllers/devbox/api/v1alpha1/devbox_types.go @@ -54,6 +54,8 @@ type ResourceList map[ResourceName]resource.Quantity type RuntimeRef struct { // +kubebuilder:validation:Required Name string `json:"name"` + // +kubebuilder:validation:Required + Namespace string `json:"namespace"` } type NetworkSpec struct { diff --git a/controllers/devbox/api/v1alpha1/devboxrelease_types.go b/controllers/devbox/api/v1alpha1/devboxrelease_types.go index 1e8142e400f..ab8d8257fbd 100644 --- a/controllers/devbox/api/v1alpha1/devboxrelease_types.go +++ b/controllers/devbox/api/v1alpha1/devboxrelease_types.go @@ -41,6 +41,10 @@ const ( DevboxReleasePhaseFailed DevboxReleasePhase = "Failed" ) +// +kubebuilder:printcolumn:name="DevboxName",type="string",JSONPath=".spec.devboxName" +// +kubebuilder:printcolumn:name="NewTag",type="string",JSONPath=".spec.newTag" +// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" + // DevBoxReleaseStatus defines the observed state of DevBoxRelease type DevBoxReleaseStatus struct { // +kubebuilder:validation:Optional diff --git a/controllers/devbox/config/crd/bases/devbox.sealos.io_devboxes.yaml b/controllers/devbox/config/crd/bases/devbox.sealos.io_devboxes.yaml index a413f88ee21..0755247c31a 100644 --- a/controllers/devbox/config/crd/bases/devbox.sealos.io_devboxes.yaml +++ b/controllers/devbox/config/crd/bases/devbox.sealos.io_devboxes.yaml @@ -28,23 +28,23 @@ spec: singular: devbox scope: Namespaced versions: - - additionalPrinterColumns: - - jsonPath: .spec.state - name: State - type: string - - jsonPath: .spec.runtimeRef.name - name: RuntimeRef - type: string - - jsonPath: .status.podPhase - name: PodPhase - type: string - - jsonPath: .status.network.type - name: NetworkType - type: string - - jsonPath: .status.network.nodePort - name: NodePort - type: integer - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .spec.state + name: State + type: string + - jsonPath: .spec.runtimeRef.name + name: RuntimeRef + type: string + - jsonPath: .status.podPhase + name: PodPhase + type: string + - jsonPath: .status.network.type + name: NetworkType + type: string + - jsonPath: .status.network.nodePort + name: NodePort + type: integer + name: v1alpha1 schema: openAPIV3Schema: description: Devbox is the Schema for the devboxes API @@ -124,8 +124,8 @@ spec: type: string type: array required: - - key - - operator + - key + - operator type: object type: array matchFields: @@ -156,8 +156,8 @@ spec: type: string type: array required: - - key - - operator + - key + - operator type: object type: array type: object @@ -168,8 +168,8 @@ spec: format: int32 type: integer required: - - preference - - weight + - preference + - weight type: object type: array requiredDuringSchedulingIgnoredDuringExecution: @@ -217,8 +217,8 @@ spec: type: string type: array required: - - key - - operator + - key + - operator type: object type: array matchFields: @@ -249,15 +249,15 @@ spec: type: string type: array required: - - key - - operator + - key + - operator type: object type: array type: object x-kubernetes-map-type: atomic type: array required: - - nodeSelectorTerms + - nodeSelectorTerms type: object x-kubernetes-map-type: atomic type: object @@ -316,8 +316,8 @@ spec: type: string type: array required: - - key - - operator + - key + - operator type: object type: array matchLabels: @@ -366,8 +366,8 @@ spec: type: string type: array required: - - key - - operator + - key + - operator type: object type: array matchLabels: @@ -398,7 +398,7 @@ spec: Empty topologyKey is not allowed. type: string required: - - topologyKey + - topologyKey type: object weight: description: |- @@ -407,8 +407,8 @@ spec: format: int32 type: integer required: - - podAffinityTerm - - weight + - podAffinityTerm + - weight type: object type: array requiredDuringSchedulingIgnoredDuringExecution: @@ -460,8 +460,8 @@ spec: type: string type: array required: - - key - - operator + - key + - operator type: object type: array matchLabels: @@ -509,8 +509,8 @@ spec: type: string type: array required: - - key - - operator + - key + - operator type: object type: array matchLabels: @@ -541,7 +541,7 @@ spec: Empty topologyKey is not allowed. type: string required: - - topologyKey + - topologyKey type: object type: array type: object @@ -601,8 +601,8 @@ spec: type: string type: array required: - - key - - operator + - key + - operator type: object type: array matchLabels: @@ -651,8 +651,8 @@ spec: type: string type: array required: - - key - - operator + - key + - operator type: object type: array matchLabels: @@ -683,7 +683,7 @@ spec: Empty topologyKey is not allowed. type: string required: - - topologyKey + - topologyKey type: object weight: description: |- @@ -692,8 +692,8 @@ spec: format: int32 type: integer required: - - podAffinityTerm - - weight + - podAffinityTerm + - weight type: object type: array requiredDuringSchedulingIgnoredDuringExecution: @@ -745,8 +745,8 @@ spec: type: string type: array required: - - key - - operator + - key + - operator type: object type: array matchLabels: @@ -794,8 +794,8 @@ spec: type: string type: array required: - - key - - operator + - key + - operator type: object type: array matchLabels: @@ -826,7 +826,7 @@ spec: Empty topologyKey is not allowed. type: string required: - - topologyKey + - topologyKey type: object type: array type: object @@ -885,7 +885,7 @@ spec: must be defined type: boolean required: - - key + - key type: object x-kubernetes-map-type: atomic fieldRef: @@ -902,7 +902,7 @@ spec: API version. type: string required: - - fieldPath + - fieldPath type: object x-kubernetes-map-type: atomic resourceFieldRef: @@ -916,8 +916,8 @@ spec: type: string divisor: anyOf: - - type: integer - - type: string + - type: integer + - type: string description: Specifies the output format of the exposed resources, defaults to "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ @@ -926,7 +926,7 @@ spec: description: 'Required: resource to select' type: string required: - - resource + - resource type: object x-kubernetes-map-type: atomic secretKeyRef: @@ -947,12 +947,12 @@ spec: be defined type: boolean required: - - key + - key type: object x-kubernetes-map-type: atomic type: object required: - - name + - name type: object type: array extraLabels: @@ -998,8 +998,8 @@ spec: SubPathExpr and SubPath are mutually exclusive. type: string required: - - mountPath - - name + - mountPath + - name type: object type: array extraVolumes: @@ -1041,7 +1041,7 @@ spec: More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: string required: - - volumeID + - volumeID type: object azureDisk: description: azureDisk represents an Azure Data Disk mount on @@ -1077,8 +1077,8 @@ spec: the ReadOnly setting in VolumeMounts. type: boolean required: - - diskName - - diskURI + - diskName + - diskURI type: object azureFile: description: azureFile represents an Azure File Service mount @@ -1097,8 +1097,8 @@ spec: description: shareName is the azure share Name type: string required: - - secretName - - shareName + - secretName + - shareName type: object cephfs: description: cephFS represents a Ceph FS mount on the host that @@ -1145,7 +1145,7 @@ spec: More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: string required: - - monitors + - monitors type: object cinder: description: |- @@ -1184,7 +1184,7 @@ spec: More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: string required: - - volumeID + - volumeID type: object configMap: description: configMap represents a configMap that should populate @@ -1234,8 +1234,8 @@ spec: May not start with the string '..'. type: string required: - - key - - path + - key + - path type: object type: array name: @@ -1295,7 +1295,7 @@ spec: driver. Consult your driver's documentation for supported values. type: object required: - - driver + - driver type: object downwardAPI: description: downwardAPI represents downward API about the pod @@ -1333,7 +1333,7 @@ spec: specified API version. type: string required: - - fieldPath + - fieldPath type: object x-kubernetes-map-type: atomic mode: @@ -1364,8 +1364,8 @@ spec: type: string divisor: anyOf: - - type: integer - - type: string + - type: integer + - type: string description: Specifies the output format of the exposed resources, defaults to "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ @@ -1374,11 +1374,11 @@ spec: description: 'Required: resource to select' type: string required: - - resource + - resource type: object x-kubernetes-map-type: atomic required: - - path + - path type: object type: array type: object @@ -1396,8 +1396,8 @@ spec: type: string sizeLimit: anyOf: - - type: integer - - type: string + - type: integer + - type: string description: |- sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. @@ -1512,8 +1512,8 @@ spec: referenced type: string required: - - kind - - name + - kind + - name type: object x-kubernetes-map-type: atomic dataSourceRef: @@ -1563,8 +1563,8 @@ spec: (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. type: string required: - - kind - - name + - kind + - name type: object resources: description: |- @@ -1596,17 +1596,17 @@ spec: inside a container. type: string required: - - name + - name type: object type: array x-kubernetes-list-map-keys: - - name + - name x-kubernetes-list-type: map limits: additionalProperties: anyOf: - - type: integer - - type: string + - type: integer + - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: |- @@ -1616,8 +1616,8 @@ spec: requests: additionalProperties: anyOf: - - type: integer - - type: string + - type: integer + - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: |- @@ -1659,8 +1659,8 @@ spec: type: string type: array required: - - key - - operator + - key + - operator type: object type: array matchLabels: @@ -1689,7 +1689,7 @@ spec: type: string type: object required: - - spec + - spec type: object type: object fc: @@ -1770,7 +1770,7 @@ spec: type: object x-kubernetes-map-type: atomic required: - - driver + - driver type: object flocker: description: flocker represents a Flocker volume attached to @@ -1822,7 +1822,7 @@ spec: More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk type: boolean required: - - pdName + - pdName type: object gitRepo: description: |- @@ -1846,7 +1846,7 @@ spec: revision. type: string required: - - repository + - repository type: object glusterfs: description: |- @@ -1870,8 +1870,8 @@ spec: More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: boolean required: - - endpoints - - path + - endpoints + - path type: object hostPath: description: |- @@ -1897,7 +1897,7 @@ spec: More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath type: string required: - - path + - path type: object iscsi: description: |- @@ -1969,9 +1969,9 @@ spec: is other than default (typically TCP ports 860 and 3260). type: string required: - - iqn - - lun - - targetPortal + - iqn + - lun + - targetPortal type: object name: description: |- @@ -2001,8 +2001,8 @@ spec: More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: string required: - - path - - server + - path + - server type: object persistentVolumeClaim: description: |- @@ -2021,7 +2021,7 @@ spec: Default false. type: boolean required: - - claimName + - claimName type: object photonPersistentDisk: description: photonPersistentDisk represents a PhotonController @@ -2038,7 +2038,7 @@ spec: persistent disk type: string required: - - pdID + - pdID type: object portworxVolume: description: portworxVolume represents a portworx volume attached @@ -2059,7 +2059,7 @@ spec: description: volumeID uniquely identifies a Portworx volume type: string required: - - volumeID + - volumeID type: object projected: description: projected items for all in one resources secrets, @@ -2119,8 +2119,8 @@ spec: May not start with the string '..'. type: string required: - - key - - path + - key + - path type: object type: array name: @@ -2162,7 +2162,7 @@ spec: in the specified API version. type: string required: - - fieldPath + - fieldPath type: object x-kubernetes-map-type: atomic mode: @@ -2194,8 +2194,8 @@ spec: type: string divisor: anyOf: - - type: integer - - type: string + - type: integer + - type: string description: Specifies the output format of the exposed resources, defaults to "1" @@ -2206,11 +2206,11 @@ spec: select' type: string required: - - resource + - resource type: object x-kubernetes-map-type: atomic required: - - path + - path type: object type: array type: object @@ -2252,8 +2252,8 @@ spec: May not start with the string '..'. type: string required: - - key - - path + - key + - path type: object type: array name: @@ -2295,7 +2295,7 @@ spec: token into. type: string required: - - path + - path type: object type: object type: array @@ -2335,8 +2335,8 @@ spec: created Quobyte volume by name. type: string required: - - registry - - volume + - registry + - volume type: object rbd: description: |- @@ -2403,8 +2403,8 @@ spec: More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string required: - - image - - monitors + - image + - monitors type: object scaleIO: description: scaleIO represents a ScaleIO persistent volume @@ -2466,9 +2466,9 @@ spec: that is associated with this volume source. type: string required: - - gateway - - secretRef - - system + - gateway + - secretRef + - system type: object secret: description: |- @@ -2519,8 +2519,8 @@ spec: May not start with the string '..'. type: string required: - - key - - path + - key + - path type: object type: array optional: @@ -2599,10 +2599,10 @@ spec: volume vmdk type: string required: - - volumePath + - volumePath type: object required: - - name + - name type: object type: array network: @@ -2665,8 +2665,11 @@ spec: properties: name: type: string + namespace: + type: string required: - name + - namespace type: object squash: default: false diff --git a/controllers/devbox/config/crd/bases/devbox.sealos.io_runtimes.yaml b/controllers/devbox/config/crd/bases/devbox.sealos.io_runtimes.yaml index 7310e6f80e1..85f48fbb361 100644 --- a/controllers/devbox/config/crd/bases/devbox.sealos.io_runtimes.yaml +++ b/controllers/devbox/config/crd/bases/devbox.sealos.io_runtimes.yaml @@ -116,7 +116,7 @@ spec: key must be defined type: boolean required: - - key + - key type: object x-kubernetes-map-type: atomic fieldRef: @@ -133,7 +133,7 @@ spec: specified API version. type: string required: - - fieldPath + - fieldPath type: object x-kubernetes-map-type: atomic resourceFieldRef: @@ -147,8 +147,8 @@ spec: type: string divisor: anyOf: - - type: integer - - type: string + - type: integer + - type: string description: Specifies the output format of the exposed resources, defaults to "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ @@ -157,7 +157,7 @@ spec: description: 'Required: resource to select' type: string required: - - resource + - resource type: object x-kubernetes-map-type: atomic secretKeyRef: @@ -179,12 +179,12 @@ spec: must be defined type: boolean required: - - key + - key type: object x-kubernetes-map-type: atomic type: object required: - - name + - name type: object type: array image: @@ -195,9 +195,9 @@ spec: type: object ports: default: - - containerPort: 22 - name: devbox-ssh-port - protocol: TCP + - containerPort: 22 + name: devbox-ssh-port + protocol: TCP items: description: ContainerPort represents a network port in a single container. @@ -232,7 +232,7 @@ spec: Defaults to "TCP". type: string required: - - containerPort + - containerPort type: object type: array user: @@ -276,8 +276,8 @@ spec: SubPathExpr and SubPath are mutually exclusive. type: string required: - - mountPath - - name + - mountPath + - name type: object type: array volumes: @@ -318,7 +318,7 @@ spec: More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore type: string required: - - volumeID + - volumeID type: object azureDisk: description: azureDisk represents an Azure Data Disk mount @@ -355,8 +355,8 @@ spec: the ReadOnly setting in VolumeMounts. type: boolean required: - - diskName - - diskURI + - diskName + - diskURI type: object azureFile: description: azureFile represents an Azure File Service @@ -375,8 +375,8 @@ spec: description: shareName is the azure share Name type: string required: - - secretName - - shareName + - secretName + - shareName type: object cephfs: description: cephFS represents a Ceph FS mount on the host @@ -423,7 +423,7 @@ spec: More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it type: string required: - - monitors + - monitors type: object cinder: description: |- @@ -462,7 +462,7 @@ spec: More info: https://examples.k8s.io/mysql-cinder-pd/README.md type: string required: - - volumeID + - volumeID type: object configMap: description: configMap represents a configMap that should @@ -513,8 +513,8 @@ spec: May not start with the string '..'. type: string required: - - key - - path + - key + - path type: object type: array name: @@ -574,7 +574,7 @@ spec: driver. Consult your driver's documentation for supported values. type: object required: - - driver + - driver type: object downwardAPI: description: downwardAPI represents downward API about the @@ -613,7 +613,7 @@ spec: the specified API version. type: string required: - - fieldPath + - fieldPath type: object x-kubernetes-map-type: atomic mode: @@ -644,8 +644,8 @@ spec: type: string divisor: anyOf: - - type: integer - - type: string + - type: integer + - type: string description: Specifies the output format of the exposed resources, defaults to "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ @@ -654,11 +654,11 @@ spec: description: 'Required: resource to select' type: string required: - - resource + - resource type: object x-kubernetes-map-type: atomic required: - - path + - path type: object type: array type: object @@ -676,8 +676,8 @@ spec: type: string sizeLimit: anyOf: - - type: integer - - type: string + - type: integer + - type: string description: |- sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. @@ -792,8 +792,8 @@ spec: being referenced type: string required: - - kind - - name + - kind + - name type: object x-kubernetes-map-type: atomic dataSourceRef: @@ -843,8 +843,8 @@ spec: (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. type: string required: - - kind - - name + - kind + - name type: object resources: description: |- @@ -876,17 +876,17 @@ spec: inside a container. type: string required: - - name + - name type: object type: array x-kubernetes-list-map-keys: - - name + - name x-kubernetes-list-type: map limits: additionalProperties: anyOf: - - type: integer - - type: string + - type: integer + - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: |- @@ -896,8 +896,8 @@ spec: requests: additionalProperties: anyOf: - - type: integer - - type: string + - type: integer + - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: |- @@ -939,8 +939,8 @@ spec: type: string type: array required: - - key - - operator + - key + - operator type: object type: array matchLabels: @@ -969,7 +969,7 @@ spec: type: string type: object required: - - spec + - spec type: object type: object fc: @@ -1050,7 +1050,7 @@ spec: type: object x-kubernetes-map-type: atomic required: - - driver + - driver type: object flocker: description: flocker represents a Flocker volume attached @@ -1102,7 +1102,7 @@ spec: More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk type: boolean required: - - pdName + - pdName type: object gitRepo: description: |- @@ -1126,7 +1126,7 @@ spec: revision. type: string required: - - repository + - repository type: object glusterfs: description: |- @@ -1150,8 +1150,8 @@ spec: More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod type: boolean required: - - endpoints - - path + - endpoints + - path type: object hostPath: description: |- @@ -1177,7 +1177,7 @@ spec: More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath type: string required: - - path + - path type: object iscsi: description: |- @@ -1249,9 +1249,9 @@ spec: is other than default (typically TCP ports 860 and 3260). type: string required: - - iqn - - lun - - targetPortal + - iqn + - lun + - targetPortal type: object name: description: |- @@ -1281,8 +1281,8 @@ spec: More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs type: string required: - - path - - server + - path + - server type: object persistentVolumeClaim: description: |- @@ -1301,7 +1301,7 @@ spec: Default false. type: boolean required: - - claimName + - claimName type: object photonPersistentDisk: description: photonPersistentDisk represents a PhotonController @@ -1319,7 +1319,7 @@ spec: persistent disk type: string required: - - pdID + - pdID type: object portworxVolume: description: portworxVolume represents a portworx volume @@ -1341,7 +1341,7 @@ spec: volume type: string required: - - volumeID + - volumeID type: object projected: description: projected items for all in one resources secrets, @@ -1401,8 +1401,8 @@ spec: May not start with the string '..'. type: string required: - - key - - path + - key + - path type: object type: array name: @@ -1444,7 +1444,7 @@ spec: select in the specified API version. type: string required: - - fieldPath + - fieldPath type: object x-kubernetes-map-type: atomic mode: @@ -1477,8 +1477,8 @@ spec: type: string divisor: anyOf: - - type: integer - - type: string + - type: integer + - type: string description: Specifies the output format of the exposed resources, defaults to "1" @@ -1489,11 +1489,11 @@ spec: to select' type: string required: - - resource + - resource type: object x-kubernetes-map-type: atomic required: - - path + - path type: object type: array type: object @@ -1535,8 +1535,8 @@ spec: May not start with the string '..'. type: string required: - - key - - path + - key + - path type: object type: array name: @@ -1578,7 +1578,7 @@ spec: token into. type: string required: - - path + - path type: object type: object type: array @@ -1618,8 +1618,8 @@ spec: created Quobyte volume by name. type: string required: - - registry - - volume + - registry + - volume type: object rbd: description: |- @@ -1686,8 +1686,8 @@ spec: More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string required: - - image - - monitors + - image + - monitors type: object scaleIO: description: scaleIO represents a ScaleIO persistent volume @@ -1749,9 +1749,9 @@ spec: that is associated with this volume source. type: string required: - - gateway - - secretRef - - system + - gateway + - secretRef + - system type: object secret: description: |- @@ -1803,8 +1803,8 @@ spec: May not start with the string '..'. type: string required: - - key - - path + - key + - path type: object type: array optional: @@ -1883,16 +1883,16 @@ spec: vSphere volume vmdk type: string required: - - volumePath + - volumePath type: object required: - - name + - name type: object type: array workingDir: type: string required: - - image + - image type: object description: type: string diff --git a/controllers/devbox/config/rbac/role.yaml b/controllers/devbox/config/rbac/role.yaml index d5eaeec6bfd..c7916fa8cbd 100644 --- a/controllers/devbox/config/rbac/role.yaml +++ b/controllers/devbox/config/rbac/role.yaml @@ -21,15 +21,15 @@ rules: - apiGroups: - "" resources: - - events + - events verbs: - - '*' + - '*' - apiGroups: - - "" + - "" resources: - - pods + - pods verbs: - - '*' + - '*' - apiGroups: - "" resources: @@ -43,13 +43,13 @@ rules: resources: - secrets verbs: - - '*' + - '*' - apiGroups: - "" resources: - services verbs: - - '*' + - '*' - apiGroups: - devbox.sealos.io resources: @@ -103,26 +103,26 @@ rules: - patch - update - apiGroups: - - devbox.sealos.io + - devbox.sealos.io resources: - - runtimeclasses + - runtimeclasses verbs: - - create - - delete - - get - - list - - patch - - update - - watch + - create + - delete + - get + - list + - patch + - update + - watch - apiGroups: - - devbox.sealos.io + - devbox.sealos.io resources: - - runtimes + - runtimes verbs: - - create - - delete - - get - - list - - patch - - update - - watch + - create + - delete + - get + - list + - patch + - update + - watch diff --git a/controllers/devbox/config/samples/devbox_v1alpha1_runtime.yaml b/controllers/devbox/config/samples/devbox_v1alpha1_runtime.yaml index 1aeef0bc01d..59ba4ac399e 100644 --- a/controllers/devbox/config/samples/devbox_v1alpha1_runtime.yaml +++ b/controllers/devbox/config/samples/devbox_v1alpha1_runtime.yaml @@ -16,12 +16,13 @@ apiVersion: devbox.sealos.io/v1alpha1 kind: Runtime metadata: name: go-1-22-5 + namespace: devbox-system spec: classRef: go title: go1.22.5 description: go1.22.5 config: - image: ghcr.io/cbluebird/devbox/go1.22.5:9259f1 + image: ghcr.io/cbluebird/devbox/go1.22.5:2f4067 category: - ubuntu - go @@ -30,12 +31,13 @@ apiVersion: devbox.sealos.io/v1alpha1 kind: Runtime metadata: name: go-1-23-0 + namespace: devbox-system spec: classRef: go title: go1.23.0 description: go1.23.0 config: - image: ghcr.io/cbluebird/devbox/go1.23.0:9259f1 + image: ghcr.io/cbluebird/devbox/go1.23.0:2f4067 category: - ubuntu - go @@ -44,12 +46,13 @@ apiVersion: devbox.sealos.io/v1alpha1 kind: Runtime metadata: name: gin + namespace: devbox-system spec: classRef: gin title: gin description: gin config: - image: ghcr.io/cbluebird/devbox/gin:9259f1 + image: ghcr.io/cbluebird/devbox/gin:2f4067 category: - ubuntu - go @@ -59,12 +62,13 @@ apiVersion: devbox.sealos.io/v1alpha1 kind: Runtime metadata: name: spring-boot + namespace: devbox-system spec: classRef: spring-boot title: Spring Boot description: Spring Boot config: - image: ghcr.io/cbluebird/devbox/spring-boot:9259f1 + image: ghcr.io/cbluebird/devbox/spring-boot:2f4067 category: - ubuntu - java diff --git a/controllers/devbox/config/samples/devbox_v1alpha1_runtimeclass.yaml b/controllers/devbox/config/samples/devbox_v1alpha1_runtimeclass.yaml index 0f4cf2ca24f..3886893f263 100644 --- a/controllers/devbox/config/samples/devbox_v1alpha1_runtimeclass.yaml +++ b/controllers/devbox/config/samples/devbox_v1alpha1_runtimeclass.yaml @@ -16,6 +16,7 @@ apiVersion: devbox.sealos.io/v1alpha1 kind: RuntimeClass metadata: name: go + namespace: devbox-system spec: kind: Language title: go @@ -25,6 +26,7 @@ apiVersion: devbox.sealos.io/v1alpha1 kind: RuntimeClass metadata: name: gin + namespace: devbox-system spec: kind: Framework title: gin @@ -34,6 +36,7 @@ apiVersion: devbox.sealos.io/v1alpha1 kind: RuntimeClass metadata: name: java + namespace: devbox-system spec: kind: Language title: java @@ -43,6 +46,7 @@ apiVersion: devbox.sealos.io/v1alpha1 kind: RuntimeClass metadata: name: spring-boot + namespace: devbox-system spec: kind: Framework title: Spring Boot @@ -52,6 +56,7 @@ apiVersion: devbox.sealos.io/v1alpha1 kind: RuntimeClass metadata: name: python + namespace: devbox-system spec: kind: Language title: python @@ -61,6 +66,7 @@ apiVersion: devbox.sealos.io/v1alpha1 kind: RuntimeClass metadata: name: nodejs + namespace: devbox-system spec: kind: Language title: node.js diff --git a/controllers/devbox/deploy/manifests/deploy.yaml.tmpl b/controllers/devbox/deploy/manifests/deploy.yaml.tmpl index 76bdec00f98..619d04b9fb5 100644 --- a/controllers/devbox/deploy/manifests/deploy.yaml.tmpl +++ b/controllers/devbox/deploy/manifests/deploy.yaml.tmpl @@ -2673,8 +2673,11 @@ spec: properties: name: type: string + namespace: + type: string required: - name + - namespace type: object squash: default: false @@ -2725,7 +2728,6 @@ spec: workingDir: type: string required: - - network - resource - runtimeRef - state @@ -5093,6 +5095,30 @@ rules: - get - patch - update +- apiGroups: + - devbox.sealos.io + resources: + - runtimeclasses + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - devbox.sealos.io + resources: + - runtimes + verbs: + - create + - delete + - get + - list + - patch + - update + - watch --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole diff --git a/controllers/devbox/internal/controller/devbox_controller.go b/controllers/devbox/internal/controller/devbox_controller.go index de83247e87e..b8c9e06be59 100644 --- a/controllers/devbox/internal/controller/devbox_controller.go +++ b/controllers/devbox/internal/controller/devbox_controller.go @@ -198,7 +198,7 @@ func (r *DevboxReconciler) syncPod(ctx context.Context, devbox *devboxv1alpha1.D return fmt.Errorf("more than one pod found") } runtime := &devboxv1alpha1.Runtime{} - if err := r.Get(ctx, client.ObjectKey{Namespace: devbox.Namespace, Name: devbox.Spec.RuntimeRef.Name}, runtime); err != nil { + if err := r.Get(ctx, client.ObjectKey{Namespace: devbox.Spec.RuntimeRef.Namespace, Name: devbox.Spec.RuntimeRef.Name}, runtime); err != nil { return err }