未验证 提交 efc96f05 编写于 作者: K KubeSphere CI Bot 提交者: GitHub

Merge pull request #627 from runzexia/update-s2i

update s2i version
......@@ -4469,7 +4469,7 @@
"secretRef": {
"$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference"
},
"server_address": {
"serverAddress": {
"type": "string"
},
"username": {
......@@ -4514,6 +4514,31 @@
}
}
},
"com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.ContainerInfo": {
"type": "object",
"properties": {
"buildVolumes": {
"description": "BuildVolumes specifies a list of volumes to mount to container running the build.",
"type": "array",
"items": {
"type": "string"
}
},
"builderImage": {
"description": "BaseImage are the images this template will use.",
"type": "string"
},
"runtimeArtifacts": {
"type": "array",
"items": {
"$ref": "#/definitions/com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.VolumeSpec"
}
},
"runtimeImage": {
"type": "string"
}
}
},
"com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.DockerConfig": {
"description": "DockerConfig contains the configuration for a Docker connection.",
"type": "object",
......@@ -4779,17 +4804,17 @@
"description": "S2iBuilderTemplateSpec defines the desired state of S2iBuilderTemplate",
"type": "object",
"properties": {
"baseImages": {
"description": "BaseImages are the images this template will use.",
"type": "array",
"items": {
"type": "string"
}
},
"codeFramework": {
"description": "CodeFramework means which language this template is designed for and which framework is using if has framework. Like Java, NodeJS etc",
"type": "string"
},
"containerInfo": {
"description": "Images are the images this template will use.",
"type": "array",
"items": {
"$ref": "#/definitions/com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.ContainerInfo"
}
},
"defaultBaseImage": {
"description": "DefaultBaseImage is the image that will be used by default",
"type": "string"
......@@ -4961,6 +4986,10 @@
"$ref": "#/definitions/com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.VolumeSpec"
}
},
"isBinaryURL": {
"description": "IsBinaryURL explain the type of SourceURL. If it is IsBinaryURL, it will download the file directly without using git.",
"type": "boolean"
},
"keepSymlinks": {
"description": "KeepSymlinks indicates to copy symlinks as symlinks. Default behavior is to follow symlinks and copy files by content.",
"type": "boolean"
......@@ -4980,6 +5009,17 @@
"description": "LayeredBuild describes if this is build which layered scripts and sources on top of BuilderImage.",
"type": "boolean"
},
"nodeAffinityKey": {
"description": "The key of Node Affinity.",
"type": "string"
},
"nodeAffinityValues": {
"description": "The values of Node Affinity.",
"type": "array",
"items": {
"type": "string"
}
},
"outputImageName": {
"description": "OutputImageName is a result image name without tag, default is latest. tag will append to ImageName in the end",
"type": "string"
......@@ -5004,6 +5044,10 @@
"description": "RemovePreviousImage describes if previous image should be removed after successful build. This applies only to incremental builds.",
"type": "boolean"
},
"revisionId": {
"description": "The RevisionId is a branch name or a SHA-1 hash of every important thing about the commit",
"type": "string"
},
"runImage": {
"description": "RunImage will trigger a \"docker run ...\" invocation of the produced image so the user can see if it operates as he would expect",
"type": "boolean"
......@@ -5050,6 +5094,10 @@
"description": "Tag is a result image tag name.",
"type": "string"
},
"taintKey": {
"description": "The name of taint.",
"type": "string"
},
"usage": {
"description": "Usage allows for properly shortcircuiting s2i logic when `s2i usage` is invoked",
"type": "boolean"
......@@ -5143,6 +5191,14 @@
"description": "BuilderName specify the name of s2ibuilder, required",
"type": "string"
},
"newRevisionId": {
"description": "NewRevisionId override the default NewRevisionId in its s2ibuilder.",
"type": "string"
},
"newSourceURL": {
"description": "NewSourceURL is used to download new binary artifacts",
"type": "string"
},
"newTag": {
"description": "NewTag override the default tag in its s2ibuilder, image name cannot be changed.",
"type": "string"
......@@ -5187,7 +5243,7 @@
"com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.UserDefineTemplate": {
"type": "object",
"properties": {
"baseImage": {
"builderImage": {
"description": "BaseImage specify which version of this template to use",
"type": "string"
},
......@@ -5207,21 +5263,16 @@
"com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.VolumeSpec": {
"description": "VolumeSpec represents a single volume mount point.",
"type": "object",
"required": [
"Source",
"Destination",
"Keep"
],
"properties": {
"Destination": {
"destination": {
"description": "Destination is the path to mount the volume to - absolute or relative.",
"type": "string"
},
"Keep": {
"keep": {
"description": "Keep indicates if the mounted data should be kept in the final image.",
"type": "boolean"
},
"Source": {
"source": {
"description": "Source is a reference to the volume source.",
"type": "string"
}
......
......@@ -69,7 +69,7 @@ require (
github.com/knative/pkg v0.0.0-20190314204845-cd278f2d3394
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/kubernetes-sigs/application v0.0.0-20190404151855-67ae7f915d4e
github.com/kubesphere/s2ioperator v0.0.11
github.com/kubesphere/s2ioperator v0.0.12
github.com/kubesphere/sonargo v0.0.2
github.com/lib/pq v1.2.0 // indirect
github.com/lucas-clemente/quic-go v0.11.1 // indirect
......
......@@ -34,6 +34,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
"github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1.AuthConfig": schema_pkg_apis_devops_v1alpha1_AuthConfig(ref),
"github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1.CGroupLimits": schema_pkg_apis_devops_v1alpha1_CGroupLimits(ref),
"github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1.ContainerConfig": schema_pkg_apis_devops_v1alpha1_ContainerConfig(ref),
"github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1.ContainerInfo": schema_pkg_apis_devops_v1alpha1_ContainerInfo(ref),
"github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1.DockerConfig": schema_pkg_apis_devops_v1alpha1_DockerConfig(ref),
"github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1.DockerConfigEntry": schema_pkg_apis_devops_v1alpha1_DockerConfigEntry(ref),
"github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1.DockerConfigJson": schema_pkg_apis_devops_v1alpha1_DockerConfigJson(ref),
......@@ -325,7 +326,7 @@ func schema_pkg_apis_devops_v1alpha1_AuthConfig(ref common.ReferenceCallback) co
Format: "",
},
},
"server_address": {
"serverAddress": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
......@@ -436,6 +437,59 @@ func schema_pkg_apis_devops_v1alpha1_ContainerConfig(ref common.ReferenceCallbac
}
}
func schema_pkg_apis_devops_v1alpha1_ContainerInfo(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"builderImage": {
SchemaProps: spec.SchemaProps{
Description: "BaseImage are the images this template will use.",
Type: []string{"string"},
Format: "",
},
},
"runtimeImage": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"runtimeArtifacts": {
SchemaProps: spec.SchemaProps{
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Ref: ref("github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1.VolumeSpec"),
},
},
},
},
},
"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: "",
},
},
},
},
},
},
},
},
Dependencies: []string{
"github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1.VolumeSpec"},
}
}
func schema_pkg_apis_devops_v1alpha1_DockerConfig(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
......@@ -517,6 +571,12 @@ func schema_pkg_apis_devops_v1alpha1_DockerConfigEntry(ref common.ReferenceCallb
Format: "",
},
},
"serverAddress": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"username", "password", "email"},
},
......@@ -978,15 +1038,14 @@ func schema_pkg_apis_devops_v1alpha1_S2iBuilderTemplateSpec(ref common.Reference
Format: "",
},
},
"baseImages": {
"containerInfo": {
SchemaProps: spec.SchemaProps{
Description: "BaseImages are the images this template will use.",
Description: "Images are the images this template will use.",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
Ref: ref("github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1.ContainerInfo"),
},
},
},
......@@ -1037,7 +1096,7 @@ func schema_pkg_apis_devops_v1alpha1_S2iBuilderTemplateSpec(ref common.Reference
},
},
Dependencies: []string{
"github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1.Parameter"},
"github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1.ContainerInfo", "github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1.Parameter"},
}
}
......@@ -1470,12 +1529,54 @@ func schema_pkg_apis_devops_v1alpha1_S2iConfig(ref common.ReferenceCallback) com
Format: "",
},
},
"isBinaryURL": {
SchemaProps: spec.SchemaProps{
Description: "IsBinaryURL explain the type of SourceURL. If it is IsBinaryURL, it will download the file directly without using git.",
Type: []string{"boolean"},
Format: "",
},
},
"gitSecretRef": {
SchemaProps: spec.SchemaProps{
Description: "GitSecretRef is the BasicAuth Secret of Git Clone",
Ref: ref("k8s.io/api/core/v1.LocalObjectReference"),
},
},
"revisionId": {
SchemaProps: spec.SchemaProps{
Description: "The RevisionId is a branch name or a SHA-1 hash of every important thing about the commit",
Type: []string{"string"},
Format: "",
},
},
"taintKey": {
SchemaProps: spec.SchemaProps{
Description: "The name of taint.",
Type: []string{"string"},
Format: "",
},
},
"nodeAffinityKey": {
SchemaProps: spec.SchemaProps{
Description: "The key of Node Affinity.",
Type: []string{"string"},
Format: "",
},
},
"nodeAffinityValues": {
SchemaProps: spec.SchemaProps{
Description: "The values of Node Affinity.",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
},
},
},
},
Required: []string{"imageName", "sourceUrl"},
},
......@@ -1611,6 +1712,20 @@ func schema_pkg_apis_devops_v1alpha1_S2iRunSpec(ref common.ReferenceCallback) co
Format: "",
},
},
"newRevisionId": {
SchemaProps: spec.SchemaProps{
Description: "NewRevisionId override the default NewRevisionId in its s2ibuilder.",
Type: []string{"string"},
Format: "",
},
},
"newSourceURL": {
SchemaProps: spec.SchemaProps{
Description: "NewSourceURL is used to download new binary artifacts",
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"builderName"},
},
......@@ -1700,7 +1815,7 @@ func schema_pkg_apis_devops_v1alpha1_UserDefineTemplate(ref common.ReferenceCall
},
},
},
"baseImage": {
"builderImage": {
SchemaProps: spec.SchemaProps{
Description: "BaseImage specify which version of this template to use",
Type: []string{"string"},
......@@ -1722,21 +1837,21 @@ func schema_pkg_apis_devops_v1alpha1_VolumeSpec(ref common.ReferenceCallback) co
Description: "VolumeSpec represents a single volume mount point.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"Source": {
"source": {
SchemaProps: spec.SchemaProps{
Description: "Source is a reference to the volume source.",
Type: []string{"string"},
Format: "",
},
},
"Destination": {
"destination": {
SchemaProps: spec.SchemaProps{
Description: "Destination is the path to mount the volume to - absolute or relative.",
Type: []string{"string"},
Format: "",
},
},
"Keep": {
"keep": {
SchemaProps: spec.SchemaProps{
Description: "Keep indicates if the mounted data should be kept in the final image.",
Type: []string{"boolean"},
......@@ -1744,7 +1859,6 @@ func schema_pkg_apis_devops_v1alpha1_VolumeSpec(ref common.ReferenceCallback) co
},
},
},
Required: []string{"Source", "Destination", "Keep"},
},
},
Dependencies: []string{},
......
......@@ -79,11 +79,11 @@ type CGroupLimits struct {
// VolumeSpec represents a single volume mount point.
type VolumeSpec struct {
// Source is a reference to the volume source.
Source string
Source string `json:"source,omitempty"`
// Destination is the path to mount the volume to - absolute or relative.
Destination string
Destination string `json:"destination,omitempty"`
// Keep indicates if the mounted data should be kept in the final image.
Keep bool
Keep bool `json:"keep,omitempty"`
}
// DockerConfig contains the configuration for a Docker connection.
......@@ -113,7 +113,7 @@ type AuthConfig struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Email string `json:"email,omitempty"`
ServerAddress string `json:"server_address,omitempty"`
ServerAddress string `json:"serverAddress,omitempty"`
SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"`
}
......@@ -395,14 +395,30 @@ type S2iConfig struct {
// AddHost Add a line to /etc/hosts for test purpose or private use in LAN. Its format is host:IP,muliple hosts can be added by using multiple --add-host
AddHost []string `json:"addHost,omitempty"`
//Export Push the result image to specify image registry in tag
// Export Push the result image to specify image registry in tag
Export bool `json:"export,omitempty"`
//SourceURL is url of the codes such as https://github.com/a/b.git
// SourceURL is url of the codes such as https://github.com/a/b.git
SourceURL string `json:"sourceUrl"`
//GitSecretRef is the BasicAuth Secret of Git Clone
// IsBinaryURL explain the type of SourceURL.
// If it is IsBinaryURL, it will download the file directly without using git.
IsBinaryURL bool `json:"isBinaryURL,omitempty"`
// GitSecretRef is the BasicAuth Secret of Git Clone
GitSecretRef *corev1.LocalObjectReference `json:"gitSecretRef,omitempty"`
// The RevisionId is a branch name or a SHA-1 hash of every important thing about the commit
RevisionId string `json:"revisionId,omitempty"`
// The name of taint.
TaintKey string `json:"taintKey,omitempty"`
// The key of Node Affinity.
NodeAffinityKey string `json:"nodeAffinityKey,omitempty"`
// The values of Node Affinity.
NodeAffinityValues []string `json:"nodeAffinityValues,omitempty"`
}
type UserDefineTemplate struct {
......@@ -411,7 +427,7 @@ type UserDefineTemplate struct {
//Parameters must use with `template`, fill some parameters which template will use
Parameters []Parameter `json:"parameters,omitempty"`
//BaseImage specify which version of this template to use
BaseImage string `json:"baseImage,omitempty"`
BuilderImage string `json:"builderImage,omitempty"`
}
// S2iBuilderSpec defines the desired state of S2iBuilder
......@@ -480,9 +496,10 @@ type DockerConfigJson struct {
type DockerConfigMap map[string]DockerConfigEntry
type DockerConfigEntry struct {
Username string `json:"username"`
Password string `json:"password"`
Email string `json:"email"`
Username string `json:"username"`
Password string `json:"password"`
Email string `json:"email"`
ServerAddress string `json:"serverAddress,omitempty"`
}
func init() {
......
......@@ -55,8 +55,8 @@ func (p *Parameter) ToEnvonment() *EnvironmentSpec {
type S2iBuilderTemplateSpec struct {
//DefaultBaseImage is the image that will be used by default
DefaultBaseImage string `json:"defaultBaseImage,omitempty"`
//BaseImages are the images this template will use.
BaseImages []string `json:"baseImages,omitempty"`
//Images are the images this template will use.
ContainerInfo []ContainerInfo `json:"containerInfo,omitempty"`
//CodeFramework means which language this template is designed for and which framework is using if has framework. Like Java, NodeJS etc
CodeFramework CodeFramework `json:"codeFramework,omitempty"`
// Parameters is a set of environment variables to be passed to the image.
......@@ -69,6 +69,16 @@ type S2iBuilderTemplateSpec struct {
IconPath string `json:"iconPath,omitempty"`
}
type ContainerInfo struct {
//BaseImage are the images this template will use.
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
type S2iBuilderTemplateStatus struct {
}
......
......@@ -39,6 +39,10 @@ type S2iRunSpec struct {
SecondsAfterFinished int32 `json:"secondsAfterFinished,omitempty"`
//NewTag override the default tag in its s2ibuilder, image name cannot be changed.
NewTag string `json:"newTag,omitempty"`
//NewRevisionId override the default NewRevisionId in its s2ibuilder.
NewRevisionId string `json:"newRevisionId,omitempty"`
//NewSourceURL is used to download new binary artifacts
NewSourceURL string `json:"newSourceURL,omitempty"`
}
// S2iRunStatus defines the observed state of S2iRun
......
......@@ -89,6 +89,32 @@ func (in *ContainerConfig) DeepCopy() *ContainerConfig {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ContainerInfo) DeepCopyInto(out *ContainerInfo) {
*out = *in
if in.RuntimeArtifacts != nil {
in, out := &in.RuntimeArtifacts, &out.RuntimeArtifacts
*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
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerInfo.
func (in *ContainerInfo) DeepCopy() *ContainerInfo {
if in == nil {
return nil
}
out := new(ContainerInfo)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DockerConfig) DeepCopyInto(out *DockerConfig) {
*out = *in
......@@ -421,10 +447,12 @@ func (in *S2iBuilderTemplateList) DeepCopyObject() runtime.Object {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *S2iBuilderTemplateSpec) DeepCopyInto(out *S2iBuilderTemplateSpec) {
*out = *in
if in.BaseImages != nil {
in, out := &in.BaseImages, &out.BaseImages
*out = make([]string, len(*in))
copy(*out, *in)
if in.ContainerInfo != nil {
in, out := &in.ContainerInfo, &out.ContainerInfo
*out = make([]ContainerInfo, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Parameters != nil {
in, out := &in.Parameters, &out.Parameters
......@@ -547,6 +575,11 @@ func (in *S2iConfig) DeepCopyInto(out *S2iConfig) {
*out = new(v1.LocalObjectReference)
**out = **in
}
if in.NodeAffinityValues != nil {
in, out := &in.NodeAffinityValues, &out.NodeAffinityValues
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
......
......@@ -270,7 +270,7 @@ github.com/kubernetes-sigs/application/pkg/resource
github.com/kubernetes-sigs/application/pkg/genericreconciler
github.com/kubernetes-sigs/application/pkg/kbcontroller
github.com/kubernetes-sigs/application/pkg/client/clientset/versioned/scheme
# github.com/kubesphere/s2ioperator v0.0.11
# github.com/kubesphere/s2ioperator v0.0.12
github.com/kubesphere/s2ioperator/pkg/client/informers/externalversions
github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1
github.com/kubesphere/s2ioperator/pkg/client/clientset/versioned
......@@ -706,8 +706,8 @@ k8s.io/apimachinery/pkg/labels
k8s.io/apimachinery/pkg/runtime/schema
k8s.io/apimachinery/pkg/runtime
k8s.io/apimachinery/pkg/util/runtime
k8s.io/apimachinery/pkg/apis/meta/v1
k8s.io/apimachinery/pkg/api/resource
k8s.io/apimachinery/pkg/apis/meta/v1
k8s.io/apimachinery/pkg/util/intstr
k8s.io/apimachinery/pkg/util/net
k8s.io/apimachinery/pkg/runtime/serializer
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册