diff --git a/api/v1/softwarefactory_types.go b/api/v1/softwarefactory_types.go index 63d1ca75..9542f122 100644 --- a/api/v1/softwarefactory_types.go +++ b/api/v1/softwarefactory_types.go @@ -140,6 +140,18 @@ type GerritConnection struct { VerifySSL bool `json:"verifyssl,omitempty"` } +// Describes a Zuul connection using the [git driver](https://zuul-ci.org/docs/zuul/latest/drivers/git.html#connection-configuration). +// When an optional parameter is not specified then Zuul's defaults apply +type GitConnection struct { + // How the connection will be named in Zuul's configuration and appear in zuul-web + Name string `json:"name"` + // [baseurl](https://zuul-ci.org/docs/zuul/latest/drivers/git.html#attr-%3Cgit%20connection%3E.baseurl) + // +kubebuilder:validation:Pattern:=`^(https?|git):\/\/.+$` + Baseurl string `json:"baseurl"` + // [poolDelay](https://zuul-ci.org/docs/zuul/latest/drivers/git.html#attr-%3Cgit%20connection%3E.poll_delays) + PollDelay int32 `json:"pollDelay,omitempty"` +} + // The description of an OpenIDConnect authenticator, see [Zuul's authentication documentation](https://zuul-ci.org/docs/zuul/latest/configuration.html#authentication) type ZuulOIDCAuthenticatorSpec struct { // The [name of the authenticator in Zuul's configuration](https://zuul-ci.org/docs/zuul/latest/configuration.html#attr-auth%20%3Cauthenticator%20name%3E) @@ -256,6 +268,8 @@ type ZuulSpec struct { GitHubConns []GitHubConnection `json:"githubconns,omitempty"` // The list of GitLab-based connections to add to Zuul's configuration GitLabConns []GitLabConnection `json:"gitlabconns,omitempty"` + // The list of Git-based connections to add to Zuul's configuration + GitConns []GitConnection `json:"gitconns,omitempty"` // Configuration of the executor microservices Executor ZuulExecutorSpec `json:"executor,omitempty"` // Configuration of the scheduler microservice diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index e18c49b2..e10c36b5 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -73,6 +73,21 @@ func (in *GerritConnection) DeepCopy() *GerritConnection { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GitConnection) DeepCopyInto(out *GitConnection) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitConnection. +func (in *GitConnection) DeepCopy() *GitConnection { + if in == nil { + return nil + } + out := new(GitConnection) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GitHubConnection) DeepCopyInto(out *GitHubConnection) { *out = *in @@ -583,6 +598,11 @@ func (in *ZuulSpec) DeepCopyInto(out *ZuulSpec) { *out = make([]GitLabConnection, len(*in)) copy(*out, *in) } + if in.GitConns != nil { + in, out := &in.GitConns, &out.GitConns + *out = make([]GitConnection, len(*in)) + copy(*out, *in) + } in.Executor.DeepCopyInto(&out.Executor) in.Scheduler.DeepCopyInto(&out.Scheduler) out.Web = in.Web diff --git a/config/crd/bases/sf.softwarefactory-project.io_softwarefactories.yaml b/config/crd/bases/sf.softwarefactory-project.io_softwarefactories.yaml index 0816b017..e2aab61a 100644 --- a/config/crd/bases/sf.softwarefactory-project.io_softwarefactories.yaml +++ b/config/crd/bases/sf.softwarefactory-project.io_softwarefactories.yaml @@ -397,6 +397,31 @@ spec: - name type: object type: array + gitconns: + description: The list of Git-based connections to add to Zuul's + configuration + items: + description: Describes a Zuul connection using the [git driver](https://zuul-ci.org/docs/zuul/latest/drivers/git.html#connection-configuration). + When an optional parameter is not specified then Zuul's defaults + apply + properties: + baseurl: + description: '[baseurl](https://zuul-ci.org/docs/zuul/latest/drivers/git.html#attr-%3Cgit%20connection%3E.baseurl)' + pattern: ^(https?|git):\/\/.+$ + type: string + name: + description: How the connection will be named in Zuul's + configuration and appear in zuul-web + type: string + pollDelay: + description: '[poolDelay](https://zuul-ci.org/docs/zuul/latest/drivers/git.html#attr-%3Cgit%20connection%3E.poll_delays)' + format: int32 + type: integer + required: + - baseurl + - name + type: object + type: array githubconns: description: The list of GitHub-based connections to add to Zuul's configuration diff --git a/doc/reference/api/index.md b/doc/reference/api/index.md index b401b60c..0577fa67 100644 --- a/doc/reference/api/index.md +++ b/doc/reference/api/index.md @@ -71,6 +71,22 @@ _Appears in:_ | `verifyssl` _boolean_ | Disable SSL certificate verification with the Gerrit instance when set to false. Equivalent to the [verify_ssl](https://zuul-ci.org/docs/zuul/latest/drivers/gerrit.html#attr-%3Cgerrit%20ssh%20connection%3E.verify_ssl) parameter. | -| +#### GitConnection + + + +Describes a Zuul connection using the [git driver](https://zuul-ci.org/docs/zuul/latest/drivers/git.html#connection-configuration). When an optional parameter is not specified then Zuul's defaults apply + +_Appears in:_ +- [ZuulSpec](#zuulspec) + +| Field | Description | Default Value | +| --- | --- | --- | +| `name` _string_ | How the connection will be named in Zuul's configuration and appear in zuul-web | -| +| `baseurl` _string_ | [baseurl](https://zuul-ci.org/docs/zuul/latest/drivers/git.html#attr-%3Cgit%20connection%3E.baseurl) | -| +| `pollDelay` _integer_ | [poolDelay](https://zuul-ci.org/docs/zuul/latest/drivers/git.html#attr-%3Cgit%20connection%3E.poll_delays) | -| + + #### GitHubConnection @@ -502,6 +518,7 @@ _Appears in:_ | `gerritconns` _[GerritConnection](#gerritconnection) array_ | The list of Gerrit-based connections to add to Zuul's configuration | -| | `githubconns` _[GitHubConnection](#githubconnection) array_ | The list of GitHub-based connections to add to Zuul's configuration | -| | `gitlabconns` _[GitLabConnection](#gitlabconnection) array_ | The list of GitLab-based connections to add to Zuul's configuration | -| +| `gitconns` _[GitConnection](#gitconnection) array_ | The list of Git-based connections to add to Zuul's configuration | -| | `executor` _[ZuulExecutorSpec](#zuulexecutorspec)_ | Configuration of the executor microservices | -| | `scheduler` _[ZuulSchedulerSpec](#zuulschedulerspec)_ | Configuration of the scheduler microservice | -| | `web` _[ZuulWebSpec](#zuulwebspec)_ | Configuration of the web microservice | -|