diff --git a/config/crds/devops.kubesphere.io_devopsprojects.yaml b/config/crds/devops.kubesphere.io_devopsprojects.yaml index 75741be3f..d5efd628d 100644 --- a/config/crds/devops.kubesphere.io_devopsprojects.yaml +++ b/config/crds/devops.kubesphere.io_devopsprojects.yaml @@ -38,6 +38,12 @@ spec: type: object status: description: DevOpsProjectStatus defines the observed state of DevOpsProject + properties: + adminNamespace: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed state + of cluster Important: Run "make" to regenerate code after modifying + this file' + type: string type: object type: object version: v1alpha3 diff --git a/config/crds/devops.kubesphere.io_pipelines.yaml b/config/crds/devops.kubesphere.io_pipelines.yaml new file mode 100644 index 000000000..e6e282776 --- /dev/null +++ b/config/crds/devops.kubesphere.io_pipelines.yaml @@ -0,0 +1,260 @@ + +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: (unknown) + creationTimestamp: null + name: pipelines.devops.kubesphere.io +spec: + group: devops.kubesphere.io + names: + kind: Pipeline + listKind: PipelineList + plural: pipelines + singular: pipeline + scope: Namespaced + validation: + openAPIV3Schema: + description: Pipeline is the Schema for the pipelines API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: PipelineSpec defines the desired state of Pipeline + properties: + multi_branch_pipeline: + properties: + bitbucket_server_source: + properties: + api_uri: + type: string + credential_id: + type: string + discover_branches: + type: integer + discover_pr_from_forks: + properties: + strategy: + type: integer + trust: + type: integer + type: object + discover_pr_from_origin: + type: integer + git_clone_option: + properties: + depth: + type: integer + shallow: + type: boolean + timeout: + type: integer + type: object + owner: + type: string + regex_filter: + type: string + repo: + type: string + scm_id: + type: string + type: object + descriptio: + type: string + discarder: + properties: + days_to_keep: + type: string + num_to_keep: + type: string + type: object + git_source: + properties: + credential_id: + type: string + discover_branches: + type: boolean + git_clone_option: + properties: + depth: + type: integer + shallow: + type: boolean + timeout: + type: integer + type: object + regex_filter: + type: string + scm_id: + type: string + url: + type: string + type: object + github_source: + properties: + api_uri: + type: string + credential_id: + type: string + discover_branches: + type: integer + discover_pr_from_forks: + properties: + strategy: + type: integer + trust: + type: integer + type: object + discover_pr_from_origin: + type: integer + git_clone_option: + properties: + depth: + type: integer + shallow: + type: boolean + timeout: + type: integer + type: object + owner: + type: string + regex_filter: + type: string + repo: + type: string + scm_id: + type: string + type: object + multibranch_job_trigger: + properties: + create_action_job_to_trigger: + type: string + delete_action_job_to_trigger: + type: string + type: object + name: + type: string + script_path: + type: string + single_svn_source: + properties: + credential_id: + type: string + remote: + type: string + scm_id: + type: string + type: object + source_type: + type: string + svn_source: + properties: + credential_id: + type: string + excludes: + type: string + includes: + type: string + remote: + type: string + scm_id: + type: string + type: object + timer_trigger: + properties: + cron: + description: user in no scm job + type: string + interval: + description: use in multi-branch job + type: string + type: object + required: + - name + - script_path + - source_type + type: object + pipeline: + properties: + descriptio: + type: string + disable_concurrent: + type: boolean + discarder: + properties: + days_to_keep: + type: string + num_to_keep: + type: string + type: object + jenkinsfile: + type: string + name: + type: string + parameters: + items: + properties: + default_value: + type: string + description: + type: string + name: + type: string + type: + type: string + required: + - name + - type + type: object + type: array + remote_trigger: + properties: + token: + type: string + type: object + timer_trigger: + properties: + cron: + description: user in no scm job + type: string + interval: + description: use in multi-branch job + type: string + type: object + required: + - name + type: object + type: + description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + Important: Run "make" to regenerate code after modifying this file' + type: string + required: + - type + type: object + status: + description: PipelineStatus defines the observed state of Pipeline + type: object + type: object + version: v1alpha3 + versions: + - name: v1alpha3 + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/pkg/simple/client/devops/credential.go b/pkg/simple/client/devops/credential.go index bbb5b0690..e1e39719b 100644 --- a/pkg/simple/client/devops/credential.go +++ b/pkg/simple/client/devops/credential.go @@ -2,7 +2,6 @@ package devops import ( v1 "k8s.io/api/core/v1" - "time" ) type Credential struct { @@ -24,12 +23,6 @@ type Credential struct { } `json:"fingerprint,omitempty" description:"usage of the Credential"` Description string `json:"description,omitempty" description:"Credential's description'"` Domain string `json:"domain,omitempty" description:"Credential's domain,In ks we only use the default domain, default '_''"` - CreateTime *time.Time `json:"create_time,omitempty" description:"Credential's create_time'"` - Creator string `json:"creator,omitempty" description:"Creator's username"` - UsernamePasswordCredential *UsernamePasswordCredential `json:"username_password,omitempty" description:"username password Credential struct"` - SshCredential *SshCredential `json:"ssh,omitempty" description:"ssh Credential struct"` - SecretTextCredential *SecretTextCredential `json:"secret_text,omitempty" description:"secret_text Credential struct"` - KubeconfigCredential *KubeconfigCredential `json:"kubeconfig,omitempty" description:"kubeconfig Credential struct"` } type UsernamePasswordCredential struct { diff --git a/pkg/simple/client/devops/fake/fakedevops.go b/pkg/simple/client/devops/fake/fakedevops.go index 8b7d0fe97..d9424f28e 100644 --- a/pkg/simple/client/devops/fake/fakedevops.go +++ b/pkg/simple/client/devops/fake/fakedevops.go @@ -27,6 +27,7 @@ func New(projects ...string) *Devops { Data: nil, Projects: map[string]interface{}{}, Pipelines: map[string]map[string]*devopsv1alpha3.Pipeline{}, + Credentials: map[string]map[string]*v1.Secret{}, } for _, p := range projects { d.Projects[p] = true @@ -38,6 +39,7 @@ func NewWithPipelines(project string, pipelines ...*devopsv1alpha3.Pipeline) *De Data: nil, Projects: map[string]interface{}{}, Pipelines: map[string]map[string]*devopsv1alpha3.Pipeline{}, + Credentials: map[string]map[string]*v1.Secret{}, } d.Projects[project] = true