Auto-update dependencies (#84)

Produced via:
  `dep ensure -update knative.dev/test-infra knative.dev/pkg`
/assign mattmoor
This commit is contained in:
mattmoor-sockpuppet 2019-08-29 07:18:46 -07:00 committed by Knative Prow Robot
parent 7fb04b4264
commit 7760abb064
18 changed files with 1645 additions and 17 deletions

8
Gopkg.lock generated
View File

@ -927,7 +927,7 @@
[[projects]]
branch = "master"
digest = "1:bb5bc945cb10dbe8d011d5b6477576bd72ef6420a1329c5f12e1f5de1db32877"
digest = "1:41481f052bf6423d8d190b1c77f1409535c660decc1ccc284f2a70fe910bc2b7"
name = "knative.dev/pkg"
packages = [
"apis",
@ -946,18 +946,18 @@
"metrics/metricskey",
]
pruneopts = "T"
revision = "9118872a32f620bbf4798b4e6103094f6b7bce6c"
revision = "c1d6e0d59837e7fc5084fb374786dd1f88cf5d88"
[[projects]]
branch = "master"
digest = "1:a68a49f889453ee0abab8d32ceaa19c12a1e86c7919e9cecb3d5ceac6aac199c"
digest = "1:230d4d8a9aa64db75413202a9d1cde3b80bcc417b858093f0fd27c2017bb4955"
name = "knative.dev/test-infra"
packages = [
"scripts",
"tools/dep-collector",
]
pruneopts = "UT"
revision = "5ce07d0fc6603e4cf576f91cdd85dcd74c4d629c"
revision = "89eac9b9bdd8897c246cbd9383e19e3be23146d3"
[solve-meta]
analyzer-name = "dep"

5
vendor/knative.dev/pkg/Gopkg.lock generated vendored
View File

@ -161,9 +161,10 @@
revision = "869f871628b6baa9cfbc11732cdf6546b17c1298"
[[projects]]
digest = "1:f5a98770ab68c1146ee5cc14ed24aafa2bb1a2b3c89cbeadc9eb913b1f9d930a"
digest = "1:f6a318b1ad1b366c91f50dfbdfa7ee27b745b261e56cef7da53a21941f65a2b0"
name = "github.com/golang/protobuf"
packages = [
"jsonpb",
"proto",
"protoc-gen-go/descriptor",
"ptypes",
@ -1275,6 +1276,7 @@
"github.com/evanphx/json-patch",
"github.com/ghodss/yaml",
"github.com/golang/glog",
"github.com/golang/protobuf/jsonpb",
"github.com/golang/protobuf/proto",
"github.com/google/go-cmp/cmp",
"github.com/google/go-cmp/cmp/cmpopts",
@ -1309,6 +1311,7 @@
"golang.org/x/oauth2/google",
"golang.org/x/sync/errgroup",
"google.golang.org/api/container/v1",
"google.golang.org/grpc",
"gopkg.in/yaml.v2",
"k8s.io/api/admission/v1beta1",
"k8s.io/api/admissionregistration/v1beta1",

View File

@ -0,0 +1,97 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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.
*/
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"knative.dev/pkg/apis"
"knative.dev/pkg/apis/duck"
)
// Addressable provides a generic mechanism for a custom resource
// definition to indicate a destination for message delivery.
// Addressable is the schema for the destination information. This is
// typically stored in the object's `status`, as this information may
// be generated by the controller.
type Addressable struct {
URL *apis.URL `json:"url,omitempty"`
}
// Addressable is an Implementable "duck type".
var _ duck.Implementable = (*Addressable)(nil)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// AddressableType is a skeleton type wrapping Addressable in the manner we expect
// resource writers defining compatible resources to embed it. We will
// typically use this type to deserialize Addressable ObjectReferences and
// access the Addressable data. This is not a real resource.
type AddressableType struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Status AddressStatus `json:"status"`
}
// AddressStatus shows how we expect folks to embed Addressable in
// their Status field.
type AddressStatus struct {
Address *Addressable `json:"address,omitempty"`
}
var (
// Verify AddressableType resources meet duck contracts.
_ duck.Populatable = (*AddressableType)(nil)
_ apis.Listable = (*AddressableType)(nil)
)
// GetFullType implements duck.Implementable
func (*Addressable) GetFullType() duck.Populatable {
return &AddressableType{}
}
// Populate implements duck.Populatable
func (t *AddressableType) Populate() {
t.Status = AddressStatus{
&Addressable{
// Populate ALL fields
URL: &apis.URL{
Scheme: "http",
Host: "foo.com",
},
},
}
}
// GetListType implements apis.Listable
func (*AddressableType) GetListType() runtime.Object {
return &AddressableTypeList{}
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// AddressableTypeList is a list of AddressableType resources
type AddressableTypeList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []AddressableType `json:"items"`
}

View File

@ -0,0 +1,23 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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.
*/
// Api versions allow the api contract for a resource to be changed while keeping
// backward compatibility by support multiple concurrent versions
// of the same resource
// +k8s:deepcopy-gen=package
// +groupName=duck.knative.dev
package v1

View File

@ -0,0 +1,55 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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.
*/
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"knative.dev/pkg/apis/duck"
)
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: duck.GroupName, Version: "v1"}
// Kind takes an unqualified kind and returns back a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
return SchemeGroupVersion.WithKind(kind).GroupKind()
}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
var (
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
AddToScheme = SchemeBuilder.AddToScheme
)
// Adds the list of known types to Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(
SchemeGroupVersion,
&KResource{},
(&KResource{}).GetListType(),
&AddressableType{},
(&AddressableType{}).GetListType(),
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}

View File

@ -0,0 +1,157 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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.
*/
package v1
import (
"time"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"knative.dev/pkg/apis"
"knative.dev/pkg/apis/duck"
apisv1alpha1 "knative.dev/pkg/apis/v1alpha1"
)
// Source is an Implementable "duck type".
var _ duck.Implementable = (*Source)(nil)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// Source is the minimum resource shape to adhere to the Source Specification.
// This duck type is intended to allow implementors of Sources and
// Importers to verify their own resources meet the expectations.
// This is not a real resource.
// NOTE: The Source Specification is in progress and the shape and names could
// be modified until it has been accepted.
type Source struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec SourceSpec `json:"spec"`
Status SourceStatus `json:"status"`
}
type SourceSpec struct {
// Sink is a reference to an object that will resolve to a domain name or a
// URI directly to use as the sink.
Sink apisv1alpha1.Destination `json:"sink,omitempty"`
// CloudEventOverrides defines overrides to control the output format and
// modifications of the event sent to the sink.
// +optional
CloudEventOverrides *CloudEventOverrides `json:"ceOverrides,omitempty"`
}
// CloudEventOverrides defines arguments for a Source that control the output
// format of the CloudEvents produced by the Source.
type CloudEventOverrides struct {
// Extensions specify what attribute are added or overridden on the
// outbound event. Each `Extensions` key-value pair are set on the event as
// an attribute extension independently.
// +optional
Extensions map[string]string `json:"extensions,omitempty"`
}
// SourceStatus shows how we expect folks to embed Addressable in
// their Status field.
type SourceStatus struct {
// inherits duck/v1beta1 Status, which currently provides:
// * ObservedGeneration - the 'Generation' of the Service that was last
// processed by the controller.
// * Conditions - the latest available observations of a resource's current
// state.
Status `json:",inline"`
// SinkURI is the current active sink URI that has been configured for the
// Source.
// +optional
SinkURI *apis.URL `json:"sinkUri,omitempty"`
}
// IsReady returns true if the resource is ready overall.
func (ss *SourceStatus) IsReady() bool {
for _, c := range ss.Conditions {
switch c.Type {
// Look for the "happy" condition, which is the only condition that
// we can reliably understand to be the overall state of the resource.
case apis.ConditionReady, apis.ConditionSucceeded:
return c.IsTrue()
}
}
return false
}
var (
// Verify Source resources meet duck contracts.
_ duck.Populatable = (*Source)(nil)
_ apis.Listable = (*Source)(nil)
)
const (
// SourceConditionSinkProvided has status True when the Source
// has been configured with a sink target that is resolvable.
SourceConditionSinkProvided apis.ConditionType = "SinkProvided"
)
// GetFullType implements duck.Implementable
func (*Source) GetFullType() duck.Populatable {
return &Source{}
}
// Populate implements duck.Populatable
func (s *Source) Populate() {
s.Spec.Sink = apisv1alpha1.Destination{
URI: &apis.URL{
Scheme: "https",
Host: "tableflip.dev",
RawQuery: "flip=mattmoor",
},
}
s.Spec.CloudEventOverrides = &CloudEventOverrides{
Extensions: map[string]string{"boosh": "kakow"},
}
s.Status.ObservedGeneration = 42
s.Status.Conditions = Conditions{{
// Populate ALL fields
Type: SourceConditionSinkProvided,
Status: corev1.ConditionTrue,
LastTransitionTime: apis.VolatileTime{Inner: metav1.NewTime(time.Date(1984, 02, 28, 18, 52, 00, 00, time.UTC))},
}}
s.Status.SinkURI = &apis.URL{
Scheme: "https",
Host: "tableflip.dev",
RawQuery: "flip=mattmoor",
}
}
// GetListType implements apis.Listable
func (*Source) GetListType() runtime.Object {
return &SourceList{}
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// SourceList is a list of Source resources
type SourceList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []Source `json:"items"`
}

View File

@ -0,0 +1,141 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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.
*/
package v1
import (
"context"
"time"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"knative.dev/pkg/apis"
"knative.dev/pkg/apis/duck"
)
// Conditions is a simple wrapper around apis.Conditions to implement duck.Implementable.
type Conditions apis.Conditions
// Conditions is an Implementable "duck type".
var _ duck.Implementable = (*Conditions)(nil)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:openapi-gen=true
// KResource is a skeleton type wrapping Conditions in the manner we expect
// resource writers defining compatible resources to embed it. We will
// typically use this type to deserialize Conditions ObjectReferences and
// access the Conditions data. This is not a real resource.
type KResource struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Status Status `json:"status"`
}
// Status shows how we expect folks to embed Conditions in
// their Status field.
// WARNING: Adding fields to this struct will add them to all Knative resources.
type Status struct {
// ObservedGeneration is the 'Generation' of the Service that
// was last processed by the controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Conditions the latest available observations of a resource's current state.
// +optional
// +patchMergeKey=type
// +patchStrategy=merge
Conditions Conditions `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}
var _ apis.ConditionsAccessor = (*Status)(nil)
// GetConditions implements apis.ConditionsAccessor
func (s *Status) GetConditions() apis.Conditions {
return apis.Conditions(s.Conditions)
}
// SetConditions implements apis.ConditionsAccessor
func (s *Status) SetConditions(c apis.Conditions) {
s.Conditions = Conditions(c)
}
// In order for Conditions to be Implementable, KResource must be Populatable.
var _ duck.Populatable = (*KResource)(nil)
// Ensure KResource satisfies apis.Listable
var _ apis.Listable = (*KResource)(nil)
// GetFullType implements duck.Implementable
func (*Conditions) GetFullType() duck.Populatable {
return &KResource{}
}
// GetCondition fetches the condition of the specified type.
func (s *Status) GetCondition(t apis.ConditionType) *apis.Condition {
for _, cond := range s.Conditions {
if cond.Type == t {
return &cond
}
}
return nil
}
// ConvertTo helps implement apis.Convertible for types embedding this Status.
func (source *Status) ConvertTo(ctx context.Context, sink *Status) {
sink.ObservedGeneration = source.ObservedGeneration
for _, c := range source.Conditions {
switch c.Type {
// Copy over the "happy" condition, which is the only condition that
// we can reliably transfer.
case apis.ConditionReady, apis.ConditionSucceeded:
sink.SetConditions(apis.Conditions{c})
return
}
}
}
// Populate implements duck.Populatable
func (t *KResource) Populate() {
t.Status.ObservedGeneration = 42
t.Status.Conditions = Conditions{{
// Populate ALL fields
Type: "Birthday",
Status: corev1.ConditionTrue,
LastTransitionTime: apis.VolatileTime{Inner: metav1.NewTime(time.Date(1984, 02, 28, 18, 52, 00, 00, time.UTC))},
Reason: "Celebrate",
Message: "n3wScott, find your party hat :tada:",
}}
}
// GetListType implements apis.Listable
func (*KResource) GetListType() runtime.Object {
return &KResourceList{}
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// KResourceList is a list of KResource resources
type KResourceList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []KResource `json:"items"`
}

View File

@ -0,0 +1,361 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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.
package v1
import (
runtime "k8s.io/apimachinery/pkg/runtime"
apis "knative.dev/pkg/apis"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AddressStatus) DeepCopyInto(out *AddressStatus) {
*out = *in
if in.Address != nil {
in, out := &in.Address, &out.Address
*out = new(Addressable)
(*in).DeepCopyInto(*out)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddressStatus.
func (in *AddressStatus) DeepCopy() *AddressStatus {
if in == nil {
return nil
}
out := new(AddressStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Addressable) DeepCopyInto(out *Addressable) {
*out = *in
if in.URL != nil {
in, out := &in.URL, &out.URL
*out = new(apis.URL)
(*in).DeepCopyInto(*out)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Addressable.
func (in *Addressable) DeepCopy() *Addressable {
if in == nil {
return nil
}
out := new(Addressable)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AddressableType) DeepCopyInto(out *AddressableType) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddressableType.
func (in *AddressableType) DeepCopy() *AddressableType {
if in == nil {
return nil
}
out := new(AddressableType)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AddressableType) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AddressableTypeList) DeepCopyInto(out *AddressableTypeList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]AddressableType, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddressableTypeList.
func (in *AddressableTypeList) DeepCopy() *AddressableTypeList {
if in == nil {
return nil
}
out := new(AddressableTypeList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AddressableTypeList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CloudEventOverrides) DeepCopyInto(out *CloudEventOverrides) {
*out = *in
if in.Extensions != nil {
in, out := &in.Extensions, &out.Extensions
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudEventOverrides.
func (in *CloudEventOverrides) DeepCopy() *CloudEventOverrides {
if in == nil {
return nil
}
out := new(CloudEventOverrides)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in Conditions) DeepCopyInto(out *Conditions) {
{
in := &in
*out = make(Conditions, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
return
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Conditions.
func (in Conditions) DeepCopy() Conditions {
if in == nil {
return nil
}
out := new(Conditions)
in.DeepCopyInto(out)
return *out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KResource) DeepCopyInto(out *KResource) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KResource.
func (in *KResource) DeepCopy() *KResource {
if in == nil {
return nil
}
out := new(KResource)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *KResource) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KResourceList) DeepCopyInto(out *KResourceList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]KResource, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KResourceList.
func (in *KResourceList) DeepCopy() *KResourceList {
if in == nil {
return nil
}
out := new(KResourceList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *KResourceList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Source) DeepCopyInto(out *Source) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Source.
func (in *Source) DeepCopy() *Source {
if in == nil {
return nil
}
out := new(Source)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Source) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SourceList) DeepCopyInto(out *SourceList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Source, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceList.
func (in *SourceList) DeepCopy() *SourceList {
if in == nil {
return nil
}
out := new(SourceList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *SourceList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SourceSpec) DeepCopyInto(out *SourceSpec) {
*out = *in
in.Sink.DeepCopyInto(&out.Sink)
if in.CloudEventOverrides != nil {
in, out := &in.CloudEventOverrides, &out.CloudEventOverrides
*out = new(CloudEventOverrides)
(*in).DeepCopyInto(*out)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceSpec.
func (in *SourceSpec) DeepCopy() *SourceSpec {
if in == nil {
return nil
}
out := new(SourceSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SourceStatus) DeepCopyInto(out *SourceStatus) {
*out = *in
in.Status.DeepCopyInto(&out.Status)
if in.SinkURI != nil {
in, out := &in.SinkURI, &out.SinkURI
*out = new(apis.URL)
(*in).DeepCopyInto(*out)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceStatus.
func (in *SourceStatus) DeepCopy() *SourceStatus {
if in == nil {
return nil
}
out := new(SourceStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Status) DeepCopyInto(out *Status) {
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make(Conditions, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Status.
func (in *Status) DeepCopy() *Status {
if in == nil {
return nil
}
out := new(Status)
in.DeepCopyInto(out)
return out
}

View File

@ -42,7 +42,7 @@ ${REPO_ROOT_DIR}/hack/generate-knative.sh "injection" \
# Only deepcopy the Duck types, as they are not real resources.
${CODEGEN_PKG}/generate-groups.sh "deepcopy" \
knative.dev/pkg/client knative.dev/pkg/apis \
"duck:v1alpha1,v1beta1" \
"duck:v1alpha1,v1beta1,v1" \
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt
# Depends on generate-groups.sh to install bin/deepcopy-gen

View File

@ -66,7 +66,7 @@ func enrichLoggerWithCommitID(logger *zap.SugaredLogger) *zap.SugaredLogger {
return logger.With(zap.String(logkey.GitHubCommitID, commmitID))
}
logger.Warnf("Fetch GitHub commit ID from kodata failed: %v", err)
logger.Infof("Fetch GitHub commit ID from kodata failed: %v", err)
return logger
}

View File

@ -28,11 +28,11 @@ import (
)
const (
// profilingPort is the port where we expose profiling information if profiling is enabled
profilingPort = ":8008"
// ProfilingPort specifies the port where profiling data is available when profiling is enabled
ProfilingPort = 8008
// profilingKey is the name of the key in config-observability config map that indicates whether profiling
// is enabled of disabled
// profilingKey is the name of the key in config-observability config map
// that indicates whether profiling is enabled
profilingKey = "profiling.enable"
)
@ -104,11 +104,10 @@ func (h *Handler) UpdateFromConfigMap(configMap *corev1.ConfigMap) {
}
}
// NewServer creates a new http server that exposes profiling data using the
// HTTP handler that is passed as an argument
// NewServer creates a new http server that exposes profiling data on the default profiling port
func NewServer(handler http.Handler) *http.Server {
return &http.Server{
Addr: profilingPort,
Addr: ":" + strconv.Itoa(ProfilingPort),
Handler: handler,
}
}

View File

@ -0,0 +1,118 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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.
*/
package main
import (
"context"
"encoding/csv"
"fmt"
"log"
"net"
"os"
"strings"
"github.com/golang/protobuf/jsonpb"
"google.golang.org/grpc"
qspb "knative.dev/pkg/third_party/mako/proto/quickstore_go_proto"
)
const (
port = ":9813"
)
type server struct {
stopCh chan struct{}
}
func (s *server) Store(ctx context.Context, in *qspb.StoreInput) (*qspb.StoreOutput, error) {
m := jsonpb.Marshaler{}
qi, _ := m.MarshalToString(in.GetQuickstoreInput())
fmt.Printf("# %s\n", qi)
cols := []string{"inputValue", "errorMessage"}
writer := csv.NewWriter(os.Stdout)
for _, sp := range in.GetSamplePoints() {
for _, mv := range sp.GetMetricValueList() {
cols = updateCols(cols, mv.GetValueKey())
vals := map[string]string{"inputValue": fmt.Sprintf("%f", sp.GetInputValue())}
vals[mv.GetValueKey()] = fmt.Sprintf("%f", mv.GetValue())
writer.Write(makeRow(cols, vals))
}
}
for _, ra := range in.GetRunAggregates() {
cols = updateCols(cols, ra.GetValueKey())
vals := map[string]string{ra.GetValueKey(): fmt.Sprintf("%f", ra.GetValue())}
writer.Write(makeRow(cols, vals))
}
for _, sa := range in.GetSampleErrors() {
vals := map[string]string{"inputValue": fmt.Sprintf("%f", sa.GetInputValue()), "errorMessage": sa.GetErrorMessage()}
writer.Write(makeRow(cols, vals))
}
writer.Flush()
fmt.Printf("# %s\n", strings.Join(cols, ","))
return &qspb.StoreOutput{}, nil
}
func updateCols(prototype []string, k string) []string {
for _, n := range prototype {
if n == k {
return prototype
}
}
prototype = append(prototype, k)
return prototype
}
func makeRow(prototype []string, points map[string]string) []string {
row := make([]string, len(prototype))
// n^2 but whatever
for k, v := range points {
for i, n := range prototype {
if k == n {
row[i] = v
}
}
}
return row
}
func (s *server) ShutdownMicroservice(ctx context.Context, in *qspb.ShutdownInput) (*qspb.ShutdownOutput, error) {
close(s.stopCh)
return &qspb.ShutdownOutput{}, nil
}
func main() {
lis, err := net.Listen("tcp", port)
if err != nil {
log.Fatalf("failed to listen: %v", err)
}
s := grpc.NewServer()
stopCh := make(chan struct{})
go func() {
qspb.RegisterQuickstoreServer(s, &server{stopCh: stopCh})
if err := s.Serve(lis); err != nil {
log.Fatalf("failed to serve: %v", err)
}
}()
<-stopCh
s.GracefulStop()
}

View File

@ -0,0 +1,204 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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.

View File

@ -0,0 +1,5 @@
This is used by the Mako stub sidecar in test/mako/stub-sidecar. Once that
code is removed, this can also be removed.
It's here because Mako's quickstore service proto is under an internal
directory, and Go refuses to import packages marked internal.

View File

@ -0,0 +1,76 @@
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// 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.
// Microservice wrapping Quickstore
syntax = "proto2";
package mako.internal.quickstore_microservice;
import "proto/quickstore/quickstore.proto";
import "spec/proto/mako.proto";
service Quickstore {
// Stores the inputs into Mako using Quickstore and returns the generated
// output.
rpc Store(StoreInput) returns (StoreOutput) {}
// Shuts down the Quickstore microservice.
rpc ShutdownMicroservice(ShutdownInput) returns (ShutdownOutput) {}
}
// TODO(b/134582028) Use this proto as input to the internal Quickstore library
// instead of a multitude of std::vectors.
message StoreInput {
// REQUIRED
// Specifies the Mako benchmark to which the data is saved.
optional mako.quickstore.QuickstoreInput quickstore_input = 1;
// The SamplePoints holding the data for this test run.
repeated mako.SamplePoint sample_points = 2;
// The SampleErrors holding any errors collected during this test run.
repeated mako.SampleError sample_errors = 3;
// Additional run aggregates that should be stored in Mako.
repeated mako.KeyedValue run_aggregates = 4;
// Additional metric aggregates that should be stored in Mako.
// All aggregate_value_types must be one of:
// * "min"
// * "max"
// * "mean"
// * "median"
// * "standard_deviation"
// * "median_absolute_deviation"
// * "count"
// * a percentile (for instance, "p98000").
// A supplied percentile must correspond to the percentiles set in the
// benchmark.
// If any percentiles are provided, the automatically calculated percentiles
// will be cleared to 0.
// If any aggregate_value_types are set for a value_key, it will overwrite the
// entire MetricAggregate for that value_key. Otherwise, metric aggregates
// will be calculated automatically based on the data in sample_points.
repeated string aggregate_value_keys = 5;
repeated string aggregate_value_types = 6;
repeated double aggregate_value_values = 7;
}
message StoreOutput {
// REQUIRED
// The output generated as a result of using Quickstore.
// Errors are specified by quickstore_output.status, with more details in
// quickstore_output.summary_output.
optional mako.quickstore.QuickstoreOutput quickstore_output = 1;
}
// Empty but unique messages used to allow any future modifications to be
// trivially backwards-compatible.
message ShutdownInput {}
message ShutdownOutput {}

View File

@ -0,0 +1,374 @@
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// 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 protoc-gen-go. DO NOT EDIT.
// source: internal/quickstore_microservice/proto/quickstore.proto
package mako_internal_quickstore_microservice
import (
context "context"
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
quickstore_go_proto "github.com/google/mako/proto/quickstore/quickstore_go_proto"
mako_go_proto "github.com/google/mako/spec/proto/mako_go_proto"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type StoreInput struct {
QuickstoreInput *quickstore_go_proto.QuickstoreInput `protobuf:"bytes,1,opt,name=quickstore_input,json=quickstoreInput" json:"quickstore_input,omitempty"`
SamplePoints []*mako_go_proto.SamplePoint `protobuf:"bytes,2,rep,name=sample_points,json=samplePoints" json:"sample_points,omitempty"`
SampleErrors []*mako_go_proto.SampleError `protobuf:"bytes,3,rep,name=sample_errors,json=sampleErrors" json:"sample_errors,omitempty"`
RunAggregates []*mako_go_proto.KeyedValue `protobuf:"bytes,4,rep,name=run_aggregates,json=runAggregates" json:"run_aggregates,omitempty"`
AggregateValueKeys []string `protobuf:"bytes,5,rep,name=aggregate_value_keys,json=aggregateValueKeys" json:"aggregate_value_keys,omitempty"`
AggregateValueTypes []string `protobuf:"bytes,6,rep,name=aggregate_value_types,json=aggregateValueTypes" json:"aggregate_value_types,omitempty"`
AggregateValueValues []float64 `protobuf:"fixed64,7,rep,name=aggregate_value_values,json=aggregateValueValues" json:"aggregate_value_values,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StoreInput) Reset() { *m = StoreInput{} }
func (m *StoreInput) String() string { return proto.CompactTextString(m) }
func (*StoreInput) ProtoMessage() {}
func (*StoreInput) Descriptor() ([]byte, []int) {
return fileDescriptor_80613028ee3e5eb0, []int{0}
}
func (m *StoreInput) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StoreInput.Unmarshal(m, b)
}
func (m *StoreInput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StoreInput.Marshal(b, m, deterministic)
}
func (m *StoreInput) XXX_Merge(src proto.Message) {
xxx_messageInfo_StoreInput.Merge(m, src)
}
func (m *StoreInput) XXX_Size() int {
return xxx_messageInfo_StoreInput.Size(m)
}
func (m *StoreInput) XXX_DiscardUnknown() {
xxx_messageInfo_StoreInput.DiscardUnknown(m)
}
var xxx_messageInfo_StoreInput proto.InternalMessageInfo
func (m *StoreInput) GetQuickstoreInput() *quickstore_go_proto.QuickstoreInput {
if m != nil {
return m.QuickstoreInput
}
return nil
}
func (m *StoreInput) GetSamplePoints() []*mako_go_proto.SamplePoint {
if m != nil {
return m.SamplePoints
}
return nil
}
func (m *StoreInput) GetSampleErrors() []*mako_go_proto.SampleError {
if m != nil {
return m.SampleErrors
}
return nil
}
func (m *StoreInput) GetRunAggregates() []*mako_go_proto.KeyedValue {
if m != nil {
return m.RunAggregates
}
return nil
}
func (m *StoreInput) GetAggregateValueKeys() []string {
if m != nil {
return m.AggregateValueKeys
}
return nil
}
func (m *StoreInput) GetAggregateValueTypes() []string {
if m != nil {
return m.AggregateValueTypes
}
return nil
}
func (m *StoreInput) GetAggregateValueValues() []float64 {
if m != nil {
return m.AggregateValueValues
}
return nil
}
type StoreOutput struct {
QuickstoreOutput *quickstore_go_proto.QuickstoreOutput `protobuf:"bytes,1,opt,name=quickstore_output,json=quickstoreOutput" json:"quickstore_output,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StoreOutput) Reset() { *m = StoreOutput{} }
func (m *StoreOutput) String() string { return proto.CompactTextString(m) }
func (*StoreOutput) ProtoMessage() {}
func (*StoreOutput) Descriptor() ([]byte, []int) {
return fileDescriptor_80613028ee3e5eb0, []int{1}
}
func (m *StoreOutput) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StoreOutput.Unmarshal(m, b)
}
func (m *StoreOutput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StoreOutput.Marshal(b, m, deterministic)
}
func (m *StoreOutput) XXX_Merge(src proto.Message) {
xxx_messageInfo_StoreOutput.Merge(m, src)
}
func (m *StoreOutput) XXX_Size() int {
return xxx_messageInfo_StoreOutput.Size(m)
}
func (m *StoreOutput) XXX_DiscardUnknown() {
xxx_messageInfo_StoreOutput.DiscardUnknown(m)
}
var xxx_messageInfo_StoreOutput proto.InternalMessageInfo
func (m *StoreOutput) GetQuickstoreOutput() *quickstore_go_proto.QuickstoreOutput {
if m != nil {
return m.QuickstoreOutput
}
return nil
}
type ShutdownInput struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ShutdownInput) Reset() { *m = ShutdownInput{} }
func (m *ShutdownInput) String() string { return proto.CompactTextString(m) }
func (*ShutdownInput) ProtoMessage() {}
func (*ShutdownInput) Descriptor() ([]byte, []int) {
return fileDescriptor_80613028ee3e5eb0, []int{2}
}
func (m *ShutdownInput) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ShutdownInput.Unmarshal(m, b)
}
func (m *ShutdownInput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ShutdownInput.Marshal(b, m, deterministic)
}
func (m *ShutdownInput) XXX_Merge(src proto.Message) {
xxx_messageInfo_ShutdownInput.Merge(m, src)
}
func (m *ShutdownInput) XXX_Size() int {
return xxx_messageInfo_ShutdownInput.Size(m)
}
func (m *ShutdownInput) XXX_DiscardUnknown() {
xxx_messageInfo_ShutdownInput.DiscardUnknown(m)
}
var xxx_messageInfo_ShutdownInput proto.InternalMessageInfo
type ShutdownOutput struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ShutdownOutput) Reset() { *m = ShutdownOutput{} }
func (m *ShutdownOutput) String() string { return proto.CompactTextString(m) }
func (*ShutdownOutput) ProtoMessage() {}
func (*ShutdownOutput) Descriptor() ([]byte, []int) {
return fileDescriptor_80613028ee3e5eb0, []int{3}
}
func (m *ShutdownOutput) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ShutdownOutput.Unmarshal(m, b)
}
func (m *ShutdownOutput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ShutdownOutput.Marshal(b, m, deterministic)
}
func (m *ShutdownOutput) XXX_Merge(src proto.Message) {
xxx_messageInfo_ShutdownOutput.Merge(m, src)
}
func (m *ShutdownOutput) XXX_Size() int {
return xxx_messageInfo_ShutdownOutput.Size(m)
}
func (m *ShutdownOutput) XXX_DiscardUnknown() {
xxx_messageInfo_ShutdownOutput.DiscardUnknown(m)
}
var xxx_messageInfo_ShutdownOutput proto.InternalMessageInfo
func init() {
proto.RegisterType((*StoreInput)(nil), "mako.internal.quickstore_microservice.StoreInput")
proto.RegisterType((*StoreOutput)(nil), "mako.internal.quickstore_microservice.StoreOutput")
proto.RegisterType((*ShutdownInput)(nil), "mako.internal.quickstore_microservice.ShutdownInput")
proto.RegisterType((*ShutdownOutput)(nil), "mako.internal.quickstore_microservice.ShutdownOutput")
}
func init() {
proto.RegisterFile("internal/quickstore_microservice/proto/quickstore.proto", fileDescriptor_80613028ee3e5eb0)
}
var fileDescriptor_80613028ee3e5eb0 = []byte{
// 408 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xcd, 0x8e, 0xda, 0x30,
0x14, 0x85, 0x1b, 0x52, 0x5a, 0xf5, 0x52, 0xfe, 0x5c, 0xa8, 0xa2, 0xac, 0x42, 0xa4, 0x4a, 0x59,
0x85, 0x36, 0xa2, 0x65, 0xdd, 0x45, 0x17, 0x15, 0xea, 0x5f, 0xa8, 0xba, 0xab, 0xa2, 0x28, 0x58,
0x4c, 0x04, 0xc4, 0xc1, 0x76, 0x18, 0xe5, 0x01, 0x66, 0x1e, 0x63, 0x9e, 0x75, 0x94, 0x1b, 0x12,
0x0c, 0x68, 0x46, 0xb0, 0xb1, 0xec, 0x7b, 0xee, 0x77, 0x7c, 0x93, 0x63, 0x98, 0xc6, 0x89, 0xa4,
0x3c, 0x09, 0xd7, 0xe3, 0x6d, 0x16, 0x47, 0x2b, 0x21, 0x19, 0xa7, 0xc1, 0x26, 0x8e, 0x38, 0x13,
0x94, 0xef, 0xe2, 0x88, 0x8e, 0x53, 0xce, 0x24, 0x53, 0x54, 0x17, 0x0b, 0xe4, 0xc3, 0x26, 0x5c,
0x31, 0xb7, 0xa2, 0xdd, 0x27, 0x68, 0x73, 0x74, 0x8a, 0x9f, 0x39, 0x99, 0x43, 0x91, 0xd2, 0x68,
0x7f, 0x0d, 0x9a, 0xe2, 0xd6, 0x7e, 0xd0, 0x01, 0xe6, 0x45, 0xdb, 0xf7, 0x24, 0xcd, 0x24, 0x99,
0x41, 0x4f, 0xb9, 0x23, 0x2e, 0x6a, 0x86, 0x66, 0x69, 0x4e, 0xcb, 0xb3, 0x5c, 0xa4, 0x14, 0xdf,
0x3f, 0xf5, 0x16, 0x59, 0xbf, 0xbb, 0x3d, 0x2e, 0x90, 0x2f, 0xd0, 0x16, 0xe1, 0x26, 0x5d, 0xd3,
0x20, 0x65, 0x71, 0x22, 0x85, 0xd1, 0xb0, 0x74, 0xa7, 0xe5, 0xf5, 0x4b, 0xa7, 0x39, 0x4a, 0xbf,
0x0b, 0xc5, 0x7f, 0x2b, 0x0e, 0x07, 0xa1, 0x70, 0x94, 0x73, 0xc6, 0x85, 0xa1, 0x9f, 0x73, 0xdf,
0x0a, 0xa5, 0xe2, 0xf0, 0x20, 0xc8, 0x14, 0x3a, 0x3c, 0x4b, 0x82, 0x70, 0xb9, 0xe4, 0x74, 0x19,
0x4a, 0x2a, 0x8c, 0x97, 0x08, 0xf6, 0x4a, 0x70, 0x46, 0x73, 0xba, 0xf8, 0x17, 0xae, 0x33, 0xea,
0xb7, 0x79, 0x96, 0x7c, 0xad, 0xdb, 0xc8, 0x47, 0x18, 0xd4, 0x50, 0xb0, 0x2b, 0x3a, 0x82, 0x15,
0xcd, 0x85, 0xd1, 0xb4, 0x74, 0xe7, 0x8d, 0x4f, 0x6a, 0x0d, 0xe1, 0x19, 0xcd, 0x05, 0xf1, 0x60,
0x78, 0x4a, 0xc8, 0x3c, 0xa5, 0xc2, 0x78, 0x85, 0xc8, 0xbb, 0x63, 0xe4, 0x6f, 0x21, 0x91, 0x09,
0xbc, 0x3f, 0x65, 0x70, 0x15, 0xc6, 0x6b, 0x4b, 0x77, 0x34, 0x7f, 0x70, 0x0c, 0xe1, 0x22, 0xec,
0xff, 0xd0, 0xc2, 0x7c, 0x7e, 0x65, 0xb2, 0xf8, 0xa7, 0x3f, 0xa1, 0xaf, 0x04, 0xc4, 0xb0, 0xb8,
0x4f, 0x68, 0xf4, 0x4c, 0x42, 0x25, 0xed, 0x2b, 0xe1, 0x96, 0x15, 0xbb, 0x0b, 0xed, 0xf9, 0x4d,
0x26, 0x17, 0xec, 0x36, 0xc1, 0xd0, 0xec, 0x1e, 0x74, 0xaa, 0x42, 0xd9, 0xe2, 0xdd, 0x37, 0x00,
0x0e, 0x4e, 0x24, 0x85, 0x26, 0x0e, 0x44, 0x3e, 0xb9, 0x17, 0x3d, 0x4e, 0xf7, 0xf0, 0xbc, 0x4c,
0xef, 0x1a, 0x64, 0x3f, 0xe1, 0x0b, 0x72, 0xa7, 0xc1, 0xa0, 0x9a, 0xe9, 0x87, 0xd2, 0x46, 0x26,
0x97, 0xda, 0xa9, 0x5f, 0x68, 0x7e, 0xbe, 0x92, 0xaa, 0xe6, 0x78, 0x0c, 0x00, 0x00, 0xff, 0xff,
0xe2, 0xb4, 0xaf, 0x68, 0xc6, 0x03, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// QuickstoreClient is the client API for Quickstore service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type QuickstoreClient interface {
Store(ctx context.Context, in *StoreInput, opts ...grpc.CallOption) (*StoreOutput, error)
ShutdownMicroservice(ctx context.Context, in *ShutdownInput, opts ...grpc.CallOption) (*ShutdownOutput, error)
}
type quickstoreClient struct {
cc *grpc.ClientConn
}
func NewQuickstoreClient(cc *grpc.ClientConn) QuickstoreClient {
return &quickstoreClient{cc}
}
func (c *quickstoreClient) Store(ctx context.Context, in *StoreInput, opts ...grpc.CallOption) (*StoreOutput, error) {
out := new(StoreOutput)
err := c.cc.Invoke(ctx, "/mako.internal.quickstore_microservice.Quickstore/Store", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *quickstoreClient) ShutdownMicroservice(ctx context.Context, in *ShutdownInput, opts ...grpc.CallOption) (*ShutdownOutput, error) {
out := new(ShutdownOutput)
err := c.cc.Invoke(ctx, "/mako.internal.quickstore_microservice.Quickstore/ShutdownMicroservice", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// QuickstoreServer is the server API for Quickstore service.
type QuickstoreServer interface {
Store(context.Context, *StoreInput) (*StoreOutput, error)
ShutdownMicroservice(context.Context, *ShutdownInput) (*ShutdownOutput, error)
}
func RegisterQuickstoreServer(s *grpc.Server, srv QuickstoreServer) {
s.RegisterService(&_Quickstore_serviceDesc, srv)
}
func _Quickstore_Store_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StoreInput)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QuickstoreServer).Store(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/mako.internal.quickstore_microservice.Quickstore/Store",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QuickstoreServer).Store(ctx, req.(*StoreInput))
}
return interceptor(ctx, in, info, handler)
}
func _Quickstore_ShutdownMicroservice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ShutdownInput)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QuickstoreServer).ShutdownMicroservice(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/mako.internal.quickstore_microservice.Quickstore/ShutdownMicroservice",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QuickstoreServer).ShutdownMicroservice(ctx, req.(*ShutdownInput))
}
return interceptor(ctx, in, info, handler)
}
var _Quickstore_serviceDesc = grpc.ServiceDesc{
ServiceName: "mako.internal.quickstore_microservice.Quickstore",
HandlerType: (*QuickstoreServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Store",
Handler: _Quickstore_Store_Handler,
},
{
MethodName: "ShutdownMicroservice",
Handler: _Quickstore_ShutdownMicroservice_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "internal/quickstore_microservice/proto/quickstore.proto",
}

View File

@ -124,7 +124,8 @@ func WithExporter(name string, logger *zap.SugaredLogger) ConfigOption {
}
exporter = exp
case config.Zipkin:
zipEP, err := zipkin.NewEndpoint(name, ":80")
hostPort := name + ":80"
zipEP, err := zipkin.NewEndpoint(name, hostPort)
if err != nil {
logger.Errorw("error building zipkin endpoint", zap.Error(err))
return

View File

@ -311,12 +311,26 @@ function capture_output() {
return ${failed}
}
# Create a temporary file with the given extension in a way that works on both Linux and macOS.
# Parameters: $1 - file name without extension (e.g. 'myfile_XXXX')
# $2 - file extension (e.g. 'xml')
function mktemp_with_extension() {
local nameprefix
local fullname
nameprefix="$(mktemp $1)"
fullname="${nameprefix}.$2"
mv ${nameprefix} ${fullname}
echo ${fullname}
}
# Create a JUnit XML for a test.
# Parameters: $1 - check class name as an identifier (e.g. BuildTests)
# $2 - check name as an identifier (e.g., GoBuild)
# $3 - failure message (can contain newlines), optional (means success)
function create_junit_xml() {
local xml="$(mktemp ${ARTIFACTS}/junit_XXXXXXXX.xml)"
local xml="$(mktemp_with_extension ${ARTIFACTS}/junit_XXXXXXXX xml)"
local failure=""
if [[ "$3" != "" ]]; then
# Transform newlines into HTML code.
@ -352,7 +366,7 @@ function report_go_test() {
echo "Finished run, return code is ${failed}"
# Install go-junit-report if necessary.
run_go_tool github.com/jstemmer/go-junit-report go-junit-report --help > /dev/null 2>&1
local xml=$(mktemp ${ARTIFACTS}/junit_XXXXXXXX.xml)
local xml="$(mktemp_with_extension ${ARTIFACTS}/junit_XXXXXXXX xml)"
cat ${report} \
| go-junit-report \
| sed -e "s#\"\(github\.com/knative\|knative\.dev\)/${REPO_NAME}/#\"#g" \