diff --git a/Makefile b/Makefile index 37e920c0..1819f5b7 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) BASEIMAGE_PROD ?= gcr.io/distroless/static BASEIMAGE_DBG ?= debian:stretch -GO_VERSION ?= 1.13.5 +GO_VERSION ?= 1.14.3 BUILD_IMAGE ?= appscode/golang-dev:$(GO_VERSION) OUTBIN = bin/$(OS)_$(ARCH)/$(BIN) diff --git a/api/v1/generated.pb.go b/api/v1/generated.pb.go index 6725650d..c2f52a7b 100644 --- a/api/v1/generated.pb.go +++ b/api/v1/generated.pb.go @@ -71,10 +71,38 @@ func (m *FormEntry) XXX_DiscardUnknown() { var xxx_messageInfo_FormEntry proto.InternalMessageInfo +func (m *HTTPHeader) Reset() { *m = HTTPHeader{} } +func (*HTTPHeader) ProtoMessage() {} +func (*HTTPHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_90c9649438138bbb, []int{1} +} +func (m *HTTPHeader) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HTTPHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *HTTPHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPHeader.Merge(m, src) +} +func (m *HTTPHeader) XXX_Size() int { + return m.Size() +} +func (m *HTTPHeader) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_HTTPHeader proto.InternalMessageInfo + func (m *HTTPPostAction) Reset() { *m = HTTPPostAction{} } func (*HTTPPostAction) ProtoMessage() {} func (*HTTPPostAction) Descriptor() ([]byte, []int) { - return fileDescriptor_90c9649438138bbb, []int{1} + return fileDescriptor_90c9649438138bbb, []int{2} } func (m *HTTPPostAction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -102,7 +130,7 @@ var xxx_messageInfo_HTTPPostAction proto.InternalMessageInfo func (m *Handler) Reset() { *m = Handler{} } func (*Handler) ProtoMessage() {} func (*Handler) Descriptor() ([]byte, []int) { - return fileDescriptor_90c9649438138bbb, []int{2} + return fileDescriptor_90c9649438138bbb, []int{3} } func (m *Handler) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -129,6 +157,7 @@ var xxx_messageInfo_Handler proto.InternalMessageInfo func init() { proto.RegisterType((*FormEntry)(nil), "kmodules.xyz.prober.api.v1.FormEntry") + proto.RegisterType((*HTTPHeader)(nil), "kmodules.xyz.prober.api.v1.HTTPHeader") proto.RegisterType((*HTTPPostAction)(nil), "kmodules.xyz.prober.api.v1.HTTPPostAction") proto.RegisterType((*Handler)(nil), "kmodules.xyz.prober.api.v1.Handler") } @@ -138,47 +167,51 @@ func init() { } var fileDescriptor_90c9649438138bbb = []byte{ - // 629 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xc1, 0x6e, 0xd3, 0x4a, - 0x14, 0x8d, 0x93, 0x34, 0x69, 0xc6, 0xed, 0x5b, 0xcc, 0x13, 0x92, 0x15, 0x81, 0x1d, 0x82, 0x90, - 0xa2, 0x4a, 0x8c, 0x49, 0xd8, 0x20, 0xc1, 0x06, 0x57, 0x6d, 0x53, 0x21, 0x95, 0x68, 0x9a, 0xb2, - 0x60, 0xe7, 0x38, 0x53, 0xdb, 0x4a, 0xec, 0xb1, 0xc6, 0x93, 0xa8, 0x66, 0xc5, 0x27, 0xf0, 0x2d, - 0x7c, 0x45, 0x97, 0x5d, 0x76, 0x65, 0x51, 0xf3, 0x0f, 0x2c, 0x58, 0xa1, 0x19, 0x3b, 0x8d, 0x03, - 0x0d, 0x3b, 0xcf, 0xb9, 0xe7, 0x9e, 0xeb, 0x73, 0xcf, 0x05, 0x07, 0xb3, 0x80, 0x4e, 0x17, 0x73, - 0x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0x71, 0x74, 0x45, 0x9c, 0x3c, - 0x5b, 0x6b, 0x57, 0x28, 0x89, 0x37, 0x96, 0x5d, 0x70, 0x08, 0x9a, 0xc2, 0xc3, 0x09, 0x59, 0x85, - 0xf9, 0x74, 0xdb, 0x1e, 0x4e, 0x48, 0x71, 0x1f, 0x96, 0x9a, 0xa5, 0x46, 0xb3, 0x80, 0xf0, 0xaa, - 0x1d, 0x8e, 0xc1, 0xae, 0xf8, 0x1c, 0xad, 0x32, 0x54, 0x07, 0x07, 0xff, 0x32, 0xb8, 0x79, 0x73, - 0xd6, 0x5e, 0x96, 0x1a, 0xbb, 0x2b, 0x0c, 0xdf, 0x2b, 0xc1, 0x11, 0x68, 0x71, 0x27, 0x3a, 0xa7, - 0xce, 0x8c, 0x70, 0x19, 0xbb, 0x3a, 0x78, 0xf6, 0xd0, 0x1f, 0x8e, 0x0f, 0x47, 0x39, 0xa9, 0xd0, - 0xdb, 0xcf, 0x52, 0xa3, 0x75, 0x0f, 0xe2, 0xb5, 0x08, 0x7c, 0x03, 0xf6, 0x1d, 0x1a, 0x72, 0x5b, - 0x5c, 0xe9, 0x99, 0x1d, 0x10, 0x6d, 0x47, 0xe6, 0xf5, 0xa8, 0x58, 0xf3, 0xfe, 0x61, 0xb9, 0x88, - 0x37, 0xb9, 0x56, 0xef, 0xfa, 0x4e, 0xaf, 0xdc, 0xdc, 0xe9, 0x95, 0xdb, 0x3b, 0xbd, 0xf2, 0x25, - 0xd3, 0x95, 0xeb, 0x4c, 0x57, 0x6e, 0x32, 0x5d, 0xb9, 0xcd, 0x74, 0xe5, 0x7b, 0xa6, 0x2b, 0x5f, - 0x7f, 0xe8, 0x95, 0x4f, 0xd5, 0x65, 0xff, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5a, 0x1b, 0x69, - 0xfc, 0x78, 0x04, 0x00, 0x00, + // 704 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0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0x4a, 0xd4, 0x87, 0xdb, + 0x08, 0xc4, 0xce, 0xc7, 0x24, 0xf5, 0x89, 0xa9, 0xc6, 0x51, 0xa3, 0x92, 0x86, 0xf0, 0xaa, 0x1c, + 0x0e, 0xc1, 0x8e, 0xf8, 0xec, 0xaf, 0xb4, 0x54, 0xbb, 0xfb, 0xff, 0x3a, 0x6d, 0xe6, 0x3d, 0x73, + 0x37, 0x8e, 0x1a, 0x3b, 0xab, 0x18, 0x5e, 0x33, 0xc1, 0x3e, 0xa8, 0x72, 0xdb, 0x1f, 0x50, 0x7b, + 0x46, 0xb8, 0x94, 0x5f, 0xed, 0xee, 0x6d, 0x9b, 0x70, 0x78, 0xd0, 0x4f, 0x40, 0x29, 0x9f, 0x34, + 0xfe, 0x3a, 0x88, 0x33, 0x12, 0xf8, 0x02, 0xd4, 0x6c, 0xea, 0x71, 0x4b, 0xb8, 0x55, 0xfc, 0x83, + 0x5a, 0x49, 0xea, 0x75, 0x2f, 0x3d, 0x73, 0xed, 0x60, 0x33, 0x89, 0x6f, 0x63, 0xcd, 0xf6, 0xe5, + 0x8d, 0x9e, 0xbb, 0xba, 0xd1, 0x73, 0xd7, 0x37, 0x7a, 0xee, 0x53, 0xac, 0x2b, 0x97, 0xb1, 0xae, + 0x5c, 0xc5, 0xba, 0x72, 0x1d, 0xeb, 0xca, 0xb7, 0x58, 0x57, 0x3e, 0x7f, 0xd7, 0x73, 0xef, 0xf3, + 0xcb, 0xce, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x96, 0xd8, 0x0c, 0x25, 0x05, 0x00, 0x00, } func (m *FormEntry) Marshal() (dAtA []byte, err error) { @@ -218,6 +251,51 @@ func (m *FormEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *HTTPHeader) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HTTPHeader) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ValueFrom != nil { + { + size, err := m.ValueFrom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *HTTPPostAction) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -403,6 +481,23 @@ func (m *FormEntry) Size() (n int) { return n } +func (m *HTTPHeader) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Value) + n += 1 + l + sovGenerated(uint64(l)) + if m.ValueFrom != nil { + l = m.ValueFrom.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + func (m *HTTPPostAction) Size() (n int) { if m == nil { return 0 @@ -478,13 +573,25 @@ func (this *FormEntry) String() string { }, "") return s } +func (this *HTTPHeader) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&HTTPHeader{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `ValueFrom:` + strings.Replace(fmt.Sprintf("%v", this.ValueFrom), "EnvVarSource", "v1.EnvVarSource", 1) + `,`, + `}`, + }, "") + return s +} func (this *HTTPPostAction) String() string { if this == nil { return "nil" } repeatedStringForHTTPHeaders := "[]HTTPHeader{" for _, f := range this.HTTPHeaders { - repeatedStringForHTTPHeaders += fmt.Sprintf("%v", f) + "," + repeatedStringForHTTPHeaders += strings.Replace(strings.Replace(f.String(), "HTTPHeader", "HTTPHeader", 1), `&`, ``, 1) + "," } repeatedStringForHTTPHeaders += "}" repeatedStringForForm := "[]FormEntry{" @@ -643,6 +750,159 @@ func (m *FormEntry) Unmarshal(dAtA []byte) error { } return nil } +func (m *HTTPHeader) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HTTPHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HTTPHeader: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValueFrom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValueFrom == nil { + m.ValueFrom = &v1.EnvVarSource{} + } + if err := m.ValueFrom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *HTTPPostAction) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -830,7 +1090,7 @@ func (m *HTTPPostAction) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.HTTPHeaders = append(m.HTTPHeaders, v1.HTTPHeader{}) + m.HTTPHeaders = append(m.HTTPHeaders, HTTPHeader{}) if err := m.HTTPHeaders[len(m.HTTPHeaders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/api/v1/generated.proto b/api/v1/generated.proto index 8a5648e6..248dbfd5 100644 --- a/api/v1/generated.proto +++ b/api/v1/generated.proto @@ -33,6 +33,19 @@ message FormEntry { repeated string values = 2; } +// HTTPHeader describes a custom header to be used in HTTP probes +message HTTPHeader { + // The header field name + optional string name = 1; + + // The header field value + optional string value = 2; + + // Source for the header field's value. Cannot be used if value is not empty. + // +optional + optional k8s.io.api.core.v1.EnvVarSource valueFrom = 3; +} + // HTTPPostAction describes an action based on HTTP Post requests. message HTTPPostAction { // Path to access on the HTTP server. @@ -56,7 +69,7 @@ message HTTPPostAction { // Custom headers to set in the request. HTTP allows repeated headers. // +optional - repeated k8s.io.api.core.v1.HTTPHeader httpHeaders = 5; + repeated HTTPHeader httpHeaders = 5; // Body to set in the request. // +optional diff --git a/api/v1/openapi_generated.go b/api/v1/openapi_generated.go index 423a4d2f..8597f4ea 100644 --- a/api/v1/openapi_generated.go +++ b/api/v1/openapi_generated.go @@ -30,6 +30,7 @@ import ( func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { return map[string]common.OpenAPIDefinition{ "kmodules.xyz/prober/api/v1.FormEntry": schema_kmodulesxyz_prober_api_v1_FormEntry(ref), + "kmodules.xyz/prober/api/v1.HTTPHeader": schema_kmodulesxyz_prober_api_v1_HTTPHeader(ref), "kmodules.xyz/prober/api/v1.HTTPPostAction": schema_kmodulesxyz_prober_api_v1_HTTPPostAction(ref), "kmodules.xyz/prober/api/v1.Handler": schema_kmodulesxyz_prober_api_v1_Handler(ref), } @@ -66,6 +67,42 @@ func schema_kmodulesxyz_prober_api_v1_FormEntry(ref common.ReferenceCallback) co } } +func schema_kmodulesxyz_prober_api_v1_HTTPHeader(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "HTTPHeader describes a custom header to be used in HTTP probes", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "The header field name", + Type: []string{"string"}, + Format: "", + }, + }, + "value": { + SchemaProps: spec.SchemaProps{ + Description: "The header field value", + Type: []string{"string"}, + Format: "", + }, + }, + "valueFrom": { + SchemaProps: spec.SchemaProps{ + Description: "Source for the header field's value. Cannot be used if value is not empty.", + Ref: ref("k8s.io/api/core/v1.EnvVarSource"), + }, + }, + }, + Required: []string{"name"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.EnvVarSource"}, + } +} + func schema_kmodulesxyz_prober_api_v1_HTTPPostAction(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -107,7 +144,7 @@ func schema_kmodulesxyz_prober_api_v1_HTTPPostAction(ref common.ReferenceCallbac Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.HTTPHeader"), + Ref: ref("kmodules.xyz/prober/api/v1.HTTPHeader"), }, }, }, @@ -138,7 +175,7 @@ func schema_kmodulesxyz_prober_api_v1_HTTPPostAction(ref common.ReferenceCallbac }, }, Dependencies: []string{ - "k8s.io/api/core/v1.HTTPHeader", "k8s.io/apimachinery/pkg/util/intstr.IntOrString", "kmodules.xyz/prober/api/v1.FormEntry"}, + "k8s.io/apimachinery/pkg/util/intstr.IntOrString", "kmodules.xyz/prober/api/v1.FormEntry", "kmodules.xyz/prober/api/v1.HTTPHeader"}, } } diff --git a/api/v1/types.go b/api/v1/types.go index d832c4c3..831d5d9e 100644 --- a/api/v1/types.go +++ b/api/v1/types.go @@ -64,7 +64,7 @@ type HTTPPostAction struct { Scheme core.URIScheme `json:"scheme,omitempty" protobuf:"bytes,4,opt,name=scheme,casttype=k8s.io/api/core/v1.URIScheme"` // Custom headers to set in the request. HTTP allows repeated headers. // +optional - HTTPHeaders []core.HTTPHeader `json:"httpHeaders,omitempty" protobuf:"bytes,5,rep,name=httpHeaders"` + HTTPHeaders []HTTPHeader `json:"httpHeaders,omitempty" protobuf:"bytes,5,rep,name=httpHeaders"` // Body to set in the request. // +optional Body string `json:"body,omitempty" protobuf:"bytes,6,opt,name=body"` @@ -77,3 +77,14 @@ type FormEntry struct { Key string `json:"key,omitempty" protobuf:"bytes,1,rep,name=key"` Values []string `json:"values,omitempty" protobuf:"bytes,2,rep,name=values"` } + +// HTTPHeader describes a custom header to be used in HTTP probes +type HTTPHeader struct { + // The header field name + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + // The header field value + Value string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"` + // Source for the header field's value. Cannot be used if value is not empty. + // +optional + ValueFrom *core.EnvVarSource `json:"valueFrom,omitempty" protobuf:"bytes,3,opt,name=valueFrom"` +} diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index bd7d3de2..73433eab 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -45,14 +45,37 @@ func (in *FormEntry) DeepCopy() *FormEntry { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPHeader) DeepCopyInto(out *HTTPHeader) { + *out = *in + if in.ValueFrom != nil { + in, out := &in.ValueFrom, &out.ValueFrom + *out = new(corev1.EnvVarSource) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPHeader. +func (in *HTTPHeader) DeepCopy() *HTTPHeader { + if in == nil { + return nil + } + out := new(HTTPHeader) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HTTPPostAction) DeepCopyInto(out *HTTPPostAction) { *out = *in out.Port = in.Port if in.HTTPHeaders != nil { in, out := &in.HTTPHeaders, &out.HTTPHeaders - *out = make([]corev1.HTTPHeader, len(*in)) - copy(*out, *in) + *out = make([]HTTPHeader, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } if in.Form != nil { in, out := &in.Form, &out.Form diff --git a/go.mod b/go.mod index 4d0a4953..0e1c5ef5 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module kmodules.xyz/prober go 1.12 require ( - github.com/appscode/go v0.0.0-20191119085241-0887d8ec2ecc + github.com/appscode/go v0.0.0-20200323182826-54e98e09185a github.com/gabriel-vasile/mimetype v0.3.22 github.com/go-openapi/spec v0.19.2 github.com/go-openapi/swag v0.19.4 // indirect @@ -17,7 +17,7 @@ require ( k8s.io/client-go v12.0.0+incompatible k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf k8s.io/utils v0.0.0-20190801114015-581e00157fb1 - kmodules.xyz/client-go v0.0.0-20191211192817-f1dcd02124ba + kmodules.xyz/client-go v0.0.0-20200518125232-435dcc370844 ) replace ( diff --git a/go.sum b/go.sum index 9c9ae917..2ed69f31 100644 --- a/go.sum +++ b/go.sum @@ -18,6 +18,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/appscode/go v0.0.0-20191119085241-0887d8ec2ecc h1:Q5jwbRq/a1Tien+Is8Zn6HMBRgE13+UOQ9mTvrIuvuE= github.com/appscode/go v0.0.0-20191119085241-0887d8ec2ecc/go.mod h1:OawnOmAL4ZX3YaPdN+8HTNwBveT1jMsqP74moa9XUbE= +github.com/appscode/go v0.0.0-20200323182826-54e98e09185a h1:cZ80NKoLRaW1PVCWXAJE+YFkBAmLZ8BnrJmH0ClY1Gs= +github.com/appscode/go v0.0.0-20200323182826-54e98e09185a/go.mod h1:lIcm8Z6VPuvcw/a3EeOWcG6R3I13iHMLYbtVP7TKufY= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= @@ -381,8 +383,8 @@ k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf h1:EYm5AW/UUDbnmnI+gK0TJD k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/utils v0.0.0-20190801114015-581e00157fb1 h1:+ySTxfHnfzZb9ys375PXNlLhkJPLKgHajBU0N62BDvE= k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -kmodules.xyz/client-go v0.0.0-20191211192817-f1dcd02124ba h1:167+cDonVeZSmfbterebD6SofCnpjaiDS9St2RGhRug= -kmodules.xyz/client-go v0.0.0-20191211192817-f1dcd02124ba/go.mod h1:OFxuKCiVR+MYlR2a08FkfaF+IbXkLe0xBetu2LTUuGI= +kmodules.xyz/client-go v0.0.0-20200518125232-435dcc370844 h1:+g4XBo2szMo3/uPlUrEJjOwyEgv4NRAu0YSlDQOLFDw= +kmodules.xyz/client-go v0.0.0-20200518125232-435dcc370844/go.mod h1:z/AkrES60XR+jeKGg5zJyPd13NdG/Di0BptbG1gnS60= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= diff --git a/vendor/modules.txt b/vendor/modules.txt index 1aa77911..52fc0fa2 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -2,7 +2,7 @@ github.com/PuerkitoBio/purell # github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 github.com/PuerkitoBio/urlesc -# github.com/appscode/go v0.0.0-20191119085241-0887d8ec2ecc +# github.com/appscode/go v0.0.0-20200323182826-54e98e09185a github.com/appscode/go/context github.com/appscode/go/log # github.com/davecgh/go-spew v1.1.1 @@ -244,7 +244,7 @@ k8s.io/kube-openapi/pkg/common # k8s.io/utils v0.0.0-20190801114015-581e00157fb1 => k8s.io/utils v0.0.0-20190801114015-581e00157fb1 k8s.io/utils/integer k8s.io/utils/io -# kmodules.xyz/client-go v0.0.0-20191211192817-f1dcd02124ba +# kmodules.xyz/client-go v0.0.0-20200518125232-435dcc370844 kmodules.xyz/client-go/tools/exec # sigs.k8s.io/yaml v1.1.0 => sigs.k8s.io/yaml v1.1.0 sigs.k8s.io/yaml