Skip to content

Commit

Permalink
re-enable jenkins autoprovisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
bparees committed Oct 23, 2016
1 parent b3871bb commit 354b6c8
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
12 changes: 11 additions & 1 deletion api/swagger-spec/oapi-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -21416,7 +21416,8 @@
"description": "BuildConfigSpec describes when and how builds are created",
"required": [
"triggers",
"strategy"
"strategy",
"nodeSelector"
],
"properties": {
"triggers": {
Expand Down Expand Up @@ -21462,6 +21463,10 @@
"type": "integer",
"format": "int64",
"description": "completionDeadlineSeconds is an optional duration in seconds, counted from the time when a build pod gets scheduled in the system, that the build may be active on a node before the system actively tries to terminate the build; value must be positive integer"
},
"nodeSelector": {
"type": "object",
"description": "nodeSelector is a selector which must be true for the build pod to fit on a node"
}
}
},
Expand Down Expand Up @@ -22477,6 +22482,7 @@
"description": "BuildSpec has the information to represent a build and also additional information about a build",
"required": [
"strategy",
"nodeSelector",
"triggeredBy"
],
"properties": {
Expand Down Expand Up @@ -22513,6 +22519,10 @@
"format": "int64",
"description": "completionDeadlineSeconds is an optional duration in seconds, counted from the time when a build pod gets scheduled in the system, that the build may be active on a node before the system actively tries to terminate the build; value must be positive integer"
},
"nodeSelector": {
"type": "object",
"description": "nodeSelector is a selector which must be true for the build pod to fit on a node"
},
"triggeredBy": {
"type": "array",
"items": {
Expand Down
12 changes: 11 additions & 1 deletion api/swagger-spec/openshift-openapi-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -44686,14 +44686,19 @@
"description": "BuildConfigSpec describes when and how builds are created",
"required": [
"triggers",
"strategy"
"strategy",
"nodeSelector"
],
"properties": {
"completionDeadlineSeconds": {
"description": "completionDeadlineSeconds is an optional duration in seconds, counted from the time when a build pod gets scheduled in the system, that the build may be active on a node before the system actively tries to terminate the build; value must be positive integer",
"type": "integer",
"format": "int64"
},
"nodeSelector": {
"description": "nodeSelector is a selector which must be true for the build pod to fit on a node",
"type": "object"
},
"output": {
"$ref": "#/definitions/v1.BuildOutput"
},
Expand Down Expand Up @@ -44919,6 +44924,7 @@
"description": "BuildSpec has the information to represent a build and also additional information about a build",
"required": [
"strategy",
"nodeSelector",
"triggeredBy"
],
"properties": {
Expand All @@ -44927,6 +44933,10 @@
"type": "integer",
"format": "int64"
},
"nodeSelector": {
"description": "nodeSelector is a selector which must be true for the build pod to fit on a node",
"type": "object"
},
"output": {
"$ref": "#/definitions/v1.BuildOutput"
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/build/admission/jenkinsbootstrapper/admission.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func NewJenkinsBootstrapper(serviceClient coreclient.ServicesGetter) admission.I
}

func (a *jenkinsBootstrapper) Admit(attributes admission.Attributes) error {
if a.jenkinsConfig.AutoProvisionEnabled == nil || !*a.jenkinsConfig.AutoProvisionEnabled {
if a.jenkinsConfig.AutoProvisionEnabled != nil && !*a.jenkinsConfig.AutoProvisionEnabled {
return nil
}
if len(attributes.GetSubresource()) != 0 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/server/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ type AuditConfig struct {
type JenkinsPipelineConfig struct {
// AutoProvisionEnabled determines whether a Jenkins server will be spawned from the provided
// template when the first build config in the project with type JenkinsPipeline
// is created. When not specified this option defaults to false.
// is created. When not specified this option defaults to true.
AutoProvisionEnabled *bool
// TemplateNamespace contains the namespace name where the Jenkins template is stored
TemplateNamespace string
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/server/api/v1/swagger_doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func (ImagePolicyConfig) SwaggerDoc() map[string]string {

var map_JenkinsPipelineConfig = map[string]string{
"": "JenkinsPipelineConfig holds configuration for the Jenkins pipeline strategy",
"autoProvisionEnabled": "AutoProvisionEnabled determines whether a Jenkins server will be spawned from the provided template when the first build config in the project with type JenkinsPipeline is created. When not specified this option defaults to false.",
"autoProvisionEnabled": "AutoProvisionEnabled determines whether a Jenkins server will be spawned from the provided template when the first build config in the project with type JenkinsPipeline is created. When not specified this option defaults to true.",
"templateNamespace": "TemplateNamespace contains the namespace name where the Jenkins template is stored",
"templateName": "TemplateName is the name of the default Jenkins template",
"serviceName": "ServiceName is the name of the Jenkins service OpenShift uses to detect whether a Jenkins pipeline handler has already been installed in a project. This value *must* match a service name in the provided template.",
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/server/api/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ type AuditConfig struct {
type JenkinsPipelineConfig struct {
// AutoProvisionEnabled determines whether a Jenkins server will be spawned from the provided
// template when the first build config in the project with type JenkinsPipeline
// is created. When not specified this option defaults to false.
// is created. When not specified this option defaults to true.
AutoProvisionEnabled *bool `json:"autoProvisionEnabled"`
// TemplateNamespace contains the namespace name where the Jenkins template is stored
TemplateNamespace string `json:"templateNamespace"`
Expand Down

0 comments on commit 354b6c8

Please sign in to comment.