diff --git a/api/api-rules/violation_exceptions.list b/api/api-rules/violation_exceptions.list index bbeb17833..b69e630af 100644 --- a/api/api-rules/violation_exceptions.list +++ b/api/api-rules/violation_exceptions.list @@ -1,3 +1,6 @@ +API rule violation: list_type_missing,./pkg/apis/devops/v1alpha3,DevOpsProjectList,Items +API rule violation: list_type_missing,./pkg/apis/devops/v1alpha3,NoScmPipeline,Parameters +API rule violation: list_type_missing,./pkg/apis/devops/v1alpha3,PipelineList,Items API rule violation: list_type_missing,k8s.io/apimachinery/pkg/apis/meta/v1,APIGroup,ServerAddressByClientCIDRs API rule violation: list_type_missing,k8s.io/apimachinery/pkg/apis/meta/v1,APIGroup,Versions API rule violation: list_type_missing,k8s.io/apimachinery/pkg/apis/meta/v1,APIGroupList,Groups @@ -26,9 +29,61 @@ API rule violation: list_type_missing,k8s.io/apimachinery/pkg/apis/meta/v1,Table API rule violation: list_type_missing,k8s.io/apimachinery/pkg/apis/meta/v1,UpdateOptions,DryRun API rule violation: list_type_missing,k8s.io/apimachinery/pkg/runtime,RawExtension,Raw API rule violation: list_type_missing,k8s.io/apimachinery/pkg/runtime,Unknown,Raw -API rule violation: list_type_missing,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,DevOpsProjectList,Items -API rule violation: list_type_missing,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,NoScmPipeline,Parameters -API rule violation: list_type_missing,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,PipelineList,Items +API rule violation: names_match,./pkg/apis/devops/v1alpha3,BitbucketServerSource,ApiUri +API rule violation: names_match,./pkg/apis/devops/v1alpha3,BitbucketServerSource,CloneOption +API rule violation: names_match,./pkg/apis/devops/v1alpha3,BitbucketServerSource,CredentialId +API rule violation: names_match,./pkg/apis/devops/v1alpha3,BitbucketServerSource,DiscoverBranches +API rule violation: names_match,./pkg/apis/devops/v1alpha3,BitbucketServerSource,DiscoverPRFromForks +API rule violation: names_match,./pkg/apis/devops/v1alpha3,BitbucketServerSource,DiscoverPRFromOrigin +API rule violation: names_match,./pkg/apis/devops/v1alpha3,BitbucketServerSource,DiscoverTags +API rule violation: names_match,./pkg/apis/devops/v1alpha3,BitbucketServerSource,RegexFilter +API rule violation: names_match,./pkg/apis/devops/v1alpha3,BitbucketServerSource,ScmId +API rule violation: names_match,./pkg/apis/devops/v1alpha3,DiscarderProperty,DaysToKeep +API rule violation: names_match,./pkg/apis/devops/v1alpha3,DiscarderProperty,NumToKeep +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GitProviderSource,ApiUri +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GitProviderSource,CloneOption +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GitProviderSource,CredentialId +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GitProviderSource,DiscoverBranches +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GitProviderSource,DiscoverPRFromForks +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GitProviderSource,DiscoverPRFromOrigin +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GitProviderSource,DiscoverTags +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GitProviderSource,RegexFilter +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GitProviderSource,ScmId +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GitSource,CloneOption +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GitSource,CredentialId +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GitSource,DiscoverBranches +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GitSource,DiscoverTags +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GitSource,RegexFilter +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GitSource,ScmId +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GithubSource,ApiUri +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GithubSource,CloneOption +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GithubSource,CredentialId +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GithubSource,DiscoverBranches +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GithubSource,DiscoverPRFromForks +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GithubSource,DiscoverPRFromOrigin +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GithubSource,DiscoverTags +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GithubSource,RegexFilter +API rule violation: names_match,./pkg/apis/devops/v1alpha3,GithubSource,ScmId +API rule violation: names_match,./pkg/apis/devops/v1alpha3,MultiBranchJobTrigger,CreateActionJobsToTrigger +API rule violation: names_match,./pkg/apis/devops/v1alpha3,MultiBranchJobTrigger,DeleteActionJobsToTrigger +API rule violation: names_match,./pkg/apis/devops/v1alpha3,MultiBranchPipeline,BitbucketServerSource +API rule violation: names_match,./pkg/apis/devops/v1alpha3,MultiBranchPipeline,GitHubSource +API rule violation: names_match,./pkg/apis/devops/v1alpha3,MultiBranchPipeline,GitSource +API rule violation: names_match,./pkg/apis/devops/v1alpha3,MultiBranchPipeline,MultiBranchJobTrigger +API rule violation: names_match,./pkg/apis/devops/v1alpha3,MultiBranchPipeline,ScriptPath +API rule violation: names_match,./pkg/apis/devops/v1alpha3,MultiBranchPipeline,SingleSvnSource +API rule violation: names_match,./pkg/apis/devops/v1alpha3,MultiBranchPipeline,SourceType +API rule violation: names_match,./pkg/apis/devops/v1alpha3,MultiBranchPipeline,SvnSource +API rule violation: names_match,./pkg/apis/devops/v1alpha3,MultiBranchPipeline,TimerTrigger +API rule violation: names_match,./pkg/apis/devops/v1alpha3,NoScmPipeline,DisableConcurrent +API rule violation: names_match,./pkg/apis/devops/v1alpha3,NoScmPipeline,RemoteTrigger +API rule violation: names_match,./pkg/apis/devops/v1alpha3,NoScmPipeline,TimerTrigger +API rule violation: names_match,./pkg/apis/devops/v1alpha3,Parameter,DefaultValue +API rule violation: names_match,./pkg/apis/devops/v1alpha3,PipelineSpec,MultiBranchPipeline +API rule violation: names_match,./pkg/apis/devops/v1alpha3,SingleSvnSource,CredentialId +API rule violation: names_match,./pkg/apis/devops/v1alpha3,SingleSvnSource,ScmId +API rule violation: names_match,./pkg/apis/devops/v1alpha3,SvnSource,CredentialId +API rule violation: names_match,./pkg/apis/devops/v1alpha3,SvnSource,ScmId API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,APIResourceList,APIResources API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,Duration,Duration API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,InternalEvent,Object @@ -39,46 +94,3 @@ API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,Time,Time API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,ContentEncoding API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,ContentType API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,Raw -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,BitbucketServerSource,ApiUri -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,BitbucketServerSource,CloneOption -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,BitbucketServerSource,CredentialId -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,BitbucketServerSource,DiscoverBranches -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,BitbucketServerSource,DiscoverPRFromForks -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,BitbucketServerSource,DiscoverPRFromOrigin -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,BitbucketServerSource,RegexFilter -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,BitbucketServerSource,ScmId -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,DiscarderProperty,DaysToKeep -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,DiscarderProperty,NumToKeep -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,GitSource,CloneOption -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,GitSource,CredentialId -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,GitSource,DiscoverBranches -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,GitSource,RegexFilter -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,GitSource,ScmId -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,GithubSource,ApiUri -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,GithubSource,CloneOption -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,GithubSource,CredentialId -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,GithubSource,DiscoverBranches -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,GithubSource,DiscoverPRFromForks -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,GithubSource,DiscoverPRFromOrigin -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,GithubSource,RegexFilter -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,GithubSource,ScmId -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,MultiBranchJobTrigger,CreateActionJobsToTrigger -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,MultiBranchJobTrigger,DeleteActionJobsToTrigger -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,MultiBranchPipeline,BitbucketServerSource -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,MultiBranchPipeline,GitHubSource -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,MultiBranchPipeline,GitSource -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,MultiBranchPipeline,MultiBranchJobTrigger -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,MultiBranchPipeline,ScriptPath -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,MultiBranchPipeline,SingleSvnSource -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,MultiBranchPipeline,SourceType -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,MultiBranchPipeline,SvnSource -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,MultiBranchPipeline,TimerTrigger -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,NoScmPipeline,DisableConcurrent -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,NoScmPipeline,RemoteTrigger -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,NoScmPipeline,TimerTrigger -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,Parameter,DefaultValue -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,PipelineSpec,MultiBranchPipeline -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,SingleSvnSource,CredentialId -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,SingleSvnSource,ScmId -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,SvnSource,CredentialId -API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3,SvnSource,ScmId diff --git a/api/ks-openapi-spec/swagger.json b/api/ks-openapi-spec/swagger.json index f35f940be..25c6e19e1 100644 --- a/api/ks-openapi-spec/swagger.json +++ b/api/ks-openapi-spec/swagger.json @@ -4459,6 +4459,366 @@ } } }, + "/kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/groupbindings": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Group" + ], + "summary": "Create GroupBinding to add a user to the group", + "operationId": "CreateGroupBinding", + "parameters": [ + { + "type": "string", + "description": "workspace name", + "name": "workspace", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha2.GroupMember" + } + } + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/v1alpha2.GroupBinding" + } + } + } + } + }, + "/kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/groupbindings/{groupbinding}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "Group" + ], + "summary": "Delete GroupBinding to remove user from the group.", + "operationId": "DeleteGroupBinding", + "parameters": [ + { + "type": "string", + "description": "workspace name", + "name": "workspace", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "groupbinding name", + "name": "groupbinding", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/errors.Error" + } + } + } + } + }, + "/kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/groups": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Group" + ], + "summary": "List groups of the specified workspace.", + "operationId": "ListWorkspaceGroups", + "parameters": [ + { + "type": "string", + "description": "workspace name", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/api.ListResult" + } + } + } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Group" + ], + "summary": "Create Group", + "operationId": "CreateGroup", + "parameters": [ + { + "type": "string", + "description": "workspace name", + "name": "workspace", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1alpha2.Group" + } + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/v1alpha2.Group" + } + } + } + } + }, + "/kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/groups/{group}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Group" + ], + "summary": "Retrieve group details.", + "operationId": "DescribeGroup", + "parameters": [ + { + "type": "string", + "description": "workspace name", + "name": "workspace", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "group name", + "name": "group", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/v1alpha2.Group" + } + } + } + }, + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "Group" + ], + "summary": "Update Group", + "operationId": "UpdateGroup", + "parameters": [ + { + "type": "string", + "description": "workspace name", + "name": "workspace", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "group name", + "name": "group", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1alpha2.Group" + } + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/v1alpha2.Group" + } + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "Group" + ], + "summary": "Delete group.", + "operationId": "DeleteGroup", + "parameters": [ + { + "type": "string", + "description": "workspace name", + "name": "workspace", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "group name", + "name": "group", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/errors.Error" + } + } + } + } + }, + "/kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/groups/{group}/groupbindings": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Group" + ], + "summary": "Retrieve group's members in the workspace.", + "operationId": "ListGroupBindings", + "parameters": [ + { + "type": "string", + "description": "workspace name", + "name": "workspace", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "group name", + "name": "group", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/api.ListResult" + } + } + } + } + }, + "/kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/groups/{group}/rolebindings": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Group" + ], + "summary": "Retrieve group's rolebindings of all projects in the workspace.", + "operationId": "ListGroupsRoleBinding", + "parameters": [ + { + "type": "string", + "description": "workspace name", + "name": "workspace", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "group name", + "name": "group", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/api.ListResult" + } + } + } + } + }, + "/kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/groups/{group}/workspacerolebinding": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Group" + ], + "summary": "Retrieve group's workspacerolebindings of the workspace.", + "operationId": "ListGroupsWorkspaceRoleBinding", + "parameters": [ + { + "type": "string", + "description": "workspace name", + "name": "workspace", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "group name", + "name": "group", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/api.ListResult" + } + } + } + } + }, "/kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/workspacemembers": { "get": { "produces": [ @@ -12014,7 +12374,7 @@ } } }, - "/kapis/terminal.kubesphere.io/v1alpha2/namespaces/{namespace}/pods/{pod}": { + "/kapis/terminal.kubesphere.io/v1alpha2/namespaces/{namespace}/pods/{pod}/exec": { "get": { "produces": [ "application/json" @@ -12340,11 +12700,12 @@ "type": "string" }, "value": { - "description": "value", - "type": "string" + "description": "value, string or bool type", + "$ref": "#/definitions/.defaultParameterValue.value" } } }, + ".defaultParameterValue.value": {}, ".latestRun": { "properties": { "_class": { @@ -20590,6 +20951,80 @@ } } }, + "v1alpha2.Group": { + "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": { + "$ref": "#/definitions/v1.ObjectMeta" + }, + "spec": { + "$ref": "#/definitions/v1alpha2.GroupSpec" + }, + "status": { + "$ref": "#/definitions/v1alpha2.GroupStatus" + } + } + }, + "v1alpha2.GroupBinding": { + "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" + }, + "groupRef": { + "$ref": "#/definitions/v1alpha2.GroupRef" + }, + "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": { + "$ref": "#/definitions/v1.ObjectMeta" + }, + "users": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "v1alpha2.GroupMember": { + "required": [ + "userName", + "groupName" + ], + "properties": { + "groupName": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "v1alpha2.GroupRef": { + "properties": { + "apiGroup": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "v1alpha2.GroupSpec": {}, + "v1alpha2.GroupStatus": {}, "v1alpha2.HealthStatus": { "required": [ "kubesphereStatus", @@ -20720,10 +21155,10 @@ }, "v1alpha2.Node": { "required": [ - "label", - "rank", "id", + "label", "labelMinor", + "rank", "controls" ], "properties": { @@ -20831,10 +21266,10 @@ }, "v1alpha2.NodeSummary": { "required": [ - "labelMinor", - "rank", "id", - "label" + "label", + "labelMinor", + "rank" ], "properties": { "adjacency": { @@ -21272,6 +21707,10 @@ "type": "integer", "format": "int32" }, + "discover_tags": { + "description": "Discover tag configuration", + "type": "boolean" + }, "git_clone_option": { "description": "advavced git clone options", "$ref": "#/definitions/v1alpha3.GitCloneOption" @@ -21377,6 +21816,10 @@ "description": "Whether to discover a branch", "type": "boolean" }, + "discover_tags": { + "description": "Discover tags configuration", + "type": "boolean" + }, "git_clone_option": { "description": "advavced git clone options", "$ref": "#/definitions/v1alpha3.GitCloneOption" @@ -21419,6 +21862,10 @@ "type": "integer", "format": "int32" }, + "discover_tags": { + "description": "Discover tag configuration", + "type": "boolean" + }, "git_clone_option": { "description": "advavced git clone options", "$ref": "#/definitions/v1alpha3.GitCloneOption" diff --git a/config/crds/devops.kubesphere.io_pipelines.yaml b/config/crds/devops.kubesphere.io_pipelines.yaml index c2c6a55e3..830b65661 100644 --- a/config/crds/devops.kubesphere.io_pipelines.yaml +++ b/config/crds/devops.kubesphere.io_pipelines.yaml @@ -53,6 +53,8 @@ spec: type: object discover_pr_from_origin: type: integer + discover_tags: + type: boolean git_clone_option: properties: depth: @@ -86,6 +88,8 @@ spec: type: string discover_branches: type: boolean + discover_tags: + type: boolean git_clone_option: properties: depth: @@ -103,6 +107,8 @@ spec: type: string type: object github_source: + description: GithubSource and BitbucketServerSource have the same + structure, but we don't use one due to crd errors properties: api_uri: type: string @@ -119,6 +125,8 @@ spec: type: object discover_pr_from_origin: type: integer + discover_tags: + type: boolean git_clone_option: properties: depth: diff --git a/pkg/apis/devops/v1alpha3/pipeline_types.go b/pkg/apis/devops/v1alpha3/pipeline_types.go index f5922d14b..423ebce92 100644 --- a/pkg/apis/devops/v1alpha3/pipeline_types.go +++ b/pkg/apis/devops/v1alpha3/pipeline_types.go @@ -108,10 +108,12 @@ type GitSource struct { Url string `json:"url,omitempty" mapstructure:"url" description:"url of git source"` CredentialId string `json:"credential_id,omitempty" mapstructure:"credential_id" description:"credential id to access git source"` DiscoverBranches bool `json:"discover_branches,omitempty" mapstructure:"discover_branches" description:"Whether to discover a branch"` + DiscoverTags bool `json:"discover_tags,omitempty" mapstructure:"discover_tags" description:"Discover tags configuration"` CloneOption *GitCloneOption `json:"git_clone_option,omitempty" mapstructure:"git_clone_option" description:"advavced git clone options"` RegexFilter string `json:"regex_filter,omitempty" mapstructure:"regex_filter" description:"Regex used to match the name of the branch that needs to be run"` } +// GithubSource and BitbucketServerSource have the same structure, but we don't use one due to crd errors type GithubSource struct { ScmId string `json:"scm_id,omitempty" description:"uid of scm"` Owner string `json:"owner,omitempty" mapstructure:"owner" description:"owner of github repo"` @@ -121,15 +123,11 @@ type GithubSource struct { DiscoverBranches int `json:"discover_branches,omitempty" mapstructure:"discover_branches" description:"Discover branch configuration"` DiscoverPRFromOrigin int `json:"discover_pr_from_origin,omitempty" mapstructure:"discover_pr_from_origin" description:"Discover origin PR configuration"` DiscoverPRFromForks *DiscoverPRFromForks `json:"discover_pr_from_forks,omitempty" mapstructure:"discover_pr_from_forks" description:"Discover fork PR configuration"` + DiscoverTags bool `json:"discover_tags,omitempty" mapstructure:"discover_tags" description:"Discover tag configuration"` CloneOption *GitCloneOption `json:"git_clone_option,omitempty" mapstructure:"git_clone_option" description:"advavced git clone options"` RegexFilter string `json:"regex_filter,omitempty" mapstructure:"regex_filter" description:"Regex used to match the name of the branch that needs to be run"` } -type MultiBranchJobTrigger struct { - CreateActionJobsToTrigger string `json:"create_action_job_to_trigger,omitempty" description:"pipeline name to trigger"` - DeleteActionJobsToTrigger string `json:"delete_action_job_to_trigger,omitempty" description:"pipeline name to trigger"` -} - type BitbucketServerSource struct { ScmId string `json:"scm_id,omitempty" description:"uid of scm"` Owner string `json:"owner,omitempty" mapstructure:"owner" description:"owner of github repo"` @@ -139,10 +137,16 @@ type BitbucketServerSource struct { DiscoverBranches int `json:"discover_branches,omitempty" mapstructure:"discover_branches" description:"Discover branch configuration"` DiscoverPRFromOrigin int `json:"discover_pr_from_origin,omitempty" mapstructure:"discover_pr_from_origin" description:"Discover origin PR configuration"` DiscoverPRFromForks *DiscoverPRFromForks `json:"discover_pr_from_forks,omitempty" mapstructure:"discover_pr_from_forks" description:"Discover fork PR configuration"` + DiscoverTags bool `json:"discover_tags,omitempty" mapstructure:"discover_tags" description:"Discover tag configuration"` CloneOption *GitCloneOption `json:"git_clone_option,omitempty" mapstructure:"git_clone_option" description:"advavced git clone options"` RegexFilter string `json:"regex_filter,omitempty" mapstructure:"regex_filter" description:"Regex used to match the name of the branch that needs to be run"` } +type MultiBranchJobTrigger struct { + CreateActionJobsToTrigger string `json:"create_action_job_to_trigger,omitempty" description:"pipeline name to trigger"` + DeleteActionJobsToTrigger string `json:"delete_action_job_to_trigger,omitempty" description:"pipeline name to trigger"` +} + type GitCloneOption struct { Shallow bool `json:"shallow,omitempty" mapstructure:"shallow" description:"Whether to use git shallow clone"` Timeout int `json:"timeout,omitempty" mapstructure:"timeout" description:"git clone timeout mins"` diff --git a/pkg/apis/devops/v1alpha3/zz_generated.deepcopy.go b/pkg/apis/devops/v1alpha3/zz_generated.deepcopy.go index fb415a10f..d82684e7f 100644 --- a/pkg/apis/devops/v1alpha3/zz_generated.deepcopy.go +++ b/pkg/apis/devops/v1alpha3/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by deepcopy-gen. DO NOT EDIT. +// Code generated by controller-gen. DO NOT EDIT. package v1alpha3 @@ -37,7 +37,6 @@ func (in *BitbucketServerSource) DeepCopyInto(out *BitbucketServerSource) { *out = new(GitCloneOption) **out = **in } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketServerSource. @@ -57,7 +56,6 @@ func (in *DevOpsProject) DeepCopyInto(out *DevOpsProject) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) out.Spec = in.Spec out.Status = in.Status - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevOpsProject. @@ -90,7 +88,6 @@ func (in *DevOpsProjectList) DeepCopyInto(out *DevOpsProjectList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevOpsProjectList. @@ -114,7 +111,6 @@ func (in *DevOpsProjectList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevOpsProjectSpec) DeepCopyInto(out *DevOpsProjectSpec) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevOpsProjectSpec. @@ -130,7 +126,6 @@ func (in *DevOpsProjectSpec) DeepCopy() *DevOpsProjectSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevOpsProjectStatus) DeepCopyInto(out *DevOpsProjectStatus) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevOpsProjectStatus. @@ -146,7 +141,6 @@ func (in *DevOpsProjectStatus) DeepCopy() *DevOpsProjectStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DiscarderProperty) DeepCopyInto(out *DiscarderProperty) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscarderProperty. @@ -162,7 +156,6 @@ func (in *DiscarderProperty) DeepCopy() *DiscarderProperty { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DiscoverPRFromForks) DeepCopyInto(out *DiscoverPRFromForks) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoverPRFromForks. @@ -178,7 +171,6 @@ func (in *DiscoverPRFromForks) DeepCopy() *DiscoverPRFromForks { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GitCloneOption) DeepCopyInto(out *GitCloneOption) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitCloneOption. @@ -199,7 +191,6 @@ func (in *GitSource) DeepCopyInto(out *GitSource) { *out = new(GitCloneOption) **out = **in } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitSource. @@ -225,7 +216,6 @@ func (in *GithubSource) DeepCopyInto(out *GithubSource) { *out = new(GitCloneOption) **out = **in } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GithubSource. @@ -241,7 +231,6 @@ func (in *GithubSource) DeepCopy() *GithubSource { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MultiBranchJobTrigger) DeepCopyInto(out *MultiBranchJobTrigger) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiBranchJobTrigger. @@ -297,7 +286,6 @@ func (in *MultiBranchPipeline) DeepCopyInto(out *MultiBranchPipeline) { *out = new(MultiBranchJobTrigger) **out = **in } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiBranchPipeline. @@ -333,7 +321,6 @@ func (in *NoScmPipeline) DeepCopyInto(out *NoScmPipeline) { *out = new(RemoteTrigger) **out = **in } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NoScmPipeline. @@ -349,7 +336,6 @@ func (in *NoScmPipeline) DeepCopy() *NoScmPipeline { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Parameter) DeepCopyInto(out *Parameter) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Parameter. @@ -369,7 +355,6 @@ func (in *Pipeline) DeepCopyInto(out *Pipeline) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) out.Status = in.Status - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pipeline. @@ -402,7 +387,6 @@ func (in *PipelineList) DeepCopyInto(out *PipelineList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineList. @@ -436,7 +420,6 @@ func (in *PipelineSpec) DeepCopyInto(out *PipelineSpec) { *out = new(MultiBranchPipeline) (*in).DeepCopyInto(*out) } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineSpec. @@ -452,7 +435,6 @@ func (in *PipelineSpec) DeepCopy() *PipelineSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PipelineStatus) DeepCopyInto(out *PipelineStatus) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineStatus. @@ -468,7 +450,6 @@ func (in *PipelineStatus) DeepCopy() *PipelineStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RemoteTrigger) DeepCopyInto(out *RemoteTrigger) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteTrigger. @@ -484,7 +465,6 @@ func (in *RemoteTrigger) DeepCopy() *RemoteTrigger { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SingleSvnSource) DeepCopyInto(out *SingleSvnSource) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SingleSvnSource. @@ -500,7 +480,6 @@ func (in *SingleSvnSource) DeepCopy() *SingleSvnSource { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SvnSource) DeepCopyInto(out *SvnSource) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvnSource. @@ -516,7 +495,6 @@ func (in *SvnSource) DeepCopy() *SvnSource { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TimerTrigger) DeepCopyInto(out *TimerTrigger) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimerTrigger. diff --git a/pkg/controller/pipeline/pipeline_controller.go b/pkg/controller/pipeline/pipeline_controller.go index f0aba63f6..4a7dea4d9 100644 --- a/pkg/controller/pipeline/pipeline_controller.go +++ b/pkg/controller/pipeline/pipeline_controller.go @@ -239,6 +239,8 @@ func (c *Controller) syncHandler(key string) error { klog.V(8).Info(err, fmt.Sprintf("failed to update pipeline config %s ", key)) return err } + } else { + klog.V(7).Info(fmt.Sprintf("nothing was changed, pipeline '%v'", copyPipeline.Spec)) } } else { _, err := c.devopsClient.CreateProjectPipeline(nsName, copyPipeline) diff --git a/pkg/simple/client/devops/jenkins/pipeline_internal.go b/pkg/simple/client/devops/jenkins/pipeline_internal.go index 96855b37f..2719338a1 100644 --- a/pkg/simple/client/devops/jenkins/pipeline_internal.go +++ b/pkg/simple/client/devops/jenkins/pipeline_internal.go @@ -262,6 +262,9 @@ func appendGitSourceToEtree(source *etree.Element, gitSource *devopsv1alpha3.Git if gitSource.DiscoverBranches { traits.CreateElement("jenkins.plugins.git.traits.BranchDiscoveryTrait") } + if gitSource.DiscoverTags { + traits.CreateElement("jenkins.plugins.git.traits.TagDiscoveryTrait") + } if gitSource.CloneOption != nil { cloneExtension := traits.CreateElement("jenkins.plugins.git.traits.CloneOptionTrait").CreateElement("extension") cloneExtension.CreateAttr("class", "hudson.plugins.git.extensions.impl.CloneOption") @@ -304,6 +307,10 @@ func getGitSourcefromEtree(source *etree.Element) *devopsv1alpha3.GitSource { "jenkins.plugins.git.traits.BranchDiscoveryTrait"); branchDiscoverTrait != nil { gitSource.DiscoverBranches = true } + if tagDiscoverTrait := traits.SelectElement( + "jenkins.plugins.git.traits.TagDiscoveryTrait"); tagDiscoverTrait != nil { + gitSource.DiscoverTags = true + } if cloneTrait := traits.SelectElement( "jenkins.plugins.git.traits.CloneOptionTrait"); cloneTrait != nil { if cloneExtension := cloneTrait.SelectElement( @@ -349,6 +356,10 @@ func getGithubSourcefromEtree(source *etree.Element) *devopsv1alpha3.GithubSourc strategyId, _ := strconv.Atoi(branchDiscoverTrait.SelectElement("strategyId").Text()) githubSource.DiscoverBranches = strategyId } + if tagDiscoverTrait := traits.SelectElement( + "org.jenkinsci.plugins.github__branch__source.TagDiscoveryTrait"); tagDiscoverTrait != nil { + githubSource.DiscoverTags = true + } if originPRDiscoverTrait := traits.SelectElement( "org.jenkinsci.plugins.github__branch__source.OriginPullRequestDiscoveryTrait"); originPRDiscoverTrait != nil { strategyId, _ := strconv.Atoi(originPRDiscoverTrait.SelectElement("strategyId").Text()) @@ -444,6 +455,9 @@ func appendGithubSourceToEtree(source *etree.Element, githubSource *devopsv1alph } forkTrait.CreateElement("trust").CreateAttr("class", trustClass) } + if githubSource.DiscoverTags { + traits.CreateElement("org.jenkinsci.plugins.github__branch__source.TagDiscoveryTrait") + } if githubSource.CloneOption != nil { cloneExtension := traits.CreateElement("jenkins.plugins.git.traits.CloneOptionTrait").CreateElement("extension") cloneExtension.CreateAttr("class", "hudson.plugins.git.extensions.impl.CloneOption") @@ -491,6 +505,10 @@ func getBitbucketServerSourceFromEtree(source *etree.Element) *devopsv1alpha3.Bi strategyId, _ := strconv.Atoi(branchDiscoverTrait.SelectElement("strategyId").Text()) s.DiscoverBranches = strategyId } + if tagDiscoverTrait := traits.SelectElement( + "com.cloudbees.jenkins.plugins.bitbucket.TagDiscoveryTrait"); tagDiscoverTrait != nil { + s.DiscoverTags = true + } if originPRDiscoverTrait := traits.SelectElement( "com.cloudbees.jenkins.plugins.bitbucket.OriginPullRequestDiscoveryTrait"); originPRDiscoverTrait != nil { strategyId, _ := strconv.Atoi(originPRDiscoverTrait.SelectElement("strategyId").Text()) @@ -579,6 +597,9 @@ func appendBitbucketServerSourceToEtree(source *etree.Element, s *devopsv1alpha3 } forkTrait.CreateElement("trust").CreateAttr("class", trustClass) } + if s.DiscoverTags { + traits.CreateElement("com.cloudbees.jenkins.plugins.bitbucket.TagDiscoveryTrait") + } if s.CloneOption != nil { cloneExtension := traits.CreateElement("jenkins.plugins.git.traits.CloneOptionTrait").CreateElement("extension") cloneExtension.CreateAttr("class", "hudson.plugins.git.extensions.impl.CloneOption")