Drop unreleased features (record & replay) (#1406)
1. The records are stored in redis which is not migratable to another cluster for the testing purposes. 2. Some of the requests fields are not recorded. 3. People should consider using https://github.com/buger/goreplay which is an existing mature and well-tested solution for testing purposes.
This commit is contained in:
@@ -56,10 +56,6 @@ func (c *CanaryConfig) GetObjectKind() schema.ObjectKind {
|
||||
return &c.TypeMeta
|
||||
}
|
||||
|
||||
func (r *Recorder) GetObjectKind() schema.ObjectKind {
|
||||
return &r.TypeMeta
|
||||
}
|
||||
|
||||
func (f *Function) GetObjectMeta() metav1.Object {
|
||||
return &f.Metadata
|
||||
}
|
||||
@@ -85,10 +81,6 @@ func (c *CanaryConfig) GetObjectMeta() metav1.Object {
|
||||
return &c.Metadata
|
||||
}
|
||||
|
||||
func (r *Recorder) GetObjectMeta() metav1.Object {
|
||||
return &r.Metadata
|
||||
}
|
||||
|
||||
func (fl *FunctionList) GetObjectKind() schema.ObjectKind {
|
||||
return &fl.TypeMeta
|
||||
}
|
||||
@@ -110,9 +102,6 @@ func (ml *MessageQueueTriggerList) GetObjectKind() schema.ObjectKind {
|
||||
func (pl *PackageList) GetObjectKind() schema.ObjectKind {
|
||||
return &pl.TypeMeta
|
||||
}
|
||||
func (rl *RecorderList) GetObjectKind() schema.ObjectKind {
|
||||
return &rl.TypeMeta
|
||||
}
|
||||
|
||||
func (cl *CanaryConfigList) GetObjectKind() schema.ObjectKind {
|
||||
return &cl.TypeMeta
|
||||
@@ -140,10 +129,6 @@ func (pl *PackageList) GetListMeta() metav1.ListInterface {
|
||||
return &pl.Metadata
|
||||
}
|
||||
|
||||
func (rl *RecorderList) GetListMeta() metav1.ListInterface {
|
||||
return &rl.Metadata
|
||||
}
|
||||
|
||||
func (cl *CanaryConfigList) GetListMeta() metav1.ListInterface {
|
||||
return &cl.Metadata
|
||||
}
|
||||
@@ -279,13 +264,3 @@ func (ml *MessageQueueTriggerList) Validate() error {
|
||||
}
|
||||
return result.ErrorOrNil()
|
||||
}
|
||||
|
||||
func (r *Recorder) Validate() error {
|
||||
result := &multierror.Error{}
|
||||
|
||||
result = multierror.Append(result,
|
||||
validateMetadata("Recorder", r.Metadata),
|
||||
r.Spec.Validate())
|
||||
|
||||
return result.ErrorOrNil()
|
||||
}
|
||||
|
||||
@@ -157,23 +157,6 @@ type (
|
||||
Items []MessageQueueTrigger `json:"items"`
|
||||
}
|
||||
|
||||
// Recorder allows user to record all traffic payload to a certain function.
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
Recorder struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
Metadata metav1.ObjectMeta `json:"metadata"`
|
||||
Spec RecorderSpec `json:"spec"`
|
||||
}
|
||||
|
||||
// RecorderList is a list of Recorders.
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
RecorderList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
Metadata metav1.ListMeta `json:"metadata"`
|
||||
|
||||
Items []Recorder `json:"items"`
|
||||
}
|
||||
|
||||
// CanaryConfig is for canary deployment of two functions.
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
CanaryConfig struct {
|
||||
@@ -642,22 +625,6 @@ type (
|
||||
ContentType string `json:"contentType"`
|
||||
}
|
||||
|
||||
// RecorderSpec defines a policy for recording requests and responses
|
||||
// to a function, that can be later inspected or replayed.
|
||||
RecorderSpec struct {
|
||||
// Name of recorder resource
|
||||
Name string `json:"name"`
|
||||
|
||||
// Function to collect requests/responses
|
||||
Function string `json:"function"`
|
||||
|
||||
// HTTP trigger to record the requests and responses.
|
||||
Triggers []string `json:"triggers"`
|
||||
RetentionPolicy string `json:"-"` // `json:"retentionPolicy"`
|
||||
EvictionPolicy string `json:"-"` // `json:"evictionPolicy"`
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
// TimeTrigger invokes the specific function at a time or
|
||||
// times specified by a cron string.
|
||||
TimeTriggerSpec struct {
|
||||
|
||||
@@ -544,33 +544,6 @@ func (spec MessageQueueTriggerSpec) Validate() error {
|
||||
return result.ErrorOrNil()
|
||||
}
|
||||
|
||||
func (spec RecorderSpec) Validate() error {
|
||||
result := &multierror.Error{}
|
||||
|
||||
// TODO: Function validation
|
||||
//if len(spec.Function.Name) != 0 {
|
||||
// result = multierror.Append(result, spec.Function.Validate())
|
||||
//}
|
||||
|
||||
// TODO: Triggers validation
|
||||
//for _, trigger := range spec.Triggers {
|
||||
// result = multierror.Append(result, trigger.Validate())
|
||||
//}
|
||||
|
||||
if len(spec.Name) == 0 {
|
||||
result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "RecorderSpec.Name", spec.Name, "not a valid name"))
|
||||
}
|
||||
//if len(spec.RetentionPolicy) == 0 {
|
||||
// result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "RecorderSpec.RetentionPolicy", spec.Name, "not a valid retention policy"))
|
||||
//}
|
||||
//if len(spec.EvictionPolicy) == 0 {
|
||||
// result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "RecorderSpec.EvictionPolicy", spec.Name, "not a valid eviction policy"))
|
||||
//}
|
||||
|
||||
//log.Info("This is the RecorderSpec validation result: %v", result)
|
||||
return result.ErrorOrNil()
|
||||
}
|
||||
|
||||
func (spec TimeTriggerSpec) Validate() error {
|
||||
result := &multierror.Error{}
|
||||
|
||||
|
||||
@@ -801,87 +801,6 @@ func (in *PackageStatus) DeepCopy() *PackageStatus {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Recorder) DeepCopyInto(out *Recorder) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.Metadata.DeepCopyInto(&out.Metadata)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Recorder.
|
||||
func (in *Recorder) DeepCopy() *Recorder {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Recorder)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *Recorder) 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 *RecorderList) DeepCopyInto(out *RecorderList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.Metadata = in.Metadata
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Recorder, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecorderList.
|
||||
func (in *RecorderList) DeepCopy() *RecorderList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RecorderList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *RecorderList) 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 *RecorderSpec) DeepCopyInto(out *RecorderSpec) {
|
||||
*out = *in
|
||||
if in.Triggers != nil {
|
||||
in, out := &in.Triggers, &out.Triggers
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecorderSpec.
|
||||
func (in *RecorderSpec) DeepCopy() *RecorderSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RecorderSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Runtime) DeepCopyInto(out *Runtime) {
|
||||
*out = *in
|
||||
|
||||
Reference in New Issue
Block a user