未验证 提交 b67d8210 编写于 作者: R runzexia

update s2i version

Signed-off-by: Nrunzexia <runzexia@yunify.com>
上级 e40f03de
......@@ -73,7 +73,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
......@@ -85,7 +85,6 @@ require (
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d // indirect
github.com/onsi/ginkgo v1.8.0
github.com/onsi/gomega v1.5.0
github.com/opencontainers/go-digest v1.0.0-rc1 // indirect
......@@ -139,7 +138,6 @@ require (
k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5 // indirect
sigs.k8s.io/application v0.0.0-20190404151855-67ae7f915d4e
sigs.k8s.io/controller-runtime v0.1.10
sigs.k8s.io/structured-merge-diff v0.0.0-20190426204423-ea680f03cc65 // indirect
sigs.k8s.io/testing_frameworks v0.1.1 // indirect
sigs.k8s.io/yaml v1.1.0 // 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
}
......
......@@ -268,7 +268,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
......@@ -701,8 +701,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.
先完成此消息的编辑!
想要评论请 注册