Skip to content

Commit

Permalink
Merge branch 'main' into caixisheng
Browse files Browse the repository at this point in the history
  • Loading branch information
caixisheng authored Nov 28, 2022
2 parents c0872e9 + f51d9a8 commit 0310fb6
Show file tree
Hide file tree
Showing 13 changed files with 398 additions and 84 deletions.
13 changes: 10 additions & 3 deletions apis/core/v1alpha2/core_trait_volume_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package v1alpha2

import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/xishengcai/oam/pkg/oam"
Expand All @@ -41,9 +42,15 @@ type VolumeMountItem struct {

// PathItem define storageClass, size, path, name
type PathItem struct {
Name string `json:"name"`
PersistentVolumeClaim string `json:"persistentVolumeClaim"`
Path string `json:"path"`
// set volumeMount and volumes link name
Name string `json:"name"`

// Path is the name of directory in container
Path string `json:"path"`

// It's either PVC or HostPath
PersistentVolumeClaim string `json:"persistentVolumeClaim,omitempty"`
HostPath *v1.HostPathVolumeSource `json:"hostPath,omitempty"`
}

// A VolumeTraitStatus represents the observed state of a
Expand Down
12 changes: 6 additions & 6 deletions apis/core/v1alpha2/volume_claim.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
var _ oam.Object = &VolumeClaim{}

type VolumeClaimSpec struct {
// type enum:"HostPath,StorageClass", default is StorageClass
Type string `json:"type,omitempty"`
HostPath string `json:"hostPath,omitempty"`
// type enum:"StorageClass", default is StorageClass
Type string `json:"type,omitempty"`
//HostPath string `json:"hostPath,omitempty"`
StorageClassName string `json:"storageClassName,omitempty"`
// type enum:"ReadWriteOnce,ReadOnlyMany,ReadWriteMany"
// ReadWriteOnce – the volume can be mounted as read-write by a single node
Expand Down Expand Up @@ -61,9 +61,9 @@ type VolumeClaimList struct {
type VolumeClaimConfig struct {
Name string `json:"name"`

// +kubebuilder:validation:Enum=HostPath;StorageClass
Type string `json:"type,omitempty"`
HostPath string `json:"hostPath,omitempty"`
// +kubebuilder:validation:Enum=StorageClass
Type string `json:"type,omitempty"`
//HostPath string `json:"hostPath,omitempty"`
StorageClassName string `json:"storageClassName,omitempty"`
Size string `json:"size,omitempty"`
AccessMode v1.PersistentVolumeAccessMode `json:"accessMode,omitempty"`
Expand Down
9 changes: 8 additions & 1 deletion apis/core/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ spec:
size:
type: string
storageClassName:
description: HostPath string `json:"hostPath,omitempty"`
type: string
type:
enum:
- HostPath
- StorageClass
- StorageClass
type: string
required:
- name
Expand Down Expand Up @@ -374,9 +374,9 @@ spec:
description: UID of the referenced object.
type: string
required:
- apiVersion
- kind
- name
- apiVersion
- kind
- name
type: object
type: object
type: array
Expand All @@ -402,9 +402,9 @@ spec:
description: UID of the referenced object.
type: string
required:
- apiVersion
- kind
- name
- apiVersion
- kind
- name
type: object
type: array
status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,16 +438,16 @@ spec:
kind:
description: Kind of the referenced object.
enum:
- HelmRelease
- HelmRelease
- ContainerizedWorkload
- Third
- Third
type: string
name:
description: Name of the referenced object.
type: string
required:
- kind
- name
- kind
- name
type: object
type: array
forceUpdateTimestamp:
Expand Down Expand Up @@ -483,8 +483,8 @@ spec:
description: The name of the secret.
type: string
required:
- key
- name
- key
- name
type: object
path:
description: Path within the container at which the configuration file should be written.
Expand All @@ -496,8 +496,8 @@ spec:
description: Value that should be written to the configuration file.
type: string
required:
- path
- value
- path
- value
type: object
type: array
env:
Expand All @@ -515,8 +515,8 @@ spec:
description: The name of the secret.
type: string
required:
- key
- name
- key
- name
type: object
name:
description: Name of the environment variable. Must be composed of valid Unicode letter and number characters, as well as _ and -.
Expand All @@ -526,7 +526,7 @@ spec:
description: Value of the environment variable.
type: string
required:
- name
- name
type: object
type: array
image:
Expand Down Expand Up @@ -569,24 +569,24 @@ spec:
description: The header field value
type: string
required:
- name
- value
- name
- value
type: object
type: array
path:
description: Path to access on the HTTP server.
type: string
port:
anyOf:
- type: integer
- type: string
- type: integer
- type: string
description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.
x-kubernetes-int-or-string: true
scheme:
description: Scheme to use for connecting to the host. Defaults to HTTP.
type: string
required:
- port
- port
type: object
initialDelaySeconds:
description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes'
Expand All @@ -608,12 +608,12 @@ spec:
type: string
port:
anyOf:
- type: integer
- type: string
- type: integer
- type: string
description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.
x-kubernetes-int-or-string: true
required:
- port
- port
type: object
timeoutSeconds:
description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes'
Expand Down Expand Up @@ -650,8 +650,8 @@ spec:
- SCTP
type: string
required:
- containerPort
- name
- containerPort
- name
type: object
type: array
readinessProbe:
Expand Down Expand Up @@ -688,24 +688,24 @@ spec:
description: The header field value
type: string
required:
- name
- value
- name
- value
type: object
type: array
path:
description: Path to access on the HTTP server.
type: string
port:
anyOf:
- type: integer
- type: string
- type: integer
- type: string
description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.
x-kubernetes-int-or-string: true
scheme:
description: Scheme to use for connecting to the host. Defaults to HTTP.
type: string
required:
- port
- port
type: object
initialDelaySeconds:
description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes'
Expand All @@ -727,12 +727,12 @@ spec:
type: string
port:
anyOf:
- type: integer
- type: string
- type: integer
- type: string
description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.
x-kubernetes-int-or-string: true
required:
- port
- port
type: object
timeoutSeconds:
description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes'
Expand All @@ -751,7 +751,7 @@ spec:
description: Required CPU count. 1.0 represents one CPU core.
type: string
required:
- required
- required
type: object
extended:
description: Extended resources required by this container.
Expand All @@ -763,13 +763,13 @@ spec:
type: string
required:
anyOf:
- type: integer
- type: string
- type: integer
- type: string
description: Required extended resource(s), e.g. 8 or "very-cool-widget"
x-kubernetes-int-or-string: true
required:
- name
- required
- name
- required
type: object
type: array
gpu:
Expand All @@ -779,7 +779,7 @@ spec:
description: Required GPU count.
type: string
required:
- required
- required
type: object
memory:
description: Memory required by this container.
Expand All @@ -790,7 +790,7 @@ spec:
description: Required memory.
type: string
required:
- required
- required
type: object
volumes:
description: Volumes required by this container.
Expand All @@ -800,8 +800,8 @@ spec:
accessMode:
description: AccessMode of this volume; RO (read only) or RW (read and write).
enum:
- RO
- RW
- RO
- RW
type: string
disk:
description: Disk requirements of this volume.
Expand All @@ -813,7 +813,7 @@ spec:
description: Required disk space.
type: string
required:
- required
- required
type: object
mountPath:
description: MountPath at which this volume will be mounted within its container.
Expand All @@ -824,21 +824,21 @@ spec:
sharingPolicy:
description: SharingPolicy of this volume; Exclusive or Shared.
enum:
- Exclusive
- Shared
- Exclusive
- Shared
type: string
required:
- mountPath
- name
- mountPath
- name
type: object
type: array
required:
- cpu
- memory
- cpu
- memory
type: object
required:
- image
- name
- image
- name
type: object
type: array
nodeSelector:
Expand All @@ -849,8 +849,8 @@ spec:
osType:
description: OperatingSystem required by this workload.
enum:
- linux
- windows
- linux
- windows
type: string
pointToGrayName:
description: old grey workload name need modify match selector
Expand All @@ -869,7 +869,7 @@ spec:
description: Type support deployment and statefulSet
type: string
required:
- containers
- containers
type: object
status:
description: A ContainerizedWorkloadStatus represents the observed state of a ContainerizedWorkload.
Expand Down
Loading

0 comments on commit 0310fb6

Please sign in to comment.