diff --git a/config/crds/devops_v1alpha1_s2ibuildertemplate.yaml b/config/crds/devops_v1alpha1_s2ibuildertemplate.yaml index c1cb092d..bbf8b6d8 100644 --- a/config/crds/devops_v1alpha1_s2ibuildertemplate.yaml +++ b/config/crds/devops_v1alpha1_s2ibuildertemplate.yaml @@ -40,12 +40,6 @@ spec: type: object spec: properties: - buildVolumes: - description: BuildVolumes specifies a list of volumes to mount to container - running the build. - items: - type: string - type: array codeFramework: description: CodeFramework means which language this template is designed for and which framework is using if has framework. Like Java, NodeJS @@ -55,6 +49,12 @@ spec: description: Images are the images this template will use. items: properties: + buildVolumes: + description: BuildVolumes specifies a list of volumes to mount + to container running the build. + items: + type: string + type: array builderImage: description: BaseImage are the images this template will use. type: string diff --git a/config/samples/autoscale-failed/python-s2i-builder.yaml b/config/samples/autoscale-failed/python-s2i-builder.yaml index 0e54006e..8ed5819d 100644 --- a/config/samples/autoscale-failed/python-s2i-builder.yaml +++ b/config/samples/autoscale-failed/python-s2i-builder.yaml @@ -22,5 +22,5 @@ spec: password: UserShouldEnterUserPassword builderImage: kubespheredev/python-35-centos7 revisionId: "b3f973b86e78d936df2637eb8058006e9bd5822c" - buildVolumes: ["devops_cache:/opt/app-root/lib"] + buildVolumes: ["s2i_python35_cache:/opt/app-root/lib"] diff --git a/config/samples/devops_v1alpha1_s2ibuilder.yaml b/config/samples/devops_v1alpha1_s2ibuilder.yaml index 675c80f5..8274d581 100644 --- a/config/samples/devops_v1alpha1_s2ibuilder.yaml +++ b/config/samples/devops_v1alpha1_s2ibuilder.yaml @@ -15,4 +15,4 @@ spec: tag: latest builderPullPolicy: if-not-present revisionId: "staging" - buildVolumes: ["devops_cache:/opt/app-root/lib"] + buildVolumes: ["s2i_python35_cache:/opt/app-root/lib"] diff --git a/config/samples/devops_v1alpha2_s2ibuilder_runtimeimage.yaml b/config/samples/devops_v1alpha2_s2ibuilder_runtimeimage.yaml index 32d2d346..815ac211 100644 --- a/config/samples/devops_v1alpha2_s2ibuilder_runtimeimage.yaml +++ b/config/samples/devops_v1alpha2_s2ibuilder_runtimeimage.yaml @@ -17,4 +17,4 @@ spec: tag: latest revisionId: master builderPullPolicy: if-not-present - buildVolumes: ["devops_cache:/opt/app-root/lib"] \ No newline at end of file + buildVolumes: ["s2i_java_cache:/opt/app-root/lib"] \ No newline at end of file diff --git a/config/templates/java.yaml b/config/templates/java.yaml index 96dc1383..919189ef 100644 --- a/config/templates/java.yaml +++ b/config/templates/java.yaml @@ -10,10 +10,12 @@ spec: runtimeImage: zhuxiaoyang/s2i-java11-runtime:latest runtimeArtifacts: - source: "/deployments" + buildVolumes: ["s2i_java_cache:/tmp/artifacts"] - builderImage: kubespheredev/java-8-centos7:advanced-2.0.0 runtimeImage: zhuxiaoyang/s2i-java8-runtime:latest runtimeArtifacts: - source: "/deployments" + buildVolumes: ["s2i_java_cache:/tmp/artifacts"] environment: - key: MAVEN_ARGS type: string @@ -191,5 +193,4 @@ spec: description: "This is a S2I builder template for Java builds whose result can be run directly without any further application server.It's suited ideally for microservices with a flat classpath (including \"far jars\"). This image also provides an easy integration with an Jolokia agent." - iconPath: assets/java.png - buildVolumes: ["devops_cache:/tmp/artifacts"] + iconPath: assets/java.png \ No newline at end of file diff --git a/config/templates/nodejs.yaml b/config/templates/nodejs.yaml index eaa2a34e..42d6cb8f 100644 --- a/config/templates/nodejs.yaml +++ b/config/templates/nodejs.yaml @@ -7,8 +7,11 @@ metadata: spec: containerInfo: - builderImage: kubespheredev/nodejs-8-centos7 + buildVolumes: ["s2i_nodejs_cache:/opt/app-root/src/.npm"] - builderImage: kubespheredev/nodejs-6-centos7 + buildVolumes: ["s2i_nodejs_cache:/opt/app-root/src/.npm"] - builderImage: kubespheredev/nodejs-4-centos7 + buildVolumes: ["s2i_nodejs_cache:/opt/app-root/src/.npm"] environment: - key: NODE_ENV type: string @@ -54,5 +57,4 @@ spec: defaultBaseImage: kubespheredev/nodejs-8-centos7 version: 0.0.1 description: "Node.js available as container is a base platform for building and running various Node.js applications and frameworks. Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices." - iconPath: assets/nodejs.png - buildVolumes: ["devops_cache:/opt/app-root/src/.npm"] + iconPath: assets/nodejs.png \ No newline at end of file diff --git a/config/templates/python.yaml b/config/templates/python.yaml index 1367f7aa..0cfffd16 100644 --- a/config/templates/python.yaml +++ b/config/templates/python.yaml @@ -7,9 +7,13 @@ metadata: spec: containerInfo: - builderImage: kubespheredev/python-36-centos7 + buildVolumes: ["s2i_python36_cache:/opt/app-root/lib"] - builderImage: kubespheredev/python-35-centos7 + buildVolumes: ["s2i_python35_cache:/opt/app-root/lib"] - builderImage: kubespheredev/python-34-centos7 + buildVolumes: ["s2i_python34_cache:/opt/app-root/lib"] - builderImage: kubespheredev/python-27-centos7 + buildVolumes: ["s2i_python27_cache:/opt/app-root/lib"] environment: - key: APP_SCRIPT type: string @@ -78,5 +82,4 @@ spec: description: "Python available as container is a base platform for building and running various Python applications and frameworks. Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python's elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms. This container image includes an npm utility, so users can use it to install JavaScript modules for their web applications. There is no guarantee for any specific npm or nodejs version, that is included in the image; those versions can be changed anytime and the nodejs itself is included just to make the npm work." - iconPath: assets/python.png - buildVolumes: ["devops_cache:/opt/app-root/lib"] + iconPath: assets/python.png \ No newline at end of file diff --git a/deploy/s2ioperator.yaml b/deploy/s2ioperator.yaml index 998bc093..d8de8e2b 100644 --- a/deploy/s2ioperator.yaml +++ b/deploy/s2ioperator.yaml @@ -491,12 +491,6 @@ spec: type: object spec: properties: - buildVolumes: - description: BuildVolumes specifies a list of volumes to mount to container - running the build. - items: - type: string - type: array codeFramework: description: CodeFramework means which language this template is designed for and which framework is using if has framework. Like Java, NodeJS @@ -506,6 +500,12 @@ spec: description: Images are the images this template will use. items: properties: + buildVolumes: + description: BuildVolumes specifies a list of volumes to mount + to container running the build. + items: + type: string + type: array builderImage: description: BaseImage are the images this template will use. type: string diff --git a/pkg/apis/devops/v1alpha1/openapi_generated.go b/pkg/apis/devops/v1alpha1/openapi_generated.go index 5763c1c1..b5e0c766 100644 --- a/pkg/apis/devops/v1alpha1/openapi_generated.go +++ b/pkg/apis/devops/v1alpha1/openapi_generated.go @@ -468,6 +468,20 @@ func schema_pkg_apis_devops_v1alpha1_ContainerInfo(ref common.ReferenceCallback) }, }, }, + "buildVolumes": { + SchemaProps: spec.SchemaProps{ + Description: "BuildVolumes specifies a list of volumes to mount to container running the build.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, }, }, }, @@ -1078,20 +1092,6 @@ func schema_pkg_apis_devops_v1alpha1_S2iBuilderTemplateSpec(ref common.Reference Format: "", }, }, - "buildVolumes": { - SchemaProps: spec.SchemaProps{ - Description: "BuildVolumes specifies a list of volumes to mount to container running the build.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, }, }, }, diff --git a/pkg/apis/devops/v1alpha1/s2ibuildertemplate_types.go b/pkg/apis/devops/v1alpha1/s2ibuildertemplate_types.go index 509caff5..bd53804f 100644 --- a/pkg/apis/devops/v1alpha1/s2ibuildertemplate_types.go +++ b/pkg/apis/devops/v1alpha1/s2ibuildertemplate_types.go @@ -67,9 +67,6 @@ type S2iBuilderTemplateSpec struct { Description string `json:"description,omitempty"` // IconPath is used for frontend display IconPath string `json:"iconPath,omitempty"` - // BuildVolumes specifies a list of volumes to mount to container running the - // build. - BuildVolumes []string `json:"buildVolumes,omitempty"` } type ContainerInfo struct { @@ -77,6 +74,9 @@ type ContainerInfo struct { BuilderImage string `json:"builderImage,omitempty"` RuntimeImage string `json:"runtimeImage,omitempty"` RuntimeArtifacts []VolumeSpec `json:"runtimeArtifacts,omitempty"` + // BuildVolumes specifies a list of volumes to mount to container running the + // build. + BuildVolumes []string `json:"buildVolumes,omitempty"` } // S2iBuilderTemplateStatus defines the observed state of S2iBuilderTemplate diff --git a/pkg/apis/devops/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/devops/v1alpha1/zz_generated.deepcopy.go index f5393083..e931d46b 100644 --- a/pkg/apis/devops/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/devops/v1alpha1/zz_generated.deepcopy.go @@ -97,6 +97,11 @@ func (in *ContainerInfo) DeepCopyInto(out *ContainerInfo) { *out = make([]VolumeSpec, len(*in)) copy(*out, *in) } + if in.BuildVolumes != nil { + in, out := &in.BuildVolumes, &out.BuildVolumes + *out = make([]string, len(*in)) + copy(*out, *in) + } return } @@ -456,11 +461,6 @@ func (in *S2iBuilderTemplateSpec) DeepCopyInto(out *S2iBuilderTemplateSpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.BuildVolumes != nil { - in, out := &in.BuildVolumes, &out.BuildVolumes - *out = make([]string, len(*in)) - copy(*out, *in) - } return }