From 4b738830965fe75f1d2d1262b03bfdfd93d77474 Mon Sep 17 00:00:00 2001 From: runzexia Date: Mon, 25 Mar 2019 16:43:32 +0800 Subject: [PATCH] update s2i to v0.0.7 --- Gopkg.toml | 2 +- .../apis/devops/v1alpha1/s2ibuilder_types.go | 36 +++++-- .../devops/v1alpha1/zz_generated.deepcopy.go | 98 ++++++++++++++++++- 3 files changed, 122 insertions(+), 14 deletions(-) diff --git a/Gopkg.toml b/Gopkg.toml index 7322e0653..b9c34c429 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -57,7 +57,7 @@ required = [ [[constraint]] name="github.com/kubesphere/s2ioperator" - version="v0.0.4" + version="v0.0.7" [[override]] name="github.com/bifurcation/mint" diff --git a/vendor/github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1/s2ibuilder_types.go b/vendor/github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1/s2ibuilder_types.go index 7133c145b..676f3a629 100644 --- a/vendor/github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1/s2ibuilder_types.go +++ b/vendor/github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1/s2ibuilder_types.go @@ -19,6 +19,7 @@ package v1alpha1 import ( "fmt" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -101,10 +102,11 @@ type DockerConfig struct { // AuthConfig is our abstraction of the Registry authorization information for whatever // docker client we happen to be based on type AuthConfig struct { - Username string `json:"username"` - Password string `json:"password"` - Email string `json:"email,omitempty"` - ServerAddress string `json:"server_address,omitempty"` + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` + Email string `json:"email,omitempty"` + ServerAddress string `json:"server_address,omitempty"` + SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"` } // ContainerConfig is the abstraction of the docker client provider (formerly go-dockerclient, now either @@ -229,7 +231,7 @@ type S2iConfig struct { // RuntimeAuthentication holds the authentication information for pulling the // runtime Docker images from private repositories. - RuntimeAuthentication AuthConfig `json:"runtimeAuthentication,omitempty"` + RuntimeAuthentication *AuthConfig `json:"runtimeAuthentication,omitempty"` // RuntimeArtifacts specifies a list of source/destination pairs that will // be copied from builder to a runtime image. Source can be a file or @@ -246,15 +248,15 @@ type S2iConfig struct { // PullAuthentication holds the authentication information for pulling the // Docker images from private repositories - PullAuthentication AuthConfig `json:"pullAuthentication,omitempty"` + PullAuthentication *AuthConfig `json:"pullAuthentication,omitempty"` // PullAuthentication holds the authentication information for pulling the // Docker images from private repositories - PushAuthentication AuthConfig `json:"pushAuthentication,omitempty"` + PushAuthentication *AuthConfig `json:"pushAuthentication,omitempty"` // IncrementalAuthentication holds the authentication information for pulling the // previous image from private repositories - IncrementalAuthentication AuthConfig `json:"incrementalAuthentication,omitempty"` + IncrementalAuthentication *AuthConfig `json:"incrementalAuthentication,omitempty"` // DockerNetworkMode is used to set the docker network setting to --net=container: // when the builder is invoked from a container. @@ -390,6 +392,9 @@ type S2iConfig struct { //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 + GitSecretRef *corev1.LocalObjectReference `json:"gitSecretRef,omitempty"` } type UserDefineTemplate struct { @@ -454,6 +459,21 @@ type S2iAutoScale struct { Containers []string `json:"containers,omitempty"` } +type DockerConfigJson struct { + Auths DockerConfigMap `json:"auths"` +} + +// DockerConfig represents the config file used by the docker CLI. +// This config that represents the credentials that should be used +// when pulling images from specific image repositories. +type DockerConfigMap map[string]DockerConfigEntry + +type DockerConfigEntry struct { + Username string `json:"username"` + Password string `json:"password"` + Email string `json:"email"` +} + func init() { SchemeBuilder.Register(&S2iBuilder{}, &S2iBuilderList{}) } diff --git a/vendor/github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1/zz_generated.deepcopy.go index 96b10aef1..fe4d7aa2b 100644 --- a/vendor/github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/kubesphere/s2ioperator/pkg/apis/devops/v1alpha1/zz_generated.deepcopy.go @@ -15,17 +15,23 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by deepcopy-gen. DO NOT EDIT. +// Code generated by main. DO NOT EDIT. package v1alpha1 import ( + v1 "k8s.io/api/core/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AuthConfig) DeepCopyInto(out *AuthConfig) { *out = *in + if in.SecretRef != nil { + in, out := &in.SecretRef, &out.SecretRef + *out = new(v1.LocalObjectReference) + **out = **in + } return } @@ -99,6 +105,67 @@ func (in *DockerConfig) DeepCopy() *DockerConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerConfigEntry) DeepCopyInto(out *DockerConfigEntry) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerConfigEntry. +func (in *DockerConfigEntry) DeepCopy() *DockerConfigEntry { + if in == nil { + return nil + } + out := new(DockerConfigEntry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DockerConfigJson) DeepCopyInto(out *DockerConfigJson) { + *out = *in + if in.Auths != nil { + in, out := &in.Auths, &out.Auths + *out = make(DockerConfigMap, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerConfigJson. +func (in *DockerConfigJson) DeepCopy() *DockerConfigJson { + if in == nil { + return nil + } + out := new(DockerConfigJson) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in DockerConfigMap) DeepCopyInto(out *DockerConfigMap) { + { + in := &in + *out = make(DockerConfigMap, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerConfigMap. +func (in DockerConfigMap) DeepCopy() DockerConfigMap { + if in == nil { + return nil + } + out := new(DockerConfigMap) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EnvironmentSpec) DeepCopyInto(out *EnvironmentSpec) { *out = *in @@ -394,7 +461,11 @@ func (in *S2iBuilderTemplateStatus) DeepCopy() *S2iBuilderTemplateStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *S2iConfig) DeepCopyInto(out *S2iConfig) { *out = *in - out.RuntimeAuthentication = in.RuntimeAuthentication + if in.RuntimeAuthentication != nil { + in, out := &in.RuntimeAuthentication, &out.RuntimeAuthentication + *out = new(AuthConfig) + (*in).DeepCopyInto(*out) + } if in.RuntimeArtifacts != nil { in, out := &in.RuntimeArtifacts, &out.RuntimeArtifacts *out = make([]VolumeSpec, len(*in)) @@ -405,9 +476,21 @@ func (in *S2iConfig) DeepCopyInto(out *S2iConfig) { *out = new(DockerConfig) **out = **in } - out.PullAuthentication = in.PullAuthentication - out.PushAuthentication = in.PushAuthentication - out.IncrementalAuthentication = in.IncrementalAuthentication + if in.PullAuthentication != nil { + in, out := &in.PullAuthentication, &out.PullAuthentication + *out = new(AuthConfig) + (*in).DeepCopyInto(*out) + } + if in.PushAuthentication != nil { + in, out := &in.PushAuthentication, &out.PushAuthentication + *out = new(AuthConfig) + (*in).DeepCopyInto(*out) + } + if in.IncrementalAuthentication != nil { + in, out := &in.IncrementalAuthentication, &out.IncrementalAuthentication + *out = new(AuthConfig) + (*in).DeepCopyInto(*out) + } if in.Environment != nil { in, out := &in.Environment, &out.Environment *out = make([]EnvironmentSpec, len(*in)) @@ -455,6 +538,11 @@ func (in *S2iConfig) DeepCopyInto(out *S2iConfig) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.GitSecretRef != nil { + in, out := &in.GitSecretRef, &out.GitSecretRef + *out = new(v1.LocalObjectReference) + **out = **in + } return }