From e03353bd895b2e87d61b665599340f4aface8d90 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Sat, 2 May 2020 17:20:21 -0700 Subject: [PATCH 01/38] go-swagger paasta api --- Makefile | 12 + .../client/autoscaler/autoscaler_client.go | 108 ++ .../get_autoscaler_count_parameters.go | 156 ++ .../get_autoscaler_count_responses.go | 154 ++ .../update_autoscaler_count_parameters.go | 173 ++ .../update_autoscaler_count_responses.go | 192 ++ .../marathon_dashboard_client.go | 72 + .../marathon_dashboard_parameters.go | 112 ++ .../marathon_dashboard_responses.go | 67 + ...ete_service_autoscaler_pause_parameters.go | 112 ++ ...lete_service_autoscaler_pause_responses.go | 81 + .../operations/deploy_queue_parameters.go | 112 ++ .../operations/deploy_queue_responses.go | 69 + ...get_service_autoscaler_pause_parameters.go | 112 ++ .../get_service_autoscaler_pause_responses.go | 92 + .../operations/metastatus_parameters.go | 139 ++ .../client/operations/metastatus_responses.go | 96 + .../client/operations/operations_client.go | 252 +++ .../operations/show_version_parameters.go | 112 ++ .../operations/show_version_responses.go | 65 + ...ate_service_autoscaler_pause_parameters.go | 131 ++ ...date_service_autoscaler_pause_responses.go | 114 ++ pkg/paasta_api/client/paasta_client.go | 132 ++ .../client/resources/resources_client.go | 72 + .../client/resources/resources_parameters.go | 163 ++ .../client/resources/resources_responses.go | 94 + .../service/delay_instance_parameters.go | 156 ++ .../service/delay_instance_responses.go | 148 ++ .../service/instance_set_state_parameters.go | 177 ++ .../service/instance_set_state_responses.go | 108 ++ .../service/list_instances_parameters.go | 135 ++ .../service/list_instances_responses.go | 100 + .../list_services_for_cluster_parameters.go | 112 ++ .../list_services_for_cluster_responses.go | 100 + .../client/service/service_client.go | 289 +++ .../service/status_instance_parameters.go | 285 +++ .../service/status_instance_responses.go | 123 ++ .../service/task_instance_parameters.go | 210 ++ .../client/service/task_instance_responses.go | 148 ++ .../service/tasks_instance_parameters.go | 221 +++ .../service/tasks_instance_responses.go | 148 ++ pkg/paasta_api/models/adhoc_launch_history.go | 49 + pkg/paasta_api/models/deploy_queue.go | 112 ++ .../models/deploy_queue_service_instance.go | 67 + pkg/paasta_api/models/envoy_backend.go | 58 + pkg/paasta_api/models/envoy_location.go | 89 + pkg/paasta_api/models/envoy_status.go | 86 + pkg/paasta_api/models/float_and_error.go | 46 + pkg/paasta_api/models/h_p_a_metric.go | 49 + pkg/paasta_api/models/instance_delay.go | 11 + .../models/instance_metadata_flink.go | 11 + .../models/instance_metadata_kafka_cluster.go | 11 + .../models/instance_spec_kafka_cluster.go | 11 + pkg/paasta_api/models/instance_status.go | 300 +++ .../models/instance_status_adhoc.go | 45 + .../models/instance_status_flink.go | 11 + .../models/instance_status_kafka_cluster.go | 11 + .../models/instance_status_kubernetes.go | 456 +++++ .../models/instance_status_marathon.go | 390 ++++ pkg/paasta_api/models/instance_status_tron.go | 108 ++ pkg/paasta_api/models/instance_task.go | 11 + pkg/paasta_api/models/instance_tasks.go | 20 + pkg/paasta_api/models/integer_and_error.go | 46 + pkg/paasta_api/models/kubernetes_container.go | 74 + pkg/paasta_api/models/kubernetes_pod.go | 101 + .../models/kubernetes_replica_set.go | 52 + pkg/paasta_api/models/marathon_app_status.go | 107 ++ .../models/marathon_autoscaling_info.go | 55 + pkg/paasta_api/models/marathon_dashboard.go | 42 + .../models/marathon_dashboard_cluster.go | 45 + .../models/marathon_dashboard_item.go | 49 + .../models/marathon_mesos_nonrunning_task.go | 83 + .../models/marathon_mesos_running_task.go | 183 ++ .../models/marathon_mesos_status.go | 118 ++ pkg/paasta_api/models/marathon_task.go | 55 + pkg/paasta_api/models/meta_status.go | 46 + pkg/paasta_api/models/resource.go | 45 + pkg/paasta_api/models/resource_item.go | 124 ++ pkg/paasta_api/models/resource_value.go | 49 + pkg/paasta_api/models/smartstack_backend.go | 64 + pkg/paasta_api/models/smartstack_location.go | 86 + pkg/paasta_api/models/smartstack_status.go | 86 + pkg/paasta_api/models/task_tail_lines.go | 49 + swagger.json | 1682 +++++++++++++++++ 84 files changed, 10647 insertions(+) create mode 100644 pkg/paasta_api/client/autoscaler/autoscaler_client.go create mode 100644 pkg/paasta_api/client/autoscaler/get_autoscaler_count_parameters.go create mode 100644 pkg/paasta_api/client/autoscaler/get_autoscaler_count_responses.go create mode 100644 pkg/paasta_api/client/autoscaler/update_autoscaler_count_parameters.go create mode 100644 pkg/paasta_api/client/autoscaler/update_autoscaler_count_responses.go create mode 100644 pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_client.go create mode 100644 pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_parameters.go create mode 100644 pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_responses.go create mode 100644 pkg/paasta_api/client/operations/delete_service_autoscaler_pause_parameters.go create mode 100644 pkg/paasta_api/client/operations/delete_service_autoscaler_pause_responses.go create mode 100644 pkg/paasta_api/client/operations/deploy_queue_parameters.go create mode 100644 pkg/paasta_api/client/operations/deploy_queue_responses.go create mode 100644 pkg/paasta_api/client/operations/get_service_autoscaler_pause_parameters.go create mode 100644 pkg/paasta_api/client/operations/get_service_autoscaler_pause_responses.go create mode 100644 pkg/paasta_api/client/operations/metastatus_parameters.go create mode 100644 pkg/paasta_api/client/operations/metastatus_responses.go create mode 100644 pkg/paasta_api/client/operations/operations_client.go create mode 100644 pkg/paasta_api/client/operations/show_version_parameters.go create mode 100644 pkg/paasta_api/client/operations/show_version_responses.go create mode 100644 pkg/paasta_api/client/operations/update_service_autoscaler_pause_parameters.go create mode 100644 pkg/paasta_api/client/operations/update_service_autoscaler_pause_responses.go create mode 100644 pkg/paasta_api/client/paasta_client.go create mode 100644 pkg/paasta_api/client/resources/resources_client.go create mode 100644 pkg/paasta_api/client/resources/resources_parameters.go create mode 100644 pkg/paasta_api/client/resources/resources_responses.go create mode 100644 pkg/paasta_api/client/service/delay_instance_parameters.go create mode 100644 pkg/paasta_api/client/service/delay_instance_responses.go create mode 100644 pkg/paasta_api/client/service/instance_set_state_parameters.go create mode 100644 pkg/paasta_api/client/service/instance_set_state_responses.go create mode 100644 pkg/paasta_api/client/service/list_instances_parameters.go create mode 100644 pkg/paasta_api/client/service/list_instances_responses.go create mode 100644 pkg/paasta_api/client/service/list_services_for_cluster_parameters.go create mode 100644 pkg/paasta_api/client/service/list_services_for_cluster_responses.go create mode 100644 pkg/paasta_api/client/service/service_client.go create mode 100644 pkg/paasta_api/client/service/status_instance_parameters.go create mode 100644 pkg/paasta_api/client/service/status_instance_responses.go create mode 100644 pkg/paasta_api/client/service/task_instance_parameters.go create mode 100644 pkg/paasta_api/client/service/task_instance_responses.go create mode 100644 pkg/paasta_api/client/service/tasks_instance_parameters.go create mode 100644 pkg/paasta_api/client/service/tasks_instance_responses.go create mode 100644 pkg/paasta_api/models/adhoc_launch_history.go create mode 100644 pkg/paasta_api/models/deploy_queue.go create mode 100644 pkg/paasta_api/models/deploy_queue_service_instance.go create mode 100644 pkg/paasta_api/models/envoy_backend.go create mode 100644 pkg/paasta_api/models/envoy_location.go create mode 100644 pkg/paasta_api/models/envoy_status.go create mode 100644 pkg/paasta_api/models/float_and_error.go create mode 100644 pkg/paasta_api/models/h_p_a_metric.go create mode 100644 pkg/paasta_api/models/instance_delay.go create mode 100644 pkg/paasta_api/models/instance_metadata_flink.go create mode 100644 pkg/paasta_api/models/instance_metadata_kafka_cluster.go create mode 100644 pkg/paasta_api/models/instance_spec_kafka_cluster.go create mode 100644 pkg/paasta_api/models/instance_status.go create mode 100644 pkg/paasta_api/models/instance_status_adhoc.go create mode 100644 pkg/paasta_api/models/instance_status_flink.go create mode 100644 pkg/paasta_api/models/instance_status_kafka_cluster.go create mode 100644 pkg/paasta_api/models/instance_status_kubernetes.go create mode 100644 pkg/paasta_api/models/instance_status_marathon.go create mode 100644 pkg/paasta_api/models/instance_status_tron.go create mode 100644 pkg/paasta_api/models/instance_task.go create mode 100644 pkg/paasta_api/models/instance_tasks.go create mode 100644 pkg/paasta_api/models/integer_and_error.go create mode 100644 pkg/paasta_api/models/kubernetes_container.go create mode 100644 pkg/paasta_api/models/kubernetes_pod.go create mode 100644 pkg/paasta_api/models/kubernetes_replica_set.go create mode 100644 pkg/paasta_api/models/marathon_app_status.go create mode 100644 pkg/paasta_api/models/marathon_autoscaling_info.go create mode 100644 pkg/paasta_api/models/marathon_dashboard.go create mode 100644 pkg/paasta_api/models/marathon_dashboard_cluster.go create mode 100644 pkg/paasta_api/models/marathon_dashboard_item.go create mode 100644 pkg/paasta_api/models/marathon_mesos_nonrunning_task.go create mode 100644 pkg/paasta_api/models/marathon_mesos_running_task.go create mode 100644 pkg/paasta_api/models/marathon_mesos_status.go create mode 100644 pkg/paasta_api/models/marathon_task.go create mode 100644 pkg/paasta_api/models/meta_status.go create mode 100644 pkg/paasta_api/models/resource.go create mode 100644 pkg/paasta_api/models/resource_item.go create mode 100644 pkg/paasta_api/models/resource_value.go create mode 100644 pkg/paasta_api/models/smartstack_backend.go create mode 100644 pkg/paasta_api/models/smartstack_location.go create mode 100644 pkg/paasta_api/models/smartstack_status.go create mode 100644 pkg/paasta_api/models/task_tail_lines.go create mode 100644 swagger.json diff --git a/Makefile b/Makefile index 39281a6..1f3642c 100644 --- a/Makefile +++ b/Makefile @@ -45,3 +45,15 @@ deb_%: clean docker_build_% itest_%: deb_% @echo "Built package for $*" + +gen-paasta-api: + rm -rf pkg/paasta_api/* + curl -o swagger.json https://raw.githubusercontent.com/Yelp/paasta/master/paasta_tools/api/api_docs/swagger.json + docker run \ + --rm -it \ + --user "$$(id -u):$$(id -g)" \ + -e GOPATH=$$HOME/go:/go \ + -v $$HOME:$$HOME \ + -w $$(pwd) quay.io/goswagger/swagger \ + generate client -f ./swagger.json -t pkg/paasta_api + @echo "Do not forget to `git add` and `git commit` updated swagger.json and paasta-api" diff --git a/pkg/paasta_api/client/autoscaler/autoscaler_client.go b/pkg/paasta_api/client/autoscaler/autoscaler_client.go new file mode 100644 index 0000000..723b895 --- /dev/null +++ b/pkg/paasta_api/client/autoscaler/autoscaler_client.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package autoscaler + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new autoscaler API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for autoscaler API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetAutoscalerCount(params *GetAutoscalerCountParams) (*GetAutoscalerCountOK, error) + + UpdateAutoscalerCount(params *UpdateAutoscalerCountParams) (*UpdateAutoscalerCountAccepted, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAutoscalerCount gets status of service name instance name +*/ +func (a *Client) GetAutoscalerCount(params *GetAutoscalerCountParams) (*GetAutoscalerCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAutoscalerCountParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "get_autoscaler_count", + Method: "GET", + PathPattern: "/services/{service}/{instance}/autoscaler", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetAutoscalerCountReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetAutoscalerCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for get_autoscaler_count: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UpdateAutoscalerCount gets status of service name instance name +*/ +func (a *Client) UpdateAutoscalerCount(params *UpdateAutoscalerCountParams) (*UpdateAutoscalerCountAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateAutoscalerCountParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "update_autoscaler_count", + Method: "POST", + PathPattern: "/services/{service}/{instance}/autoscaler", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateAutoscalerCountReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateAutoscalerCountAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for update_autoscaler_count: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/paasta_api/client/autoscaler/get_autoscaler_count_parameters.go b/pkg/paasta_api/client/autoscaler/get_autoscaler_count_parameters.go new file mode 100644 index 0000000..df8c045 --- /dev/null +++ b/pkg/paasta_api/client/autoscaler/get_autoscaler_count_parameters.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package autoscaler + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetAutoscalerCountParams creates a new GetAutoscalerCountParams object +// with the default values initialized. +func NewGetAutoscalerCountParams() *GetAutoscalerCountParams { + var () + return &GetAutoscalerCountParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAutoscalerCountParamsWithTimeout creates a new GetAutoscalerCountParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAutoscalerCountParamsWithTimeout(timeout time.Duration) *GetAutoscalerCountParams { + var () + return &GetAutoscalerCountParams{ + + timeout: timeout, + } +} + +// NewGetAutoscalerCountParamsWithContext creates a new GetAutoscalerCountParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAutoscalerCountParamsWithContext(ctx context.Context) *GetAutoscalerCountParams { + var () + return &GetAutoscalerCountParams{ + + Context: ctx, + } +} + +// NewGetAutoscalerCountParamsWithHTTPClient creates a new GetAutoscalerCountParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAutoscalerCountParamsWithHTTPClient(client *http.Client) *GetAutoscalerCountParams { + var () + return &GetAutoscalerCountParams{ + HTTPClient: client, + } +} + +/*GetAutoscalerCountParams contains all the parameters to send to the API endpoint +for the get autoscaler count operation typically these are written to a http.Request +*/ +type GetAutoscalerCountParams struct { + + /*Instance + Instance name + + */ + Instance string + /*Service + Service name + + */ + Service string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get autoscaler count params +func (o *GetAutoscalerCountParams) WithTimeout(timeout time.Duration) *GetAutoscalerCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get autoscaler count params +func (o *GetAutoscalerCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get autoscaler count params +func (o *GetAutoscalerCountParams) WithContext(ctx context.Context) *GetAutoscalerCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get autoscaler count params +func (o *GetAutoscalerCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get autoscaler count params +func (o *GetAutoscalerCountParams) WithHTTPClient(client *http.Client) *GetAutoscalerCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get autoscaler count params +func (o *GetAutoscalerCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInstance adds the instance to the get autoscaler count params +func (o *GetAutoscalerCountParams) WithInstance(instance string) *GetAutoscalerCountParams { + o.SetInstance(instance) + return o +} + +// SetInstance adds the instance to the get autoscaler count params +func (o *GetAutoscalerCountParams) SetInstance(instance string) { + o.Instance = instance +} + +// WithService adds the service to the get autoscaler count params +func (o *GetAutoscalerCountParams) WithService(service string) *GetAutoscalerCountParams { + o.SetService(service) + return o +} + +// SetService adds the service to the get autoscaler count params +func (o *GetAutoscalerCountParams) SetService(service string) { + o.Service = service +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAutoscalerCountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param instance + if err := r.SetPathParam("instance", o.Instance); err != nil { + return err + } + + // path param service + if err := r.SetPathParam("service", o.Service); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/client/autoscaler/get_autoscaler_count_responses.go b/pkg/paasta_api/client/autoscaler/get_autoscaler_count_responses.go new file mode 100644 index 0000000..3530321 --- /dev/null +++ b/pkg/paasta_api/client/autoscaler/get_autoscaler_count_responses.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package autoscaler + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetAutoscalerCountReader is a Reader for the GetAutoscalerCount structure. +type GetAutoscalerCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAutoscalerCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAutoscalerCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetAutoscalerCountNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetAutoscalerCountInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetAutoscalerCountOK creates a GetAutoscalerCountOK with default headers values +func NewGetAutoscalerCountOK() *GetAutoscalerCountOK { + return &GetAutoscalerCountOK{} +} + +/*GetAutoscalerCountOK handles this case with default header values. + +Get desired instance count for a service instance +*/ +type GetAutoscalerCountOK struct { + Payload *GetAutoscalerCountOKBody +} + +func (o *GetAutoscalerCountOK) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/autoscaler][%d] getAutoscalerCountOK %+v", 200, o.Payload) +} + +func (o *GetAutoscalerCountOK) GetPayload() *GetAutoscalerCountOKBody { + return o.Payload +} + +func (o *GetAutoscalerCountOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(GetAutoscalerCountOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAutoscalerCountNotFound creates a GetAutoscalerCountNotFound with default headers values +func NewGetAutoscalerCountNotFound() *GetAutoscalerCountNotFound { + return &GetAutoscalerCountNotFound{} +} + +/*GetAutoscalerCountNotFound handles this case with default header values. + +Deployment key not found +*/ +type GetAutoscalerCountNotFound struct { +} + +func (o *GetAutoscalerCountNotFound) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/autoscaler][%d] getAutoscalerCountNotFound ", 404) +} + +func (o *GetAutoscalerCountNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGetAutoscalerCountInternalServerError creates a GetAutoscalerCountInternalServerError with default headers values +func NewGetAutoscalerCountInternalServerError() *GetAutoscalerCountInternalServerError { + return &GetAutoscalerCountInternalServerError{} +} + +/*GetAutoscalerCountInternalServerError handles this case with default header values. + +Instance failure +*/ +type GetAutoscalerCountInternalServerError struct { +} + +func (o *GetAutoscalerCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/autoscaler][%d] getAutoscalerCountInternalServerError ", 500) +} + +func (o *GetAutoscalerCountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +/*GetAutoscalerCountOKBody get autoscaler count o k body +swagger:model GetAutoscalerCountOKBody +*/ +type GetAutoscalerCountOKBody struct { + + // desired instances + DesiredInstances int64 `json:"desired_instances,omitempty"` +} + +// Validate validates this get autoscaler count o k body +func (o *GetAutoscalerCountOKBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetAutoscalerCountOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetAutoscalerCountOKBody) UnmarshalBinary(b []byte) error { + var res GetAutoscalerCountOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/pkg/paasta_api/client/autoscaler/update_autoscaler_count_parameters.go b/pkg/paasta_api/client/autoscaler/update_autoscaler_count_parameters.go new file mode 100644 index 0000000..4e4e1dc --- /dev/null +++ b/pkg/paasta_api/client/autoscaler/update_autoscaler_count_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package autoscaler + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateAutoscalerCountParams creates a new UpdateAutoscalerCountParams object +// with the default values initialized. +func NewUpdateAutoscalerCountParams() *UpdateAutoscalerCountParams { + var () + return &UpdateAutoscalerCountParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateAutoscalerCountParamsWithTimeout creates a new UpdateAutoscalerCountParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewUpdateAutoscalerCountParamsWithTimeout(timeout time.Duration) *UpdateAutoscalerCountParams { + var () + return &UpdateAutoscalerCountParams{ + + timeout: timeout, + } +} + +// NewUpdateAutoscalerCountParamsWithContext creates a new UpdateAutoscalerCountParams object +// with the default values initialized, and the ability to set a context for a request +func NewUpdateAutoscalerCountParamsWithContext(ctx context.Context) *UpdateAutoscalerCountParams { + var () + return &UpdateAutoscalerCountParams{ + + Context: ctx, + } +} + +// NewUpdateAutoscalerCountParamsWithHTTPClient creates a new UpdateAutoscalerCountParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewUpdateAutoscalerCountParamsWithHTTPClient(client *http.Client) *UpdateAutoscalerCountParams { + var () + return &UpdateAutoscalerCountParams{ + HTTPClient: client, + } +} + +/*UpdateAutoscalerCountParams contains all the parameters to send to the API endpoint +for the update autoscaler count operation typically these are written to a http.Request +*/ +type UpdateAutoscalerCountParams struct { + + /*Instance + Instance name + + */ + Instance string + /*JSONBody*/ + JSONBody UpdateAutoscalerCountBody + /*Service + Service name + + */ + Service string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the update autoscaler count params +func (o *UpdateAutoscalerCountParams) WithTimeout(timeout time.Duration) *UpdateAutoscalerCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update autoscaler count params +func (o *UpdateAutoscalerCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update autoscaler count params +func (o *UpdateAutoscalerCountParams) WithContext(ctx context.Context) *UpdateAutoscalerCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update autoscaler count params +func (o *UpdateAutoscalerCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update autoscaler count params +func (o *UpdateAutoscalerCountParams) WithHTTPClient(client *http.Client) *UpdateAutoscalerCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update autoscaler count params +func (o *UpdateAutoscalerCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInstance adds the instance to the update autoscaler count params +func (o *UpdateAutoscalerCountParams) WithInstance(instance string) *UpdateAutoscalerCountParams { + o.SetInstance(instance) + return o +} + +// SetInstance adds the instance to the update autoscaler count params +func (o *UpdateAutoscalerCountParams) SetInstance(instance string) { + o.Instance = instance +} + +// WithJSONBody adds the jSONBody to the update autoscaler count params +func (o *UpdateAutoscalerCountParams) WithJSONBody(jSONBody UpdateAutoscalerCountBody) *UpdateAutoscalerCountParams { + o.SetJSONBody(jSONBody) + return o +} + +// SetJSONBody adds the jsonBody to the update autoscaler count params +func (o *UpdateAutoscalerCountParams) SetJSONBody(jSONBody UpdateAutoscalerCountBody) { + o.JSONBody = jSONBody +} + +// WithService adds the service to the update autoscaler count params +func (o *UpdateAutoscalerCountParams) WithService(service string) *UpdateAutoscalerCountParams { + o.SetService(service) + return o +} + +// SetService adds the service to the update autoscaler count params +func (o *UpdateAutoscalerCountParams) SetService(service string) { + o.Service = service +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateAutoscalerCountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param instance + if err := r.SetPathParam("instance", o.Instance); err != nil { + return err + } + + if err := r.SetBodyParam(o.JSONBody); err != nil { + return err + } + + // path param service + if err := r.SetPathParam("service", o.Service); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/client/autoscaler/update_autoscaler_count_responses.go b/pkg/paasta_api/client/autoscaler/update_autoscaler_count_responses.go new file mode 100644 index 0000000..fc7be49 --- /dev/null +++ b/pkg/paasta_api/client/autoscaler/update_autoscaler_count_responses.go @@ -0,0 +1,192 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package autoscaler + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateAutoscalerCountReader is a Reader for the UpdateAutoscalerCount structure. +type UpdateAutoscalerCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateAutoscalerCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 202: + result := NewUpdateAutoscalerCountAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewUpdateAutoscalerCountNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateAutoscalerCountInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewUpdateAutoscalerCountAccepted creates a UpdateAutoscalerCountAccepted with default headers values +func NewUpdateAutoscalerCountAccepted() *UpdateAutoscalerCountAccepted { + return &UpdateAutoscalerCountAccepted{} +} + +/*UpdateAutoscalerCountAccepted handles this case with default header values. + +Set desired instance count for a service instance +*/ +type UpdateAutoscalerCountAccepted struct { + Payload *UpdateAutoscalerCountAcceptedBody +} + +func (o *UpdateAutoscalerCountAccepted) Error() string { + return fmt.Sprintf("[POST /services/{service}/{instance}/autoscaler][%d] updateAutoscalerCountAccepted %+v", 202, o.Payload) +} + +func (o *UpdateAutoscalerCountAccepted) GetPayload() *UpdateAutoscalerCountAcceptedBody { + return o.Payload +} + +func (o *UpdateAutoscalerCountAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(UpdateAutoscalerCountAcceptedBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateAutoscalerCountNotFound creates a UpdateAutoscalerCountNotFound with default headers values +func NewUpdateAutoscalerCountNotFound() *UpdateAutoscalerCountNotFound { + return &UpdateAutoscalerCountNotFound{} +} + +/*UpdateAutoscalerCountNotFound handles this case with default header values. + +Deployment key not found +*/ +type UpdateAutoscalerCountNotFound struct { +} + +func (o *UpdateAutoscalerCountNotFound) Error() string { + return fmt.Sprintf("[POST /services/{service}/{instance}/autoscaler][%d] updateAutoscalerCountNotFound ", 404) +} + +func (o *UpdateAutoscalerCountNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateAutoscalerCountInternalServerError creates a UpdateAutoscalerCountInternalServerError with default headers values +func NewUpdateAutoscalerCountInternalServerError() *UpdateAutoscalerCountInternalServerError { + return &UpdateAutoscalerCountInternalServerError{} +} + +/*UpdateAutoscalerCountInternalServerError handles this case with default header values. + +Instance failure +*/ +type UpdateAutoscalerCountInternalServerError struct { +} + +func (o *UpdateAutoscalerCountInternalServerError) Error() string { + return fmt.Sprintf("[POST /services/{service}/{instance}/autoscaler][%d] updateAutoscalerCountInternalServerError ", 500) +} + +func (o *UpdateAutoscalerCountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +/*UpdateAutoscalerCountAcceptedBody update autoscaler count accepted body +swagger:model UpdateAutoscalerCountAcceptedBody +*/ +type UpdateAutoscalerCountAcceptedBody struct { + + // desired instances + DesiredInstances int64 `json:"desired_instances,omitempty"` + + // status + Status string `json:"status,omitempty"` +} + +// Validate validates this update autoscaler count accepted body +func (o *UpdateAutoscalerCountAcceptedBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *UpdateAutoscalerCountAcceptedBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *UpdateAutoscalerCountAcceptedBody) UnmarshalBinary(b []byte) error { + var res UpdateAutoscalerCountAcceptedBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*UpdateAutoscalerCountBody update autoscaler count body +swagger:model UpdateAutoscalerCountBody +*/ +type UpdateAutoscalerCountBody struct { + + // calculated instances + CalculatedInstances int64 `json:"calculated_instances,omitempty"` + + // desired instances + DesiredInstances int64 `json:"desired_instances,omitempty"` +} + +// Validate validates this update autoscaler count body +func (o *UpdateAutoscalerCountBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *UpdateAutoscalerCountBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *UpdateAutoscalerCountBody) UnmarshalBinary(b []byte) error { + var res UpdateAutoscalerCountBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_client.go b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_client.go new file mode 100644 index 0000000..986e590 --- /dev/null +++ b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_client.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package marathon_dashboard + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new marathon dashboard API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for marathon dashboard API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + MarathonDashboard(params *MarathonDashboardParams) (*MarathonDashboardOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + MarathonDashboard gets marathon service instances and their shards +*/ +func (a *Client) MarathonDashboard(params *MarathonDashboardParams) (*MarathonDashboardOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewMarathonDashboardParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "marathon_dashboard", + Method: "GET", + PathPattern: "/marathon_dashboard", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &MarathonDashboardReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*MarathonDashboardOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for marathon_dashboard: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_parameters.go b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_parameters.go new file mode 100644 index 0000000..67d5f61 --- /dev/null +++ b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_parameters.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package marathon_dashboard + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewMarathonDashboardParams creates a new MarathonDashboardParams object +// with the default values initialized. +func NewMarathonDashboardParams() *MarathonDashboardParams { + + return &MarathonDashboardParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewMarathonDashboardParamsWithTimeout creates a new MarathonDashboardParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewMarathonDashboardParamsWithTimeout(timeout time.Duration) *MarathonDashboardParams { + + return &MarathonDashboardParams{ + + timeout: timeout, + } +} + +// NewMarathonDashboardParamsWithContext creates a new MarathonDashboardParams object +// with the default values initialized, and the ability to set a context for a request +func NewMarathonDashboardParamsWithContext(ctx context.Context) *MarathonDashboardParams { + + return &MarathonDashboardParams{ + + Context: ctx, + } +} + +// NewMarathonDashboardParamsWithHTTPClient creates a new MarathonDashboardParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewMarathonDashboardParamsWithHTTPClient(client *http.Client) *MarathonDashboardParams { + + return &MarathonDashboardParams{ + HTTPClient: client, + } +} + +/*MarathonDashboardParams contains all the parameters to send to the API endpoint +for the marathon dashboard operation typically these are written to a http.Request +*/ +type MarathonDashboardParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the marathon dashboard params +func (o *MarathonDashboardParams) WithTimeout(timeout time.Duration) *MarathonDashboardParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the marathon dashboard params +func (o *MarathonDashboardParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the marathon dashboard params +func (o *MarathonDashboardParams) WithContext(ctx context.Context) *MarathonDashboardParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the marathon dashboard params +func (o *MarathonDashboardParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the marathon dashboard params +func (o *MarathonDashboardParams) WithHTTPClient(client *http.Client) *MarathonDashboardParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the marathon dashboard params +func (o *MarathonDashboardParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *MarathonDashboardParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_responses.go b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_responses.go new file mode 100644 index 0000000..b474020 --- /dev/null +++ b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package marathon_dashboard + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" +) + +// MarathonDashboardReader is a Reader for the MarathonDashboard structure. +type MarathonDashboardReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *MarathonDashboardReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewMarathonDashboardOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewMarathonDashboardOK creates a MarathonDashboardOK with default headers values +func NewMarathonDashboardOK() *MarathonDashboardOK { + return &MarathonDashboardOK{} +} + +/*MarathonDashboardOK handles this case with default header values. + +List of service instances and information on their Marathon shard +*/ +type MarathonDashboardOK struct { + Payload models.MarathonDashboard +} + +func (o *MarathonDashboardOK) Error() string { + return fmt.Sprintf("[GET /marathon_dashboard][%d] marathonDashboardOK %+v", 200, o.Payload) +} + +func (o *MarathonDashboardOK) GetPayload() models.MarathonDashboard { + return o.Payload +} + +func (o *MarathonDashboardOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_parameters.go b/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_parameters.go new file mode 100644 index 0000000..999782b --- /dev/null +++ b/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_parameters.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteServiceAutoscalerPauseParams creates a new DeleteServiceAutoscalerPauseParams object +// with the default values initialized. +func NewDeleteServiceAutoscalerPauseParams() *DeleteServiceAutoscalerPauseParams { + + return &DeleteServiceAutoscalerPauseParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteServiceAutoscalerPauseParamsWithTimeout creates a new DeleteServiceAutoscalerPauseParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteServiceAutoscalerPauseParamsWithTimeout(timeout time.Duration) *DeleteServiceAutoscalerPauseParams { + + return &DeleteServiceAutoscalerPauseParams{ + + timeout: timeout, + } +} + +// NewDeleteServiceAutoscalerPauseParamsWithContext creates a new DeleteServiceAutoscalerPauseParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteServiceAutoscalerPauseParamsWithContext(ctx context.Context) *DeleteServiceAutoscalerPauseParams { + + return &DeleteServiceAutoscalerPauseParams{ + + Context: ctx, + } +} + +// NewDeleteServiceAutoscalerPauseParamsWithHTTPClient creates a new DeleteServiceAutoscalerPauseParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteServiceAutoscalerPauseParamsWithHTTPClient(client *http.Client) *DeleteServiceAutoscalerPauseParams { + + return &DeleteServiceAutoscalerPauseParams{ + HTTPClient: client, + } +} + +/*DeleteServiceAutoscalerPauseParams contains all the parameters to send to the API endpoint +for the delete service autoscaler pause operation typically these are written to a http.Request +*/ +type DeleteServiceAutoscalerPauseParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete service autoscaler pause params +func (o *DeleteServiceAutoscalerPauseParams) WithTimeout(timeout time.Duration) *DeleteServiceAutoscalerPauseParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete service autoscaler pause params +func (o *DeleteServiceAutoscalerPauseParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete service autoscaler pause params +func (o *DeleteServiceAutoscalerPauseParams) WithContext(ctx context.Context) *DeleteServiceAutoscalerPauseParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete service autoscaler pause params +func (o *DeleteServiceAutoscalerPauseParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete service autoscaler pause params +func (o *DeleteServiceAutoscalerPauseParams) WithHTTPClient(client *http.Client) *DeleteServiceAutoscalerPauseParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete service autoscaler pause params +func (o *DeleteServiceAutoscalerPauseParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteServiceAutoscalerPauseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_responses.go b/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_responses.go new file mode 100644 index 0000000..d41f68f --- /dev/null +++ b/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteServiceAutoscalerPauseReader is a Reader for the DeleteServiceAutoscalerPause structure. +type DeleteServiceAutoscalerPauseReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteServiceAutoscalerPauseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteServiceAutoscalerPauseOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewDeleteServiceAutoscalerPauseInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteServiceAutoscalerPauseOK creates a DeleteServiceAutoscalerPauseOK with default headers values +func NewDeleteServiceAutoscalerPauseOK() *DeleteServiceAutoscalerPauseOK { + return &DeleteServiceAutoscalerPauseOK{} +} + +/*DeleteServiceAutoscalerPauseOK handles this case with default header values. + +Service autoscaler successfully unpaused +*/ +type DeleteServiceAutoscalerPauseOK struct { +} + +func (o *DeleteServiceAutoscalerPauseOK) Error() string { + return fmt.Sprintf("[DELETE /service_autoscaler/pause][%d] deleteServiceAutoscalerPauseOK ", 200) +} + +func (o *DeleteServiceAutoscalerPauseOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteServiceAutoscalerPauseInternalServerError creates a DeleteServiceAutoscalerPauseInternalServerError with default headers values +func NewDeleteServiceAutoscalerPauseInternalServerError() *DeleteServiceAutoscalerPauseInternalServerError { + return &DeleteServiceAutoscalerPauseInternalServerError{} +} + +/*DeleteServiceAutoscalerPauseInternalServerError handles this case with default header values. + +Unable to talk to zookeeper +*/ +type DeleteServiceAutoscalerPauseInternalServerError struct { +} + +func (o *DeleteServiceAutoscalerPauseInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /service_autoscaler/pause][%d] deleteServiceAutoscalerPauseInternalServerError ", 500) +} + +func (o *DeleteServiceAutoscalerPauseInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/paasta_api/client/operations/deploy_queue_parameters.go b/pkg/paasta_api/client/operations/deploy_queue_parameters.go new file mode 100644 index 0000000..a7e02a0 --- /dev/null +++ b/pkg/paasta_api/client/operations/deploy_queue_parameters.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeployQueueParams creates a new DeployQueueParams object +// with the default values initialized. +func NewDeployQueueParams() *DeployQueueParams { + + return &DeployQueueParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeployQueueParamsWithTimeout creates a new DeployQueueParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeployQueueParamsWithTimeout(timeout time.Duration) *DeployQueueParams { + + return &DeployQueueParams{ + + timeout: timeout, + } +} + +// NewDeployQueueParamsWithContext creates a new DeployQueueParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeployQueueParamsWithContext(ctx context.Context) *DeployQueueParams { + + return &DeployQueueParams{ + + Context: ctx, + } +} + +// NewDeployQueueParamsWithHTTPClient creates a new DeployQueueParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeployQueueParamsWithHTTPClient(client *http.Client) *DeployQueueParams { + + return &DeployQueueParams{ + HTTPClient: client, + } +} + +/*DeployQueueParams contains all the parameters to send to the API endpoint +for the deploy queue operation typically these are written to a http.Request +*/ +type DeployQueueParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the deploy queue params +func (o *DeployQueueParams) WithTimeout(timeout time.Duration) *DeployQueueParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the deploy queue params +func (o *DeployQueueParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the deploy queue params +func (o *DeployQueueParams) WithContext(ctx context.Context) *DeployQueueParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the deploy queue params +func (o *DeployQueueParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the deploy queue params +func (o *DeployQueueParams) WithHTTPClient(client *http.Client) *DeployQueueParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the deploy queue params +func (o *DeployQueueParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *DeployQueueParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/client/operations/deploy_queue_responses.go b/pkg/paasta_api/client/operations/deploy_queue_responses.go new file mode 100644 index 0000000..eab3e11 --- /dev/null +++ b/pkg/paasta_api/client/operations/deploy_queue_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" +) + +// DeployQueueReader is a Reader for the DeployQueue structure. +type DeployQueueReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeployQueueReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeployQueueOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeployQueueOK creates a DeployQueueOK with default headers values +func NewDeployQueueOK() *DeployQueueOK { + return &DeployQueueOK{} +} + +/*DeployQueueOK handles this case with default header values. + +Contents of deploy queue +*/ +type DeployQueueOK struct { + Payload *models.DeployQueue +} + +func (o *DeployQueueOK) Error() string { + return fmt.Sprintf("[GET /deploy_queue][%d] deployQueueOK %+v", 200, o.Payload) +} + +func (o *DeployQueueOK) GetPayload() *models.DeployQueue { + return o.Payload +} + +func (o *DeployQueueOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DeployQueue) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/paasta_api/client/operations/get_service_autoscaler_pause_parameters.go b/pkg/paasta_api/client/operations/get_service_autoscaler_pause_parameters.go new file mode 100644 index 0000000..e00dd1b --- /dev/null +++ b/pkg/paasta_api/client/operations/get_service_autoscaler_pause_parameters.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetServiceAutoscalerPauseParams creates a new GetServiceAutoscalerPauseParams object +// with the default values initialized. +func NewGetServiceAutoscalerPauseParams() *GetServiceAutoscalerPauseParams { + + return &GetServiceAutoscalerPauseParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetServiceAutoscalerPauseParamsWithTimeout creates a new GetServiceAutoscalerPauseParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetServiceAutoscalerPauseParamsWithTimeout(timeout time.Duration) *GetServiceAutoscalerPauseParams { + + return &GetServiceAutoscalerPauseParams{ + + timeout: timeout, + } +} + +// NewGetServiceAutoscalerPauseParamsWithContext creates a new GetServiceAutoscalerPauseParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetServiceAutoscalerPauseParamsWithContext(ctx context.Context) *GetServiceAutoscalerPauseParams { + + return &GetServiceAutoscalerPauseParams{ + + Context: ctx, + } +} + +// NewGetServiceAutoscalerPauseParamsWithHTTPClient creates a new GetServiceAutoscalerPauseParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetServiceAutoscalerPauseParamsWithHTTPClient(client *http.Client) *GetServiceAutoscalerPauseParams { + + return &GetServiceAutoscalerPauseParams{ + HTTPClient: client, + } +} + +/*GetServiceAutoscalerPauseParams contains all the parameters to send to the API endpoint +for the get service autoscaler pause operation typically these are written to a http.Request +*/ +type GetServiceAutoscalerPauseParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get service autoscaler pause params +func (o *GetServiceAutoscalerPauseParams) WithTimeout(timeout time.Duration) *GetServiceAutoscalerPauseParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get service autoscaler pause params +func (o *GetServiceAutoscalerPauseParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get service autoscaler pause params +func (o *GetServiceAutoscalerPauseParams) WithContext(ctx context.Context) *GetServiceAutoscalerPauseParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get service autoscaler pause params +func (o *GetServiceAutoscalerPauseParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get service autoscaler pause params +func (o *GetServiceAutoscalerPauseParams) WithHTTPClient(client *http.Client) *GetServiceAutoscalerPauseParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get service autoscaler pause params +func (o *GetServiceAutoscalerPauseParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetServiceAutoscalerPauseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/client/operations/get_service_autoscaler_pause_responses.go b/pkg/paasta_api/client/operations/get_service_autoscaler_pause_responses.go new file mode 100644 index 0000000..5e0eda9 --- /dev/null +++ b/pkg/paasta_api/client/operations/get_service_autoscaler_pause_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetServiceAutoscalerPauseReader is a Reader for the GetServiceAutoscalerPause structure. +type GetServiceAutoscalerPauseReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetServiceAutoscalerPauseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetServiceAutoscalerPauseOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewGetServiceAutoscalerPauseInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetServiceAutoscalerPauseOK creates a GetServiceAutoscalerPauseOK with default headers values +func NewGetServiceAutoscalerPauseOK() *GetServiceAutoscalerPauseOK { + return &GetServiceAutoscalerPauseOK{} +} + +/*GetServiceAutoscalerPauseOK handles this case with default header values. + +The time until which the servcie autoscaler is paused for +*/ +type GetServiceAutoscalerPauseOK struct { + Payload string +} + +func (o *GetServiceAutoscalerPauseOK) Error() string { + return fmt.Sprintf("[GET /service_autoscaler/pause][%d] getServiceAutoscalerPauseOK %+v", 200, o.Payload) +} + +func (o *GetServiceAutoscalerPauseOK) GetPayload() string { + return o.Payload +} + +func (o *GetServiceAutoscalerPauseOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetServiceAutoscalerPauseInternalServerError creates a GetServiceAutoscalerPauseInternalServerError with default headers values +func NewGetServiceAutoscalerPauseInternalServerError() *GetServiceAutoscalerPauseInternalServerError { + return &GetServiceAutoscalerPauseInternalServerError{} +} + +/*GetServiceAutoscalerPauseInternalServerError handles this case with default header values. + +Unable to talk to zookeeper +*/ +type GetServiceAutoscalerPauseInternalServerError struct { +} + +func (o *GetServiceAutoscalerPauseInternalServerError) Error() string { + return fmt.Sprintf("[GET /service_autoscaler/pause][%d] getServiceAutoscalerPauseInternalServerError ", 500) +} + +func (o *GetServiceAutoscalerPauseInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/paasta_api/client/operations/metastatus_parameters.go b/pkg/paasta_api/client/operations/metastatus_parameters.go new file mode 100644 index 0000000..3448fcd --- /dev/null +++ b/pkg/paasta_api/client/operations/metastatus_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewMetastatusParams creates a new MetastatusParams object +// with the default values initialized. +func NewMetastatusParams() *MetastatusParams { + var () + return &MetastatusParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewMetastatusParamsWithTimeout creates a new MetastatusParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewMetastatusParamsWithTimeout(timeout time.Duration) *MetastatusParams { + var () + return &MetastatusParams{ + + timeout: timeout, + } +} + +// NewMetastatusParamsWithContext creates a new MetastatusParams object +// with the default values initialized, and the ability to set a context for a request +func NewMetastatusParamsWithContext(ctx context.Context) *MetastatusParams { + var () + return &MetastatusParams{ + + Context: ctx, + } +} + +// NewMetastatusParamsWithHTTPClient creates a new MetastatusParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewMetastatusParamsWithHTTPClient(client *http.Client) *MetastatusParams { + var () + return &MetastatusParams{ + HTTPClient: client, + } +} + +/*MetastatusParams contains all the parameters to send to the API endpoint +for the metastatus operation typically these are written to a http.Request +*/ +type MetastatusParams struct { + + /*CmdArgs + comma separated list of command arguments + + */ + CmdArgs []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the metastatus params +func (o *MetastatusParams) WithTimeout(timeout time.Duration) *MetastatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the metastatus params +func (o *MetastatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the metastatus params +func (o *MetastatusParams) WithContext(ctx context.Context) *MetastatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the metastatus params +func (o *MetastatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the metastatus params +func (o *MetastatusParams) WithHTTPClient(client *http.Client) *MetastatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the metastatus params +func (o *MetastatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCmdArgs adds the cmdArgs to the metastatus params +func (o *MetastatusParams) WithCmdArgs(cmdArgs []string) *MetastatusParams { + o.SetCmdArgs(cmdArgs) + return o +} + +// SetCmdArgs adds the cmdArgs to the metastatus params +func (o *MetastatusParams) SetCmdArgs(cmdArgs []string) { + o.CmdArgs = cmdArgs +} + +// WriteToRequest writes these params to a swagger request +func (o *MetastatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + valuesCmdArgs := o.CmdArgs + + joinedCmdArgs := swag.JoinByFormat(valuesCmdArgs, "csv") + // query array param cmd_args + if err := r.SetQueryParam("cmd_args", joinedCmdArgs...); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/client/operations/metastatus_responses.go b/pkg/paasta_api/client/operations/metastatus_responses.go new file mode 100644 index 0000000..60f309a --- /dev/null +++ b/pkg/paasta_api/client/operations/metastatus_responses.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" +) + +// MetastatusReader is a Reader for the Metastatus structure. +type MetastatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *MetastatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewMetastatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewMetastatusInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewMetastatusOK creates a MetastatusOK with default headers values +func NewMetastatusOK() *MetastatusOK { + return &MetastatusOK{} +} + +/*MetastatusOK handles this case with default header values. + +Detailed metastatus +*/ +type MetastatusOK struct { + Payload *models.MetaStatus +} + +func (o *MetastatusOK) Error() string { + return fmt.Sprintf("[GET /metastatus][%d] metastatusOK %+v", 200, o.Payload) +} + +func (o *MetastatusOK) GetPayload() *models.MetaStatus { + return o.Payload +} + +func (o *MetastatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.MetaStatus) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMetastatusInternalServerError creates a MetastatusInternalServerError with default headers values +func NewMetastatusInternalServerError() *MetastatusInternalServerError { + return &MetastatusInternalServerError{} +} + +/*MetastatusInternalServerError handles this case with default header values. + +Metastatus failure +*/ +type MetastatusInternalServerError struct { +} + +func (o *MetastatusInternalServerError) Error() string { + return fmt.Sprintf("[GET /metastatus][%d] metastatusInternalServerError ", 500) +} + +func (o *MetastatusInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/paasta_api/client/operations/operations_client.go b/pkg/paasta_api/client/operations/operations_client.go new file mode 100644 index 0000000..825d239 --- /dev/null +++ b/pkg/paasta_api/client/operations/operations_client.go @@ -0,0 +1,252 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new operations API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for operations API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteServiceAutoscalerPause(params *DeleteServiceAutoscalerPauseParams) (*DeleteServiceAutoscalerPauseOK, error) + + DeployQueue(params *DeployQueueParams) (*DeployQueueOK, error) + + GetServiceAutoscalerPause(params *GetServiceAutoscalerPauseParams) (*GetServiceAutoscalerPauseOK, error) + + Metastatus(params *MetastatusParams) (*MetastatusOK, error) + + ShowVersion(params *ShowVersionParams) (*ShowVersionOK, error) + + UpdateServiceAutoscalerPause(params *UpdateServiceAutoscalerPauseParams) (*UpdateServiceAutoscalerPauseOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteServiceAutoscalerPause unpauses the autoscaler +*/ +func (a *Client) DeleteServiceAutoscalerPause(params *DeleteServiceAutoscalerPauseParams) (*DeleteServiceAutoscalerPauseOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteServiceAutoscalerPauseParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "delete_service_autoscaler_pause", + Method: "DELETE", + PathPattern: "/service_autoscaler/pause", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteServiceAutoscalerPauseReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteServiceAutoscalerPauseOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for delete_service_autoscaler_pause: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + DeployQueue gets deploy queue contents +*/ +func (a *Client) DeployQueue(params *DeployQueueParams) (*DeployQueueOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeployQueueParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deploy_queue", + Method: "GET", + PathPattern: "/deploy_queue", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeployQueueReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeployQueueOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deploy_queue: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetServiceAutoscalerPause gets autoscaling pause time +*/ +func (a *Client) GetServiceAutoscalerPause(params *GetServiceAutoscalerPauseParams) (*GetServiceAutoscalerPauseOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetServiceAutoscalerPauseParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "get_service_autoscaler_pause", + Method: "GET", + PathPattern: "/service_autoscaler/pause", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetServiceAutoscalerPauseReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetServiceAutoscalerPauseOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for get_service_autoscaler_pause: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + Metastatus gets metastatus +*/ +func (a *Client) Metastatus(params *MetastatusParams) (*MetastatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewMetastatusParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "metastatus", + Method: "GET", + PathPattern: "/metastatus", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &MetastatusReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*MetastatusOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for metastatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ShowVersion versions of paasta tools package +*/ +func (a *Client) ShowVersion(params *ShowVersionParams) (*ShowVersionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewShowVersionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "showVersion", + Method: "GET", + PathPattern: "/version", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ShowVersionReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ShowVersionOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for showVersion: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UpdateServiceAutoscalerPause update service autoscaler pause API +*/ +func (a *Client) UpdateServiceAutoscalerPause(params *UpdateServiceAutoscalerPauseParams) (*UpdateServiceAutoscalerPauseOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateServiceAutoscalerPauseParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "update_service_autoscaler_pause", + Method: "POST", + PathPattern: "/service_autoscaler/pause", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateServiceAutoscalerPauseReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateServiceAutoscalerPauseOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for update_service_autoscaler_pause: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/paasta_api/client/operations/show_version_parameters.go b/pkg/paasta_api/client/operations/show_version_parameters.go new file mode 100644 index 0000000..a8b181a --- /dev/null +++ b/pkg/paasta_api/client/operations/show_version_parameters.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewShowVersionParams creates a new ShowVersionParams object +// with the default values initialized. +func NewShowVersionParams() *ShowVersionParams { + + return &ShowVersionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewShowVersionParamsWithTimeout creates a new ShowVersionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewShowVersionParamsWithTimeout(timeout time.Duration) *ShowVersionParams { + + return &ShowVersionParams{ + + timeout: timeout, + } +} + +// NewShowVersionParamsWithContext creates a new ShowVersionParams object +// with the default values initialized, and the ability to set a context for a request +func NewShowVersionParamsWithContext(ctx context.Context) *ShowVersionParams { + + return &ShowVersionParams{ + + Context: ctx, + } +} + +// NewShowVersionParamsWithHTTPClient creates a new ShowVersionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewShowVersionParamsWithHTTPClient(client *http.Client) *ShowVersionParams { + + return &ShowVersionParams{ + HTTPClient: client, + } +} + +/*ShowVersionParams contains all the parameters to send to the API endpoint +for the show version operation typically these are written to a http.Request +*/ +type ShowVersionParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the show version params +func (o *ShowVersionParams) WithTimeout(timeout time.Duration) *ShowVersionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the show version params +func (o *ShowVersionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the show version params +func (o *ShowVersionParams) WithContext(ctx context.Context) *ShowVersionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the show version params +func (o *ShowVersionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the show version params +func (o *ShowVersionParams) WithHTTPClient(client *http.Client) *ShowVersionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the show version params +func (o *ShowVersionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ShowVersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/client/operations/show_version_responses.go b/pkg/paasta_api/client/operations/show_version_responses.go new file mode 100644 index 0000000..bd7c8f7 --- /dev/null +++ b/pkg/paasta_api/client/operations/show_version_responses.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ShowVersionReader is a Reader for the ShowVersion structure. +type ShowVersionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ShowVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewShowVersionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewShowVersionOK creates a ShowVersionOK with default headers values +func NewShowVersionOK() *ShowVersionOK { + return &ShowVersionOK{} +} + +/*ShowVersionOK handles this case with default header values. + +Version of paasta_tools package +*/ +type ShowVersionOK struct { + Payload string +} + +func (o *ShowVersionOK) Error() string { + return fmt.Sprintf("[GET /version][%d] showVersionOK %+v", 200, o.Payload) +} + +func (o *ShowVersionOK) GetPayload() string { + return o.Payload +} + +func (o *ShowVersionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/paasta_api/client/operations/update_service_autoscaler_pause_parameters.go b/pkg/paasta_api/client/operations/update_service_autoscaler_pause_parameters.go new file mode 100644 index 0000000..5fb998d --- /dev/null +++ b/pkg/paasta_api/client/operations/update_service_autoscaler_pause_parameters.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateServiceAutoscalerPauseParams creates a new UpdateServiceAutoscalerPauseParams object +// with the default values initialized. +func NewUpdateServiceAutoscalerPauseParams() *UpdateServiceAutoscalerPauseParams { + var () + return &UpdateServiceAutoscalerPauseParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateServiceAutoscalerPauseParamsWithTimeout creates a new UpdateServiceAutoscalerPauseParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewUpdateServiceAutoscalerPauseParamsWithTimeout(timeout time.Duration) *UpdateServiceAutoscalerPauseParams { + var () + return &UpdateServiceAutoscalerPauseParams{ + + timeout: timeout, + } +} + +// NewUpdateServiceAutoscalerPauseParamsWithContext creates a new UpdateServiceAutoscalerPauseParams object +// with the default values initialized, and the ability to set a context for a request +func NewUpdateServiceAutoscalerPauseParamsWithContext(ctx context.Context) *UpdateServiceAutoscalerPauseParams { + var () + return &UpdateServiceAutoscalerPauseParams{ + + Context: ctx, + } +} + +// NewUpdateServiceAutoscalerPauseParamsWithHTTPClient creates a new UpdateServiceAutoscalerPauseParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewUpdateServiceAutoscalerPauseParamsWithHTTPClient(client *http.Client) *UpdateServiceAutoscalerPauseParams { + var () + return &UpdateServiceAutoscalerPauseParams{ + HTTPClient: client, + } +} + +/*UpdateServiceAutoscalerPauseParams contains all the parameters to send to the API endpoint +for the update service autoscaler pause operation typically these are written to a http.Request +*/ +type UpdateServiceAutoscalerPauseParams struct { + + /*JSONBody*/ + JSONBody UpdateServiceAutoscalerPauseBody + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the update service autoscaler pause params +func (o *UpdateServiceAutoscalerPauseParams) WithTimeout(timeout time.Duration) *UpdateServiceAutoscalerPauseParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update service autoscaler pause params +func (o *UpdateServiceAutoscalerPauseParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update service autoscaler pause params +func (o *UpdateServiceAutoscalerPauseParams) WithContext(ctx context.Context) *UpdateServiceAutoscalerPauseParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update service autoscaler pause params +func (o *UpdateServiceAutoscalerPauseParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update service autoscaler pause params +func (o *UpdateServiceAutoscalerPauseParams) WithHTTPClient(client *http.Client) *UpdateServiceAutoscalerPauseParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update service autoscaler pause params +func (o *UpdateServiceAutoscalerPauseParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithJSONBody adds the jSONBody to the update service autoscaler pause params +func (o *UpdateServiceAutoscalerPauseParams) WithJSONBody(jSONBody UpdateServiceAutoscalerPauseBody) *UpdateServiceAutoscalerPauseParams { + o.SetJSONBody(jSONBody) + return o +} + +// SetJSONBody adds the jsonBody to the update service autoscaler pause params +func (o *UpdateServiceAutoscalerPauseParams) SetJSONBody(jSONBody UpdateServiceAutoscalerPauseBody) { + o.JSONBody = jSONBody +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateServiceAutoscalerPauseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if err := r.SetBodyParam(o.JSONBody); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/client/operations/update_service_autoscaler_pause_responses.go b/pkg/paasta_api/client/operations/update_service_autoscaler_pause_responses.go new file mode 100644 index 0000000..4496259 --- /dev/null +++ b/pkg/paasta_api/client/operations/update_service_autoscaler_pause_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateServiceAutoscalerPauseReader is a Reader for the UpdateServiceAutoscalerPause structure. +type UpdateServiceAutoscalerPauseReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateServiceAutoscalerPauseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateServiceAutoscalerPauseOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewUpdateServiceAutoscalerPauseInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewUpdateServiceAutoscalerPauseOK creates a UpdateServiceAutoscalerPauseOK with default headers values +func NewUpdateServiceAutoscalerPauseOK() *UpdateServiceAutoscalerPauseOK { + return &UpdateServiceAutoscalerPauseOK{} +} + +/*UpdateServiceAutoscalerPauseOK handles this case with default header values. + +Service autoscaler successfully paused +*/ +type UpdateServiceAutoscalerPauseOK struct { +} + +func (o *UpdateServiceAutoscalerPauseOK) Error() string { + return fmt.Sprintf("[POST /service_autoscaler/pause][%d] updateServiceAutoscalerPauseOK ", 200) +} + +func (o *UpdateServiceAutoscalerPauseOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateServiceAutoscalerPauseInternalServerError creates a UpdateServiceAutoscalerPauseInternalServerError with default headers values +func NewUpdateServiceAutoscalerPauseInternalServerError() *UpdateServiceAutoscalerPauseInternalServerError { + return &UpdateServiceAutoscalerPauseInternalServerError{} +} + +/*UpdateServiceAutoscalerPauseInternalServerError handles this case with default header values. + +Unable to talk to zookeeper +*/ +type UpdateServiceAutoscalerPauseInternalServerError struct { +} + +func (o *UpdateServiceAutoscalerPauseInternalServerError) Error() string { + return fmt.Sprintf("[POST /service_autoscaler/pause][%d] updateServiceAutoscalerPauseInternalServerError ", 500) +} + +func (o *UpdateServiceAutoscalerPauseInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +/*UpdateServiceAutoscalerPauseBody update service autoscaler pause body +swagger:model UpdateServiceAutoscalerPauseBody +*/ +type UpdateServiceAutoscalerPauseBody struct { + + // minutes + Minutes int64 `json:"minutes,omitempty"` +} + +// Validate validates this update service autoscaler pause body +func (o *UpdateServiceAutoscalerPauseBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *UpdateServiceAutoscalerPauseBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *UpdateServiceAutoscalerPauseBody) UnmarshalBinary(b []byte) error { + var res UpdateServiceAutoscalerPauseBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/pkg/paasta_api/client/paasta_client.go b/pkg/paasta_api/client/paasta_client.go new file mode 100644 index 0000000..4668e19 --- /dev/null +++ b/pkg/paasta_api/client/paasta_client.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/autoscaler" + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/marathon_dashboard" + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/operations" + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/resources" + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/service" +) + +// Default paasta HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "localhost" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/v1" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new paasta HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Paasta { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new paasta HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Paasta { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new paasta client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Paasta { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Paasta) + cli.Transport = transport + cli.Autoscaler = autoscaler.New(transport, formats) + cli.MarathonDashboard = marathon_dashboard.New(transport, formats) + cli.Operations = operations.New(transport, formats) + cli.Resources = resources.New(transport, formats) + cli.Service = service.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// Paasta is a client for paasta +type Paasta struct { + Autoscaler autoscaler.ClientService + + MarathonDashboard marathon_dashboard.ClientService + + Operations operations.ClientService + + Resources resources.ClientService + + Service service.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Paasta) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Autoscaler.SetTransport(transport) + c.MarathonDashboard.SetTransport(transport) + c.Operations.SetTransport(transport) + c.Resources.SetTransport(transport) + c.Service.SetTransport(transport) +} diff --git a/pkg/paasta_api/client/resources/resources_client.go b/pkg/paasta_api/client/resources/resources_client.go new file mode 100644 index 0000000..94639f3 --- /dev/null +++ b/pkg/paasta_api/client/resources/resources_client.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package resources + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new resources API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for resources API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + Resources(params *ResourcesParams) (*ResourcesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + Resources gets resources in the cluster +*/ +func (a *Client) Resources(params *ResourcesParams) (*ResourcesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewResourcesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "resources", + Method: "GET", + PathPattern: "/resources/utilization", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ResourcesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ResourcesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for resources: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/paasta_api/client/resources/resources_parameters.go b/pkg/paasta_api/client/resources/resources_parameters.go new file mode 100644 index 0000000..48a697f --- /dev/null +++ b/pkg/paasta_api/client/resources/resources_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package resources + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewResourcesParams creates a new ResourcesParams object +// with the default values initialized. +func NewResourcesParams() *ResourcesParams { + var () + return &ResourcesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewResourcesParamsWithTimeout creates a new ResourcesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewResourcesParamsWithTimeout(timeout time.Duration) *ResourcesParams { + var () + return &ResourcesParams{ + + timeout: timeout, + } +} + +// NewResourcesParamsWithContext creates a new ResourcesParams object +// with the default values initialized, and the ability to set a context for a request +func NewResourcesParamsWithContext(ctx context.Context) *ResourcesParams { + var () + return &ResourcesParams{ + + Context: ctx, + } +} + +// NewResourcesParamsWithHTTPClient creates a new ResourcesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewResourcesParamsWithHTTPClient(client *http.Client) *ResourcesParams { + var () + return &ResourcesParams{ + HTTPClient: client, + } +} + +/*ResourcesParams contains all the parameters to send to the API endpoint +for the resources operation typically these are written to a http.Request +*/ +type ResourcesParams struct { + + /*Filter + List of slave filters in format 'filter=attr_name:value1,value2&filter=attr2:value3,value4'. Matches attr_name=(value1 OR value2) AND attr2=(value3 OR value4) + + */ + Filter []string + /*Groupings + comma separated list of keys to group by + + */ + Groupings []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the resources params +func (o *ResourcesParams) WithTimeout(timeout time.Duration) *ResourcesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the resources params +func (o *ResourcesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the resources params +func (o *ResourcesParams) WithContext(ctx context.Context) *ResourcesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the resources params +func (o *ResourcesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the resources params +func (o *ResourcesParams) WithHTTPClient(client *http.Client) *ResourcesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the resources params +func (o *ResourcesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the resources params +func (o *ResourcesParams) WithFilter(filter []string) *ResourcesParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the resources params +func (o *ResourcesParams) SetFilter(filter []string) { + o.Filter = filter +} + +// WithGroupings adds the groupings to the resources params +func (o *ResourcesParams) WithGroupings(groupings []string) *ResourcesParams { + o.SetGroupings(groupings) + return o +} + +// SetGroupings adds the groupings to the resources params +func (o *ResourcesParams) SetGroupings(groupings []string) { + o.Groupings = groupings +} + +// WriteToRequest writes these params to a swagger request +func (o *ResourcesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + valuesFilter := o.Filter + + joinedFilter := swag.JoinByFormat(valuesFilter, "multi") + // query array param filter + if err := r.SetQueryParam("filter", joinedFilter...); err != nil { + return err + } + + valuesGroupings := o.Groupings + + joinedGroupings := swag.JoinByFormat(valuesGroupings, "csv") + // query array param groupings + if err := r.SetQueryParam("groupings", joinedGroupings...); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/client/resources/resources_responses.go b/pkg/paasta_api/client/resources/resources_responses.go new file mode 100644 index 0000000..e82b82e --- /dev/null +++ b/pkg/paasta_api/client/resources/resources_responses.go @@ -0,0 +1,94 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package resources + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" +) + +// ResourcesReader is a Reader for the Resources structure. +type ResourcesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ResourcesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewResourcesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewResourcesBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewResourcesOK creates a ResourcesOK with default headers values +func NewResourcesOK() *ResourcesOK { + return &ResourcesOK{} +} + +/*ResourcesOK handles this case with default header values. + +Resources in the cluster, filtered and grouped by parameters +*/ +type ResourcesOK struct { + Payload models.Resource +} + +func (o *ResourcesOK) Error() string { + return fmt.Sprintf("[GET /resources/utilization][%d] resourcesOK %+v", 200, o.Payload) +} + +func (o *ResourcesOK) GetPayload() models.Resource { + return o.Payload +} + +func (o *ResourcesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewResourcesBadRequest creates a ResourcesBadRequest with default headers values +func NewResourcesBadRequest() *ResourcesBadRequest { + return &ResourcesBadRequest{} +} + +/*ResourcesBadRequest handles this case with default header values. + +Poorly formated query parameters +*/ +type ResourcesBadRequest struct { +} + +func (o *ResourcesBadRequest) Error() string { + return fmt.Sprintf("[GET /resources/utilization][%d] resourcesBadRequest ", 400) +} + +func (o *ResourcesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/paasta_api/client/service/delay_instance_parameters.go b/pkg/paasta_api/client/service/delay_instance_parameters.go new file mode 100644 index 0000000..3b90c31 --- /dev/null +++ b/pkg/paasta_api/client/service/delay_instance_parameters.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDelayInstanceParams creates a new DelayInstanceParams object +// with the default values initialized. +func NewDelayInstanceParams() *DelayInstanceParams { + var () + return &DelayInstanceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDelayInstanceParamsWithTimeout creates a new DelayInstanceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDelayInstanceParamsWithTimeout(timeout time.Duration) *DelayInstanceParams { + var () + return &DelayInstanceParams{ + + timeout: timeout, + } +} + +// NewDelayInstanceParamsWithContext creates a new DelayInstanceParams object +// with the default values initialized, and the ability to set a context for a request +func NewDelayInstanceParamsWithContext(ctx context.Context) *DelayInstanceParams { + var () + return &DelayInstanceParams{ + + Context: ctx, + } +} + +// NewDelayInstanceParamsWithHTTPClient creates a new DelayInstanceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDelayInstanceParamsWithHTTPClient(client *http.Client) *DelayInstanceParams { + var () + return &DelayInstanceParams{ + HTTPClient: client, + } +} + +/*DelayInstanceParams contains all the parameters to send to the API endpoint +for the delay instance operation typically these are written to a http.Request +*/ +type DelayInstanceParams struct { + + /*Instance + Instance name + + */ + Instance string + /*Service + Service name + + */ + Service string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delay instance params +func (o *DelayInstanceParams) WithTimeout(timeout time.Duration) *DelayInstanceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delay instance params +func (o *DelayInstanceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delay instance params +func (o *DelayInstanceParams) WithContext(ctx context.Context) *DelayInstanceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delay instance params +func (o *DelayInstanceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delay instance params +func (o *DelayInstanceParams) WithHTTPClient(client *http.Client) *DelayInstanceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delay instance params +func (o *DelayInstanceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInstance adds the instance to the delay instance params +func (o *DelayInstanceParams) WithInstance(instance string) *DelayInstanceParams { + o.SetInstance(instance) + return o +} + +// SetInstance adds the instance to the delay instance params +func (o *DelayInstanceParams) SetInstance(instance string) { + o.Instance = instance +} + +// WithService adds the service to the delay instance params +func (o *DelayInstanceParams) WithService(service string) *DelayInstanceParams { + o.SetService(service) + return o +} + +// SetService adds the service to the delay instance params +func (o *DelayInstanceParams) SetService(service string) { + o.Service = service +} + +// WriteToRequest writes these params to a swagger request +func (o *DelayInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param instance + if err := r.SetPathParam("instance", o.Instance); err != nil { + return err + } + + // path param service + if err := r.SetPathParam("service", o.Service); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/client/service/delay_instance_responses.go b/pkg/paasta_api/client/service/delay_instance_responses.go new file mode 100644 index 0000000..eb5d10a --- /dev/null +++ b/pkg/paasta_api/client/service/delay_instance_responses.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" +) + +// DelayInstanceReader is a Reader for the DelayInstance structure. +type DelayInstanceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DelayInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDelayInstanceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 204: + result := NewDelayInstanceNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewDelayInstanceNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDelayInstanceInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDelayInstanceOK creates a DelayInstanceOK with default headers values +func NewDelayInstanceOK() *DelayInstanceOK { + return &DelayInstanceOK{} +} + +/*DelayInstanceOK handles this case with default header values. + +The service is delayed for these possible reasons +*/ +type DelayInstanceOK struct { + Payload models.InstanceDelay +} + +func (o *DelayInstanceOK) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/delay][%d] delayInstanceOK %+v", 200, o.Payload) +} + +func (o *DelayInstanceOK) GetPayload() models.InstanceDelay { + return o.Payload +} + +func (o *DelayInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDelayInstanceNoContent creates a DelayInstanceNoContent with default headers values +func NewDelayInstanceNoContent() *DelayInstanceNoContent { + return &DelayInstanceNoContent{} +} + +/*DelayInstanceNoContent handles this case with default header values. + +Could not find any reasons for a delay +*/ +type DelayInstanceNoContent struct { +} + +func (o *DelayInstanceNoContent) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/delay][%d] delayInstanceNoContent ", 204) +} + +func (o *DelayInstanceNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDelayInstanceNotFound creates a DelayInstanceNotFound with default headers values +func NewDelayInstanceNotFound() *DelayInstanceNotFound { + return &DelayInstanceNotFound{} +} + +/*DelayInstanceNotFound handles this case with default header values. + +Deployment key not found +*/ +type DelayInstanceNotFound struct { +} + +func (o *DelayInstanceNotFound) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/delay][%d] delayInstanceNotFound ", 404) +} + +func (o *DelayInstanceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDelayInstanceInternalServerError creates a DelayInstanceInternalServerError with default headers values +func NewDelayInstanceInternalServerError() *DelayInstanceInternalServerError { + return &DelayInstanceInternalServerError{} +} + +/*DelayInstanceInternalServerError handles this case with default header values. + +Instance failure +*/ +type DelayInstanceInternalServerError struct { +} + +func (o *DelayInstanceInternalServerError) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/delay][%d] delayInstanceInternalServerError ", 500) +} + +func (o *DelayInstanceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/paasta_api/client/service/instance_set_state_parameters.go b/pkg/paasta_api/client/service/instance_set_state_parameters.go new file mode 100644 index 0000000..3359d4e --- /dev/null +++ b/pkg/paasta_api/client/service/instance_set_state_parameters.go @@ -0,0 +1,177 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewInstanceSetStateParams creates a new InstanceSetStateParams object +// with the default values initialized. +func NewInstanceSetStateParams() *InstanceSetStateParams { + var () + return &InstanceSetStateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewInstanceSetStateParamsWithTimeout creates a new InstanceSetStateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewInstanceSetStateParamsWithTimeout(timeout time.Duration) *InstanceSetStateParams { + var () + return &InstanceSetStateParams{ + + timeout: timeout, + } +} + +// NewInstanceSetStateParamsWithContext creates a new InstanceSetStateParams object +// with the default values initialized, and the ability to set a context for a request +func NewInstanceSetStateParamsWithContext(ctx context.Context) *InstanceSetStateParams { + var () + return &InstanceSetStateParams{ + + Context: ctx, + } +} + +// NewInstanceSetStateParamsWithHTTPClient creates a new InstanceSetStateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewInstanceSetStateParamsWithHTTPClient(client *http.Client) *InstanceSetStateParams { + var () + return &InstanceSetStateParams{ + HTTPClient: client, + } +} + +/*InstanceSetStateParams contains all the parameters to send to the API endpoint +for the instance set state operation typically these are written to a http.Request +*/ +type InstanceSetStateParams struct { + + /*DesiredState + Desired state + + */ + DesiredState string + /*Instance + Instance name + + */ + Instance string + /*Service + Service name + + */ + Service string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the instance set state params +func (o *InstanceSetStateParams) WithTimeout(timeout time.Duration) *InstanceSetStateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the instance set state params +func (o *InstanceSetStateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the instance set state params +func (o *InstanceSetStateParams) WithContext(ctx context.Context) *InstanceSetStateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the instance set state params +func (o *InstanceSetStateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the instance set state params +func (o *InstanceSetStateParams) WithHTTPClient(client *http.Client) *InstanceSetStateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the instance set state params +func (o *InstanceSetStateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDesiredState adds the desiredState to the instance set state params +func (o *InstanceSetStateParams) WithDesiredState(desiredState string) *InstanceSetStateParams { + o.SetDesiredState(desiredState) + return o +} + +// SetDesiredState adds the desiredState to the instance set state params +func (o *InstanceSetStateParams) SetDesiredState(desiredState string) { + o.DesiredState = desiredState +} + +// WithInstance adds the instance to the instance set state params +func (o *InstanceSetStateParams) WithInstance(instance string) *InstanceSetStateParams { + o.SetInstance(instance) + return o +} + +// SetInstance adds the instance to the instance set state params +func (o *InstanceSetStateParams) SetInstance(instance string) { + o.Instance = instance +} + +// WithService adds the service to the instance set state params +func (o *InstanceSetStateParams) WithService(service string) *InstanceSetStateParams { + o.SetService(service) + return o +} + +// SetService adds the service to the instance set state params +func (o *InstanceSetStateParams) SetService(service string) { + o.Service = service +} + +// WriteToRequest writes these params to a swagger request +func (o *InstanceSetStateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param desired_state + if err := r.SetPathParam("desired_state", o.DesiredState); err != nil { + return err + } + + // path param instance + if err := r.SetPathParam("instance", o.Instance); err != nil { + return err + } + + // path param service + if err := r.SetPathParam("service", o.Service); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/client/service/instance_set_state_responses.go b/pkg/paasta_api/client/service/instance_set_state_responses.go new file mode 100644 index 0000000..d5a8496 --- /dev/null +++ b/pkg/paasta_api/client/service/instance_set_state_responses.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// InstanceSetStateReader is a Reader for the InstanceSetState structure. +type InstanceSetStateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *InstanceSetStateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewInstanceSetStateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewInstanceSetStateNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewInstanceSetStateInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewInstanceSetStateOK creates a InstanceSetStateOK with default headers values +func NewInstanceSetStateOK() *InstanceSetStateOK { + return &InstanceSetStateOK{} +} + +/*InstanceSetStateOK handles this case with default header values. + +Result of instance state change +*/ +type InstanceSetStateOK struct { +} + +func (o *InstanceSetStateOK) Error() string { + return fmt.Sprintf("[POST /services/{service}/{instance}/state/{desired_state}][%d] instanceSetStateOK ", 200) +} + +func (o *InstanceSetStateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewInstanceSetStateNotFound creates a InstanceSetStateNotFound with default headers values +func NewInstanceSetStateNotFound() *InstanceSetStateNotFound { + return &InstanceSetStateNotFound{} +} + +/*InstanceSetStateNotFound handles this case with default header values. + +Deployment key not found +*/ +type InstanceSetStateNotFound struct { +} + +func (o *InstanceSetStateNotFound) Error() string { + return fmt.Sprintf("[POST /services/{service}/{instance}/state/{desired_state}][%d] instanceSetStateNotFound ", 404) +} + +func (o *InstanceSetStateNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewInstanceSetStateInternalServerError creates a InstanceSetStateInternalServerError with default headers values +func NewInstanceSetStateInternalServerError() *InstanceSetStateInternalServerError { + return &InstanceSetStateInternalServerError{} +} + +/*InstanceSetStateInternalServerError handles this case with default header values. + +Instance failure +*/ +type InstanceSetStateInternalServerError struct { +} + +func (o *InstanceSetStateInternalServerError) Error() string { + return fmt.Sprintf("[POST /services/{service}/{instance}/state/{desired_state}][%d] instanceSetStateInternalServerError ", 500) +} + +func (o *InstanceSetStateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/paasta_api/client/service/list_instances_parameters.go b/pkg/paasta_api/client/service/list_instances_parameters.go new file mode 100644 index 0000000..e36e755 --- /dev/null +++ b/pkg/paasta_api/client/service/list_instances_parameters.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListInstancesParams creates a new ListInstancesParams object +// with the default values initialized. +func NewListInstancesParams() *ListInstancesParams { + var () + return &ListInstancesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListInstancesParamsWithTimeout creates a new ListInstancesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListInstancesParamsWithTimeout(timeout time.Duration) *ListInstancesParams { + var () + return &ListInstancesParams{ + + timeout: timeout, + } +} + +// NewListInstancesParamsWithContext creates a new ListInstancesParams object +// with the default values initialized, and the ability to set a context for a request +func NewListInstancesParamsWithContext(ctx context.Context) *ListInstancesParams { + var () + return &ListInstancesParams{ + + Context: ctx, + } +} + +// NewListInstancesParamsWithHTTPClient creates a new ListInstancesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListInstancesParamsWithHTTPClient(client *http.Client) *ListInstancesParams { + var () + return &ListInstancesParams{ + HTTPClient: client, + } +} + +/*ListInstancesParams contains all the parameters to send to the API endpoint +for the list instances operation typically these are written to a http.Request +*/ +type ListInstancesParams struct { + + /*Service + Service name + + */ + Service string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list instances params +func (o *ListInstancesParams) WithTimeout(timeout time.Duration) *ListInstancesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list instances params +func (o *ListInstancesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list instances params +func (o *ListInstancesParams) WithContext(ctx context.Context) *ListInstancesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list instances params +func (o *ListInstancesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list instances params +func (o *ListInstancesParams) WithHTTPClient(client *http.Client) *ListInstancesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list instances params +func (o *ListInstancesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithService adds the service to the list instances params +func (o *ListInstancesParams) WithService(service string) *ListInstancesParams { + o.SetService(service) + return o +} + +// SetService adds the service to the list instances params +func (o *ListInstancesParams) SetService(service string) { + o.Service = service +} + +// WriteToRequest writes these params to a swagger request +func (o *ListInstancesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param service + if err := r.SetPathParam("service", o.Service); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/client/service/list_instances_responses.go b/pkg/paasta_api/client/service/list_instances_responses.go new file mode 100644 index 0000000..0ca8f18 --- /dev/null +++ b/pkg/paasta_api/client/service/list_instances_responses.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ListInstancesReader is a Reader for the ListInstances structure. +type ListInstancesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListInstancesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListInstancesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewListInstancesOK creates a ListInstancesOK with default headers values +func NewListInstancesOK() *ListInstancesOK { + return &ListInstancesOK{} +} + +/*ListInstancesOK handles this case with default header values. + +Instances of a service +*/ +type ListInstancesOK struct { + Payload *ListInstancesOKBody +} + +func (o *ListInstancesOK) Error() string { + return fmt.Sprintf("[GET /services/{service}][%d] listInstancesOK %+v", 200, o.Payload) +} + +func (o *ListInstancesOK) GetPayload() *ListInstancesOKBody { + return o.Payload +} + +func (o *ListInstancesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ListInstancesOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*ListInstancesOKBody list instances o k body +swagger:model ListInstancesOKBody +*/ +type ListInstancesOKBody struct { + + // instances + Instances []string `json:"instances"` +} + +// Validate validates this list instances o k body +func (o *ListInstancesOKBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ListInstancesOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListInstancesOKBody) UnmarshalBinary(b []byte) error { + var res ListInstancesOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/pkg/paasta_api/client/service/list_services_for_cluster_parameters.go b/pkg/paasta_api/client/service/list_services_for_cluster_parameters.go new file mode 100644 index 0000000..d2c6416 --- /dev/null +++ b/pkg/paasta_api/client/service/list_services_for_cluster_parameters.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListServicesForClusterParams creates a new ListServicesForClusterParams object +// with the default values initialized. +func NewListServicesForClusterParams() *ListServicesForClusterParams { + + return &ListServicesForClusterParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListServicesForClusterParamsWithTimeout creates a new ListServicesForClusterParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListServicesForClusterParamsWithTimeout(timeout time.Duration) *ListServicesForClusterParams { + + return &ListServicesForClusterParams{ + + timeout: timeout, + } +} + +// NewListServicesForClusterParamsWithContext creates a new ListServicesForClusterParams object +// with the default values initialized, and the ability to set a context for a request +func NewListServicesForClusterParamsWithContext(ctx context.Context) *ListServicesForClusterParams { + + return &ListServicesForClusterParams{ + + Context: ctx, + } +} + +// NewListServicesForClusterParamsWithHTTPClient creates a new ListServicesForClusterParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListServicesForClusterParamsWithHTTPClient(client *http.Client) *ListServicesForClusterParams { + + return &ListServicesForClusterParams{ + HTTPClient: client, + } +} + +/*ListServicesForClusterParams contains all the parameters to send to the API endpoint +for the list services for cluster operation typically these are written to a http.Request +*/ +type ListServicesForClusterParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list services for cluster params +func (o *ListServicesForClusterParams) WithTimeout(timeout time.Duration) *ListServicesForClusterParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list services for cluster params +func (o *ListServicesForClusterParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list services for cluster params +func (o *ListServicesForClusterParams) WithContext(ctx context.Context) *ListServicesForClusterParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list services for cluster params +func (o *ListServicesForClusterParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list services for cluster params +func (o *ListServicesForClusterParams) WithHTTPClient(client *http.Client) *ListServicesForClusterParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list services for cluster params +func (o *ListServicesForClusterParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ListServicesForClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/client/service/list_services_for_cluster_responses.go b/pkg/paasta_api/client/service/list_services_for_cluster_responses.go new file mode 100644 index 0000000..d17c09b --- /dev/null +++ b/pkg/paasta_api/client/service/list_services_for_cluster_responses.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ListServicesForClusterReader is a Reader for the ListServicesForCluster structure. +type ListServicesForClusterReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListServicesForClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListServicesForClusterOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewListServicesForClusterOK creates a ListServicesForClusterOK with default headers values +func NewListServicesForClusterOK() *ListServicesForClusterOK { + return &ListServicesForClusterOK{} +} + +/*ListServicesForClusterOK handles this case with default header values. + +Services and their instances on the current cluster +*/ +type ListServicesForClusterOK struct { + Payload *ListServicesForClusterOKBody +} + +func (o *ListServicesForClusterOK) Error() string { + return fmt.Sprintf("[GET /services][%d] listServicesForClusterOK %+v", 200, o.Payload) +} + +func (o *ListServicesForClusterOK) GetPayload() *ListServicesForClusterOKBody { + return o.Payload +} + +func (o *ListServicesForClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ListServicesForClusterOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*ListServicesForClusterOKBody list services for cluster o k body +swagger:model ListServicesForClusterOKBody +*/ +type ListServicesForClusterOKBody struct { + + // services + Services [][]interface{} `json:"services"` +} + +// Validate validates this list services for cluster o k body +func (o *ListServicesForClusterOKBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ListServicesForClusterOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListServicesForClusterOKBody) UnmarshalBinary(b []byte) error { + var res ListServicesForClusterOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/pkg/paasta_api/client/service/service_client.go b/pkg/paasta_api/client/service/service_client.go new file mode 100644 index 0000000..0edf5a3 --- /dev/null +++ b/pkg/paasta_api/client/service/service_client.go @@ -0,0 +1,289 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new service API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for service API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DelayInstance(params *DelayInstanceParams) (*DelayInstanceOK, *DelayInstanceNoContent, error) + + InstanceSetState(params *InstanceSetStateParams) (*InstanceSetStateOK, error) + + ListInstances(params *ListInstancesParams) (*ListInstancesOK, error) + + ListServicesForCluster(params *ListServicesForClusterParams) (*ListServicesForClusterOK, error) + + StatusInstance(params *StatusInstanceParams) (*StatusInstanceOK, error) + + TaskInstance(params *TaskInstanceParams) (*TaskInstanceOK, error) + + TasksInstance(params *TasksInstanceParams) (*TasksInstanceOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DelayInstance gets the possible reasons for a deployment delay for a marathon service instance +*/ +func (a *Client) DelayInstance(params *DelayInstanceParams) (*DelayInstanceOK, *DelayInstanceNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDelayInstanceParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "delay_instance", + Method: "GET", + PathPattern: "/services/{service}/{instance}/delay", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DelayInstanceReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *DelayInstanceOK: + return value, nil, nil + case *DelayInstanceNoContent: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for service: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + InstanceSetState changes state of service name instance name +*/ +func (a *Client) InstanceSetState(params *InstanceSetStateParams) (*InstanceSetStateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewInstanceSetStateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "instance_set_state", + Method: "POST", + PathPattern: "/services/{service}/{instance}/state/{desired_state}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &InstanceSetStateReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*InstanceSetStateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for instance_set_state: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ListInstances lists instances of service name +*/ +func (a *Client) ListInstances(params *ListInstancesParams) (*ListInstancesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListInstancesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "list_instances", + Method: "GET", + PathPattern: "/services/{service}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ListInstancesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ListInstancesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for list_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ListServicesForCluster lists service names and service instance names on the current cluster +*/ +func (a *Client) ListServicesForCluster(params *ListServicesForClusterParams) (*ListServicesForClusterOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListServicesForClusterParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "list_services_for_cluster", + Method: "GET", + PathPattern: "/services", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ListServicesForClusterReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ListServicesForClusterOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for list_services_for_cluster: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + StatusInstance gets status of service name instance name +*/ +func (a *Client) StatusInstance(params *StatusInstanceParams) (*StatusInstanceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStatusInstanceParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "status_instance", + Method: "GET", + PathPattern: "/services/{service}/{instance}/status", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StatusInstanceReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StatusInstanceOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for status_instance: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TaskInstance gets mesos task of service name instance name by task id +*/ +func (a *Client) TaskInstance(params *TaskInstanceParams) (*TaskInstanceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTaskInstanceParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "task_instance", + Method: "GET", + PathPattern: "/services/{service}/{instance}/tasks/{task_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TaskInstanceReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TaskInstanceOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for task_instance: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TasksInstance gets mesos tasks of service name instance name +*/ +func (a *Client) TasksInstance(params *TasksInstanceParams) (*TasksInstanceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTasksInstanceParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tasks_instance", + Method: "GET", + PathPattern: "/services/{service}/{instance}/tasks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TasksInstanceReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TasksInstanceOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tasks_instance: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/paasta_api/client/service/status_instance_parameters.go b/pkg/paasta_api/client/service/status_instance_parameters.go new file mode 100644 index 0000000..c20547d --- /dev/null +++ b/pkg/paasta_api/client/service/status_instance_parameters.go @@ -0,0 +1,285 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStatusInstanceParams creates a new StatusInstanceParams object +// with the default values initialized. +func NewStatusInstanceParams() *StatusInstanceParams { + var () + return &StatusInstanceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStatusInstanceParamsWithTimeout creates a new StatusInstanceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStatusInstanceParamsWithTimeout(timeout time.Duration) *StatusInstanceParams { + var () + return &StatusInstanceParams{ + + timeout: timeout, + } +} + +// NewStatusInstanceParamsWithContext creates a new StatusInstanceParams object +// with the default values initialized, and the ability to set a context for a request +func NewStatusInstanceParamsWithContext(ctx context.Context) *StatusInstanceParams { + var () + return &StatusInstanceParams{ + + Context: ctx, + } +} + +// NewStatusInstanceParamsWithHTTPClient creates a new StatusInstanceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStatusInstanceParamsWithHTTPClient(client *http.Client) *StatusInstanceParams { + var () + return &StatusInstanceParams{ + HTTPClient: client, + } +} + +/*StatusInstanceParams contains all the parameters to send to the API endpoint +for the status instance operation typically these are written to a http.Request +*/ +type StatusInstanceParams struct { + + /*IncludeEnvoy + Include Envoy information + + */ + IncludeEnvoy *bool + /*IncludeMesos + Include Mesos information + + */ + IncludeMesos *bool + /*IncludeSmartstack + Include Smartstack information + + */ + IncludeSmartstack *bool + /*Instance + Instance name + + */ + Instance string + /*Service + Service name + + */ + Service string + /*Verbose + Include verbose status information + + */ + Verbose *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the status instance params +func (o *StatusInstanceParams) WithTimeout(timeout time.Duration) *StatusInstanceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the status instance params +func (o *StatusInstanceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the status instance params +func (o *StatusInstanceParams) WithContext(ctx context.Context) *StatusInstanceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the status instance params +func (o *StatusInstanceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the status instance params +func (o *StatusInstanceParams) WithHTTPClient(client *http.Client) *StatusInstanceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the status instance params +func (o *StatusInstanceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncludeEnvoy adds the includeEnvoy to the status instance params +func (o *StatusInstanceParams) WithIncludeEnvoy(includeEnvoy *bool) *StatusInstanceParams { + o.SetIncludeEnvoy(includeEnvoy) + return o +} + +// SetIncludeEnvoy adds the includeEnvoy to the status instance params +func (o *StatusInstanceParams) SetIncludeEnvoy(includeEnvoy *bool) { + o.IncludeEnvoy = includeEnvoy +} + +// WithIncludeMesos adds the includeMesos to the status instance params +func (o *StatusInstanceParams) WithIncludeMesos(includeMesos *bool) *StatusInstanceParams { + o.SetIncludeMesos(includeMesos) + return o +} + +// SetIncludeMesos adds the includeMesos to the status instance params +func (o *StatusInstanceParams) SetIncludeMesos(includeMesos *bool) { + o.IncludeMesos = includeMesos +} + +// WithIncludeSmartstack adds the includeSmartstack to the status instance params +func (o *StatusInstanceParams) WithIncludeSmartstack(includeSmartstack *bool) *StatusInstanceParams { + o.SetIncludeSmartstack(includeSmartstack) + return o +} + +// SetIncludeSmartstack adds the includeSmartstack to the status instance params +func (o *StatusInstanceParams) SetIncludeSmartstack(includeSmartstack *bool) { + o.IncludeSmartstack = includeSmartstack +} + +// WithInstance adds the instance to the status instance params +func (o *StatusInstanceParams) WithInstance(instance string) *StatusInstanceParams { + o.SetInstance(instance) + return o +} + +// SetInstance adds the instance to the status instance params +func (o *StatusInstanceParams) SetInstance(instance string) { + o.Instance = instance +} + +// WithService adds the service to the status instance params +func (o *StatusInstanceParams) WithService(service string) *StatusInstanceParams { + o.SetService(service) + return o +} + +// SetService adds the service to the status instance params +func (o *StatusInstanceParams) SetService(service string) { + o.Service = service +} + +// WithVerbose adds the verbose to the status instance params +func (o *StatusInstanceParams) WithVerbose(verbose *int32) *StatusInstanceParams { + o.SetVerbose(verbose) + return o +} + +// SetVerbose adds the verbose to the status instance params +func (o *StatusInstanceParams) SetVerbose(verbose *int32) { + o.Verbose = verbose +} + +// WriteToRequest writes these params to a swagger request +func (o *StatusInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.IncludeEnvoy != nil { + + // query param include_envoy + var qrIncludeEnvoy bool + if o.IncludeEnvoy != nil { + qrIncludeEnvoy = *o.IncludeEnvoy + } + qIncludeEnvoy := swag.FormatBool(qrIncludeEnvoy) + if qIncludeEnvoy != "" { + if err := r.SetQueryParam("include_envoy", qIncludeEnvoy); err != nil { + return err + } + } + + } + + if o.IncludeMesos != nil { + + // query param include_mesos + var qrIncludeMesos bool + if o.IncludeMesos != nil { + qrIncludeMesos = *o.IncludeMesos + } + qIncludeMesos := swag.FormatBool(qrIncludeMesos) + if qIncludeMesos != "" { + if err := r.SetQueryParam("include_mesos", qIncludeMesos); err != nil { + return err + } + } + + } + + if o.IncludeSmartstack != nil { + + // query param include_smartstack + var qrIncludeSmartstack bool + if o.IncludeSmartstack != nil { + qrIncludeSmartstack = *o.IncludeSmartstack + } + qIncludeSmartstack := swag.FormatBool(qrIncludeSmartstack) + if qIncludeSmartstack != "" { + if err := r.SetQueryParam("include_smartstack", qIncludeSmartstack); err != nil { + return err + } + } + + } + + // path param instance + if err := r.SetPathParam("instance", o.Instance); err != nil { + return err + } + + // path param service + if err := r.SetPathParam("service", o.Service); err != nil { + return err + } + + if o.Verbose != nil { + + // query param verbose + var qrVerbose int32 + if o.Verbose != nil { + qrVerbose = *o.Verbose + } + qVerbose := swag.FormatInt32(qrVerbose) + if qVerbose != "" { + if err := r.SetQueryParam("verbose", qVerbose); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/client/service/status_instance_responses.go b/pkg/paasta_api/client/service/status_instance_responses.go new file mode 100644 index 0000000..bd4acb7 --- /dev/null +++ b/pkg/paasta_api/client/service/status_instance_responses.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" +) + +// StatusInstanceReader is a Reader for the StatusInstance structure. +type StatusInstanceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StatusInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStatusInstanceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewStatusInstanceNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewStatusInstanceInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewStatusInstanceOK creates a StatusInstanceOK with default headers values +func NewStatusInstanceOK() *StatusInstanceOK { + return &StatusInstanceOK{} +} + +/*StatusInstanceOK handles this case with default header values. + +Detailed status of an instance +*/ +type StatusInstanceOK struct { + Payload *models.InstanceStatus +} + +func (o *StatusInstanceOK) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/status][%d] statusInstanceOK %+v", 200, o.Payload) +} + +func (o *StatusInstanceOK) GetPayload() *models.InstanceStatus { + return o.Payload +} + +func (o *StatusInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InstanceStatus) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStatusInstanceNotFound creates a StatusInstanceNotFound with default headers values +func NewStatusInstanceNotFound() *StatusInstanceNotFound { + return &StatusInstanceNotFound{} +} + +/*StatusInstanceNotFound handles this case with default header values. + +Deployment key not found +*/ +type StatusInstanceNotFound struct { +} + +func (o *StatusInstanceNotFound) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/status][%d] statusInstanceNotFound ", 404) +} + +func (o *StatusInstanceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStatusInstanceInternalServerError creates a StatusInstanceInternalServerError with default headers values +func NewStatusInstanceInternalServerError() *StatusInstanceInternalServerError { + return &StatusInstanceInternalServerError{} +} + +/*StatusInstanceInternalServerError handles this case with default header values. + +Instance failure +*/ +type StatusInstanceInternalServerError struct { +} + +func (o *StatusInstanceInternalServerError) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/status][%d] statusInstanceInternalServerError ", 500) +} + +func (o *StatusInstanceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/paasta_api/client/service/task_instance_parameters.go b/pkg/paasta_api/client/service/task_instance_parameters.go new file mode 100644 index 0000000..9cada39 --- /dev/null +++ b/pkg/paasta_api/client/service/task_instance_parameters.go @@ -0,0 +1,210 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewTaskInstanceParams creates a new TaskInstanceParams object +// with the default values initialized. +func NewTaskInstanceParams() *TaskInstanceParams { + var () + return &TaskInstanceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTaskInstanceParamsWithTimeout creates a new TaskInstanceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTaskInstanceParamsWithTimeout(timeout time.Duration) *TaskInstanceParams { + var () + return &TaskInstanceParams{ + + timeout: timeout, + } +} + +// NewTaskInstanceParamsWithContext creates a new TaskInstanceParams object +// with the default values initialized, and the ability to set a context for a request +func NewTaskInstanceParamsWithContext(ctx context.Context) *TaskInstanceParams { + var () + return &TaskInstanceParams{ + + Context: ctx, + } +} + +// NewTaskInstanceParamsWithHTTPClient creates a new TaskInstanceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTaskInstanceParamsWithHTTPClient(client *http.Client) *TaskInstanceParams { + var () + return &TaskInstanceParams{ + HTTPClient: client, + } +} + +/*TaskInstanceParams contains all the parameters to send to the API endpoint +for the task instance operation typically these are written to a http.Request +*/ +type TaskInstanceParams struct { + + /*Instance + Instance name + + */ + Instance string + /*Service + Service name + + */ + Service string + /*TaskID + mesos task id + + */ + TaskID string + /*Verbose + Return slave and executor for task + + */ + Verbose *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the task instance params +func (o *TaskInstanceParams) WithTimeout(timeout time.Duration) *TaskInstanceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the task instance params +func (o *TaskInstanceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the task instance params +func (o *TaskInstanceParams) WithContext(ctx context.Context) *TaskInstanceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the task instance params +func (o *TaskInstanceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the task instance params +func (o *TaskInstanceParams) WithHTTPClient(client *http.Client) *TaskInstanceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the task instance params +func (o *TaskInstanceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInstance adds the instance to the task instance params +func (o *TaskInstanceParams) WithInstance(instance string) *TaskInstanceParams { + o.SetInstance(instance) + return o +} + +// SetInstance adds the instance to the task instance params +func (o *TaskInstanceParams) SetInstance(instance string) { + o.Instance = instance +} + +// WithService adds the service to the task instance params +func (o *TaskInstanceParams) WithService(service string) *TaskInstanceParams { + o.SetService(service) + return o +} + +// SetService adds the service to the task instance params +func (o *TaskInstanceParams) SetService(service string) { + o.Service = service +} + +// WithTaskID adds the taskID to the task instance params +func (o *TaskInstanceParams) WithTaskID(taskID string) *TaskInstanceParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the task instance params +func (o *TaskInstanceParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WithVerbose adds the verbose to the task instance params +func (o *TaskInstanceParams) WithVerbose(verbose *bool) *TaskInstanceParams { + o.SetVerbose(verbose) + return o +} + +// SetVerbose adds the verbose to the task instance params +func (o *TaskInstanceParams) SetVerbose(verbose *bool) { + o.Verbose = verbose +} + +// WriteToRequest writes these params to a swagger request +func (o *TaskInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param instance + if err := r.SetPathParam("instance", o.Instance); err != nil { + return err + } + + // path param service + if err := r.SetPathParam("service", o.Service); err != nil { + return err + } + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + if o.Verbose != nil { + + // query param verbose + var qrVerbose bool + if o.Verbose != nil { + qrVerbose = *o.Verbose + } + qVerbose := swag.FormatBool(qrVerbose) + if qVerbose != "" { + if err := r.SetQueryParam("verbose", qVerbose); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/client/service/task_instance_responses.go b/pkg/paasta_api/client/service/task_instance_responses.go new file mode 100644 index 0000000..7c98023 --- /dev/null +++ b/pkg/paasta_api/client/service/task_instance_responses.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" +) + +// TaskInstanceReader is a Reader for the TaskInstance structure. +type TaskInstanceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TaskInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTaskInstanceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewTaskInstanceBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewTaskInstanceNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewTaskInstanceInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTaskInstanceOK creates a TaskInstanceOK with default headers values +func NewTaskInstanceOK() *TaskInstanceOK { + return &TaskInstanceOK{} +} + +/*TaskInstanceOK handles this case with default header values. + +Task associated with an instance with specified ID +*/ +type TaskInstanceOK struct { + Payload models.InstanceTask +} + +func (o *TaskInstanceOK) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/tasks/{task_id}][%d] taskInstanceOK %+v", 200, o.Payload) +} + +func (o *TaskInstanceOK) GetPayload() models.InstanceTask { + return o.Payload +} + +func (o *TaskInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewTaskInstanceBadRequest creates a TaskInstanceBadRequest with default headers values +func NewTaskInstanceBadRequest() *TaskInstanceBadRequest { + return &TaskInstanceBadRequest{} +} + +/*TaskInstanceBadRequest handles this case with default header values. + +Bad request +*/ +type TaskInstanceBadRequest struct { +} + +func (o *TaskInstanceBadRequest) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/tasks/{task_id}][%d] taskInstanceBadRequest ", 400) +} + +func (o *TaskInstanceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewTaskInstanceNotFound creates a TaskInstanceNotFound with default headers values +func NewTaskInstanceNotFound() *TaskInstanceNotFound { + return &TaskInstanceNotFound{} +} + +/*TaskInstanceNotFound handles this case with default header values. + +Task with ID not found +*/ +type TaskInstanceNotFound struct { +} + +func (o *TaskInstanceNotFound) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/tasks/{task_id}][%d] taskInstanceNotFound ", 404) +} + +func (o *TaskInstanceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewTaskInstanceInternalServerError creates a TaskInstanceInternalServerError with default headers values +func NewTaskInstanceInternalServerError() *TaskInstanceInternalServerError { + return &TaskInstanceInternalServerError{} +} + +/*TaskInstanceInternalServerError handles this case with default header values. + +Instance failure +*/ +type TaskInstanceInternalServerError struct { +} + +func (o *TaskInstanceInternalServerError) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/tasks/{task_id}][%d] taskInstanceInternalServerError ", 500) +} + +func (o *TaskInstanceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/paasta_api/client/service/tasks_instance_parameters.go b/pkg/paasta_api/client/service/tasks_instance_parameters.go new file mode 100644 index 0000000..fbb920f --- /dev/null +++ b/pkg/paasta_api/client/service/tasks_instance_parameters.go @@ -0,0 +1,221 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewTasksInstanceParams creates a new TasksInstanceParams object +// with the default values initialized. +func NewTasksInstanceParams() *TasksInstanceParams { + var () + return &TasksInstanceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTasksInstanceParamsWithTimeout creates a new TasksInstanceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTasksInstanceParamsWithTimeout(timeout time.Duration) *TasksInstanceParams { + var () + return &TasksInstanceParams{ + + timeout: timeout, + } +} + +// NewTasksInstanceParamsWithContext creates a new TasksInstanceParams object +// with the default values initialized, and the ability to set a context for a request +func NewTasksInstanceParamsWithContext(ctx context.Context) *TasksInstanceParams { + var () + return &TasksInstanceParams{ + + Context: ctx, + } +} + +// NewTasksInstanceParamsWithHTTPClient creates a new TasksInstanceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTasksInstanceParamsWithHTTPClient(client *http.Client) *TasksInstanceParams { + var () + return &TasksInstanceParams{ + HTTPClient: client, + } +} + +/*TasksInstanceParams contains all the parameters to send to the API endpoint +for the tasks instance operation typically these are written to a http.Request +*/ +type TasksInstanceParams struct { + + /*Instance + Instance name + + */ + Instance string + /*Service + Service name + + */ + Service string + /*SlaveHostname + slave hostname to filter tasks by + + */ + SlaveHostname *string + /*Verbose + Return slave and executor for task + + */ + Verbose *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tasks instance params +func (o *TasksInstanceParams) WithTimeout(timeout time.Duration) *TasksInstanceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tasks instance params +func (o *TasksInstanceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tasks instance params +func (o *TasksInstanceParams) WithContext(ctx context.Context) *TasksInstanceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tasks instance params +func (o *TasksInstanceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tasks instance params +func (o *TasksInstanceParams) WithHTTPClient(client *http.Client) *TasksInstanceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tasks instance params +func (o *TasksInstanceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInstance adds the instance to the tasks instance params +func (o *TasksInstanceParams) WithInstance(instance string) *TasksInstanceParams { + o.SetInstance(instance) + return o +} + +// SetInstance adds the instance to the tasks instance params +func (o *TasksInstanceParams) SetInstance(instance string) { + o.Instance = instance +} + +// WithService adds the service to the tasks instance params +func (o *TasksInstanceParams) WithService(service string) *TasksInstanceParams { + o.SetService(service) + return o +} + +// SetService adds the service to the tasks instance params +func (o *TasksInstanceParams) SetService(service string) { + o.Service = service +} + +// WithSlaveHostname adds the slaveHostname to the tasks instance params +func (o *TasksInstanceParams) WithSlaveHostname(slaveHostname *string) *TasksInstanceParams { + o.SetSlaveHostname(slaveHostname) + return o +} + +// SetSlaveHostname adds the slaveHostname to the tasks instance params +func (o *TasksInstanceParams) SetSlaveHostname(slaveHostname *string) { + o.SlaveHostname = slaveHostname +} + +// WithVerbose adds the verbose to the tasks instance params +func (o *TasksInstanceParams) WithVerbose(verbose *bool) *TasksInstanceParams { + o.SetVerbose(verbose) + return o +} + +// SetVerbose adds the verbose to the tasks instance params +func (o *TasksInstanceParams) SetVerbose(verbose *bool) { + o.Verbose = verbose +} + +// WriteToRequest writes these params to a swagger request +func (o *TasksInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param instance + if err := r.SetPathParam("instance", o.Instance); err != nil { + return err + } + + // path param service + if err := r.SetPathParam("service", o.Service); err != nil { + return err + } + + if o.SlaveHostname != nil { + + // query param slave_hostname + var qrSlaveHostname string + if o.SlaveHostname != nil { + qrSlaveHostname = *o.SlaveHostname + } + qSlaveHostname := qrSlaveHostname + if qSlaveHostname != "" { + if err := r.SetQueryParam("slave_hostname", qSlaveHostname); err != nil { + return err + } + } + + } + + if o.Verbose != nil { + + // query param verbose + var qrVerbose bool + if o.Verbose != nil { + qrVerbose = *o.Verbose + } + qVerbose := swag.FormatBool(qrVerbose) + if qVerbose != "" { + if err := r.SetQueryParam("verbose", qVerbose); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/client/service/tasks_instance_responses.go b/pkg/paasta_api/client/service/tasks_instance_responses.go new file mode 100644 index 0000000..aaacc5a --- /dev/null +++ b/pkg/paasta_api/client/service/tasks_instance_responses.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" +) + +// TasksInstanceReader is a Reader for the TasksInstance structure. +type TasksInstanceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TasksInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTasksInstanceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewTasksInstanceBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewTasksInstanceNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewTasksInstanceInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTasksInstanceOK creates a TasksInstanceOK with default headers values +func NewTasksInstanceOK() *TasksInstanceOK { + return &TasksInstanceOK{} +} + +/*TasksInstanceOK handles this case with default header values. + +List of tasks associated with an instance +*/ +type TasksInstanceOK struct { + Payload models.InstanceTasks +} + +func (o *TasksInstanceOK) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/tasks][%d] tasksInstanceOK %+v", 200, o.Payload) +} + +func (o *TasksInstanceOK) GetPayload() models.InstanceTasks { + return o.Payload +} + +func (o *TasksInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewTasksInstanceBadRequest creates a TasksInstanceBadRequest with default headers values +func NewTasksInstanceBadRequest() *TasksInstanceBadRequest { + return &TasksInstanceBadRequest{} +} + +/*TasksInstanceBadRequest handles this case with default header values. + +Bad request +*/ +type TasksInstanceBadRequest struct { +} + +func (o *TasksInstanceBadRequest) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/tasks][%d] tasksInstanceBadRequest ", 400) +} + +func (o *TasksInstanceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewTasksInstanceNotFound creates a TasksInstanceNotFound with default headers values +func NewTasksInstanceNotFound() *TasksInstanceNotFound { + return &TasksInstanceNotFound{} +} + +/*TasksInstanceNotFound handles this case with default header values. + +Deployment key not found +*/ +type TasksInstanceNotFound struct { +} + +func (o *TasksInstanceNotFound) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/tasks][%d] tasksInstanceNotFound ", 404) +} + +func (o *TasksInstanceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewTasksInstanceInternalServerError creates a TasksInstanceInternalServerError with default headers values +func NewTasksInstanceInternalServerError() *TasksInstanceInternalServerError { + return &TasksInstanceInternalServerError{} +} + +/*TasksInstanceInternalServerError handles this case with default header values. + +Instance failure +*/ +type TasksInstanceInternalServerError struct { +} + +func (o *TasksInstanceInternalServerError) Error() string { + return fmt.Sprintf("[GET /services/{service}/{instance}/tasks][%d] tasksInstanceInternalServerError ", 500) +} + +func (o *TasksInstanceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/paasta_api/models/adhoc_launch_history.go b/pkg/paasta_api/models/adhoc_launch_history.go new file mode 100644 index 0000000..eb964a3 --- /dev/null +++ b/pkg/paasta_api/models/adhoc_launch_history.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AdhocLaunchHistory A single run +// +// swagger:model AdhocLaunchHistory +type AdhocLaunchHistory struct { + + // framework id + FrameworkID string `json:"framework_id,omitempty"` + + // when the job was launched + LaunchTime string `json:"launch_time,omitempty"` + + // id of the single run + RunID string `json:"run_id,omitempty"` +} + +// Validate validates this adhoc launch history +func (m *AdhocLaunchHistory) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AdhocLaunchHistory) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AdhocLaunchHistory) UnmarshalBinary(b []byte) error { + var res AdhocLaunchHistory + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/deploy_queue.go b/pkg/paasta_api/models/deploy_queue.go new file mode 100644 index 0000000..bb48b42 --- /dev/null +++ b/pkg/paasta_api/models/deploy_queue.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DeployQueue Current state of the deployd queue +// +// swagger:model DeployQueue +type DeployQueue struct { + + // Service instances that are ready to be acted on by deployd + AvailableServiceInstances []*DeployQueueServiceInstance `json:"available_service_instances"` + + // Service instances that deployd is waiting to act on + UnavailableServiceInstances []*DeployQueueServiceInstance `json:"unavailable_service_instances"` +} + +// Validate validates this deploy queue +func (m *DeployQueue) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAvailableServiceInstances(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUnavailableServiceInstances(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeployQueue) validateAvailableServiceInstances(formats strfmt.Registry) error { + + if swag.IsZero(m.AvailableServiceInstances) { // not required + return nil + } + + for i := 0; i < len(m.AvailableServiceInstances); i++ { + if swag.IsZero(m.AvailableServiceInstances[i]) { // not required + continue + } + + if m.AvailableServiceInstances[i] != nil { + if err := m.AvailableServiceInstances[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("available_service_instances" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DeployQueue) validateUnavailableServiceInstances(formats strfmt.Registry) error { + + if swag.IsZero(m.UnavailableServiceInstances) { // not required + return nil + } + + for i := 0; i < len(m.UnavailableServiceInstances); i++ { + if swag.IsZero(m.UnavailableServiceInstances[i]) { // not required + continue + } + + if m.UnavailableServiceInstances[i] != nil { + if err := m.UnavailableServiceInstances[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("unavailable_service_instances" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeployQueue) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeployQueue) UnmarshalBinary(b []byte) error { + var res DeployQueue + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/deploy_queue_service_instance.go b/pkg/paasta_api/models/deploy_queue_service_instance.go new file mode 100644 index 0000000..993a8c5 --- /dev/null +++ b/pkg/paasta_api/models/deploy_queue_service_instance.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DeployQueueServiceInstance An instance of a service in the deploy queue +// +// swagger:model DeployQueueServiceInstance +type DeployQueueServiceInstance struct { + + // Desired timestamp by which the service instance should be bounced + BounceBy float32 `json:"bounce_by,omitempty"` + + // Timestamp at which service instance was first added to the queue + BounceStartTime float32 `json:"bounce_start_time,omitempty"` + + // Timestamp at which the service instance was last added to the queue + EnqueueTime float32 `json:"enqueue_time,omitempty"` + + // Number of times deployment actions have failed on this service instance + Failures int32 `json:"failures,omitempty"` + + // Name of the instance of the service + Instance string `json:"instance,omitempty"` + + // Number of times any deployment action has been taken on this service instance + ProcessedCount int32 `json:"processed_count,omitempty"` + + // Name of the service + Service string `json:"service,omitempty"` + + // Timestamp before which no action should be taken on this service instance + WaitUntil float32 `json:"wait_until,omitempty"` + + // The process that enqueued the task + Watcher string `json:"watcher,omitempty"` +} + +// Validate validates this deploy queue service instance +func (m *DeployQueueServiceInstance) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DeployQueueServiceInstance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeployQueueServiceInstance) UnmarshalBinary(b []byte) error { + var res DeployQueueServiceInstance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/envoy_backend.go b/pkg/paasta_api/models/envoy_backend.go new file mode 100644 index 0000000..b22c1bf --- /dev/null +++ b/pkg/paasta_api/models/envoy_backend.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EnvoyBackend envoy backend +// +// swagger:model EnvoyBackend +type EnvoyBackend struct { + + // Address of the host on which the backend is running + Address string `json:"address,omitempty"` + + // Status of the backend in Envoy as reported by the EDS + EdsHealthStatus string `json:"eds_health_status,omitempty"` + + // Whether this backend has an associated task running + HasAssociatedTask bool `json:"has_associated_task,omitempty"` + + // Name of the host on which the backend is running + Hostname string `json:"hostname,omitempty"` + + // Port number on which the backend responds + PortValue int32 `json:"port_value,omitempty"` + + // The weight of this backend in the cluster + Weight int32 `json:"weight,omitempty"` +} + +// Validate validates this envoy backend +func (m *EnvoyBackend) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *EnvoyBackend) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EnvoyBackend) UnmarshalBinary(b []byte) error { + var res EnvoyBackend + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/envoy_location.go b/pkg/paasta_api/models/envoy_location.go new file mode 100644 index 0000000..ff76861 --- /dev/null +++ b/pkg/paasta_api/models/envoy_location.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EnvoyLocation envoy location +// +// swagger:model EnvoyLocation +type EnvoyLocation struct { + + // Envoy backends running in this location + Backends []*EnvoyBackend `json:"backends"` + + // Whether this backend is proxied through Casper + IsProxiedThroughCasper bool `json:"is_proxied_through_casper,omitempty"` + + // Name of the location + Name string `json:"name,omitempty"` + + // Number of running backends for the service in this location + RunningBackendsCount int32 `json:"running_backends_count,omitempty"` +} + +// Validate validates this envoy location +func (m *EnvoyLocation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBackends(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EnvoyLocation) validateBackends(formats strfmt.Registry) error { + + if swag.IsZero(m.Backends) { // not required + return nil + } + + for i := 0; i < len(m.Backends); i++ { + if swag.IsZero(m.Backends[i]) { // not required + continue + } + + if m.Backends[i] != nil { + if err := m.Backends[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backends" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *EnvoyLocation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EnvoyLocation) UnmarshalBinary(b []byte) error { + var res EnvoyLocation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/envoy_status.go b/pkg/paasta_api/models/envoy_status.go new file mode 100644 index 0000000..b58fae1 --- /dev/null +++ b/pkg/paasta_api/models/envoy_status.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EnvoyStatus envoy status +// +// swagger:model EnvoyStatus +type EnvoyStatus struct { + + // Number of backends expected to be present in each location + ExpectedBackendsPerLocation int32 `json:"expected_backends_per_location,omitempty"` + + // Locations the service is deployed + Locations []*EnvoyLocation `json:"locations"` + + // Registration name of the service in Smartstack + Registration string `json:"registration,omitempty"` +} + +// Validate validates this envoy status +func (m *EnvoyStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLocations(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EnvoyStatus) validateLocations(formats strfmt.Registry) error { + + if swag.IsZero(m.Locations) { // not required + return nil + } + + for i := 0; i < len(m.Locations); i++ { + if swag.IsZero(m.Locations[i]) { // not required + continue + } + + if m.Locations[i] != nil { + if err := m.Locations[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("locations" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *EnvoyStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EnvoyStatus) UnmarshalBinary(b []byte) error { + var res EnvoyStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/float_and_error.go b/pkg/paasta_api/models/float_and_error.go new file mode 100644 index 0000000..659a1d6 --- /dev/null +++ b/pkg/paasta_api/models/float_and_error.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// FloatAndError float and error +// +// swagger:model FloatAndError +type FloatAndError struct { + + // error message + ErrorMessage string `json:"error_message,omitempty"` + + // value + Value float32 `json:"value,omitempty"` +} + +// Validate validates this float and error +func (m *FloatAndError) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *FloatAndError) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FloatAndError) UnmarshalBinary(b []byte) error { + var res FloatAndError + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/h_p_a_metric.go b/pkg/paasta_api/models/h_p_a_metric.go new file mode 100644 index 0000000..ba03710 --- /dev/null +++ b/pkg/paasta_api/models/h_p_a_metric.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HPAMetric h p a metric +// +// swagger:model HPAMetric +type HPAMetric struct { + + // setpoint/target_value as specified in yelpsoa_configs + CurrentValue string `json:"current_value,omitempty"` + + // name of the metric + Name string `json:"name,omitempty"` + + // setpoint/target_value as specified in yelpsoa_configs + TargetValue string `json:"target_value,omitempty"` +} + +// Validate validates this h p a metric +func (m *HPAMetric) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HPAMetric) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HPAMetric) UnmarshalBinary(b []byte) error { + var res HPAMetric + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/instance_delay.go b/pkg/paasta_api/models/instance_delay.go new file mode 100644 index 0000000..d30b602 --- /dev/null +++ b/pkg/paasta_api/models/instance_delay.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// InstanceDelay instance delay +// +// swagger:model InstanceDelay +type InstanceDelay interface{} diff --git a/pkg/paasta_api/models/instance_metadata_flink.go b/pkg/paasta_api/models/instance_metadata_flink.go new file mode 100644 index 0000000..bbebb83 --- /dev/null +++ b/pkg/paasta_api/models/instance_metadata_flink.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// InstanceMetadataFlink Flink instance metadata +// +// swagger:model InstanceMetadataFlink +type InstanceMetadataFlink interface{} diff --git a/pkg/paasta_api/models/instance_metadata_kafka_cluster.go b/pkg/paasta_api/models/instance_metadata_kafka_cluster.go new file mode 100644 index 0000000..7c2359d --- /dev/null +++ b/pkg/paasta_api/models/instance_metadata_kafka_cluster.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// InstanceMetadataKafkaCluster Kafka instance metadata +// +// swagger:model InstanceMetadataKafkaCluster +type InstanceMetadataKafkaCluster interface{} diff --git a/pkg/paasta_api/models/instance_spec_kafka_cluster.go b/pkg/paasta_api/models/instance_spec_kafka_cluster.go new file mode 100644 index 0000000..826905b --- /dev/null +++ b/pkg/paasta_api/models/instance_spec_kafka_cluster.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// InstanceSpecKafkaCluster Kafka instance spec +// +// swagger:model InstanceSpecKafkaCluster +type InstanceSpecKafkaCluster interface{} diff --git a/pkg/paasta_api/models/instance_status.go b/pkg/paasta_api/models/instance_status.go new file mode 100644 index 0000000..e3ebe33 --- /dev/null +++ b/pkg/paasta_api/models/instance_status.go @@ -0,0 +1,300 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InstanceStatus instance status +// +// swagger:model InstanceStatus +type InstanceStatus struct { + + // Adhoc instance status + Adhoc InstanceStatusAdhoc `json:"adhoc,omitempty"` + + // flink + Flink *InstanceStatusFlink `json:"flink,omitempty"` + + // Git sha of a service + GitSha string `json:"git_sha,omitempty"` + + // Instance name + Instance string `json:"instance,omitempty"` + + // kafkacluster + Kafkacluster *InstanceStatusKafkacluster `json:"kafkacluster,omitempty"` + + // Kubernetes instance status + Kubernetes *InstanceStatusKubernetes `json:"kubernetes,omitempty"` + + // Marathon instance status + Marathon *InstanceStatusMarathon `json:"marathon,omitempty"` + + // Service name + Service string `json:"service,omitempty"` + + // Tron instance status + Tron *InstanceStatusTron `json:"tron,omitempty"` +} + +// Validate validates this instance status +func (m *InstanceStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAdhoc(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFlink(formats); err != nil { + res = append(res, err) + } + + if err := m.validateKafkacluster(formats); err != nil { + res = append(res, err) + } + + if err := m.validateKubernetes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMarathon(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTron(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InstanceStatus) validateAdhoc(formats strfmt.Registry) error { + + if swag.IsZero(m.Adhoc) { // not required + return nil + } + + if err := m.Adhoc.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("adhoc") + } + return err + } + + return nil +} + +func (m *InstanceStatus) validateFlink(formats strfmt.Registry) error { + + if swag.IsZero(m.Flink) { // not required + return nil + } + + if m.Flink != nil { + if err := m.Flink.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("flink") + } + return err + } + } + + return nil +} + +func (m *InstanceStatus) validateKafkacluster(formats strfmt.Registry) error { + + if swag.IsZero(m.Kafkacluster) { // not required + return nil + } + + if m.Kafkacluster != nil { + if err := m.Kafkacluster.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("kafkacluster") + } + return err + } + } + + return nil +} + +func (m *InstanceStatus) validateKubernetes(formats strfmt.Registry) error { + + if swag.IsZero(m.Kubernetes) { // not required + return nil + } + + if m.Kubernetes != nil { + if err := m.Kubernetes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("kubernetes") + } + return err + } + } + + return nil +} + +func (m *InstanceStatus) validateMarathon(formats strfmt.Registry) error { + + if swag.IsZero(m.Marathon) { // not required + return nil + } + + if m.Marathon != nil { + if err := m.Marathon.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("marathon") + } + return err + } + } + + return nil +} + +func (m *InstanceStatus) validateTron(formats strfmt.Registry) error { + + if swag.IsZero(m.Tron) { // not required + return nil + } + + if m.Tron != nil { + if err := m.Tron.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tron") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InstanceStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InstanceStatus) UnmarshalBinary(b []byte) error { + var res InstanceStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// InstanceStatusFlink Nullable Flink instance status and metadata +// +// swagger:model InstanceStatusFlink +type InstanceStatusFlink struct { + + // metadata + Metadata InstanceMetadataFlink `json:"metadata,omitempty"` + + // status + Status *InstanceStatusFlink `json:"status,omitempty"` +} + +// Validate validates this instance status flink +func (m *InstanceStatusFlink) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InstanceStatusFlink) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("flink" + "." + "status") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InstanceStatusFlink) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InstanceStatusFlink) UnmarshalBinary(b []byte) error { + var res InstanceStatusFlink + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// InstanceStatusKafkacluster Nullable KafkaCluster instance status and metadata +// +// swagger:model InstanceStatusKafkacluster +type InstanceStatusKafkacluster struct { + + // metadata + Metadata InstanceMetadataKafkaCluster `json:"metadata,omitempty"` + + // status + Status InstanceStatusKafkaCluster `json:"status,omitempty"` +} + +// Validate validates this instance status kafkacluster +func (m *InstanceStatusKafkacluster) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InstanceStatusKafkacluster) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InstanceStatusKafkacluster) UnmarshalBinary(b []byte) error { + var res InstanceStatusKafkacluster + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/instance_status_adhoc.go b/pkg/paasta_api/models/instance_status_adhoc.go new file mode 100644 index 0000000..4dd30a9 --- /dev/null +++ b/pkg/paasta_api/models/instance_status_adhoc.go @@ -0,0 +1,45 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InstanceStatusAdhoc List of runs associated with job +// +// swagger:model InstanceStatusAdhoc +type InstanceStatusAdhoc []*AdhocLaunchHistory + +// Validate validates this instance status adhoc +func (m InstanceStatusAdhoc) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/models/instance_status_flink.go b/pkg/paasta_api/models/instance_status_flink.go new file mode 100644 index 0000000..08b7608 --- /dev/null +++ b/pkg/paasta_api/models/instance_status_flink.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// InstanceStatusFlink Flink instance status +// +// swagger:model InstanceStatusFlink +type _InstanceStatusFlink interface{} diff --git a/pkg/paasta_api/models/instance_status_kafka_cluster.go b/pkg/paasta_api/models/instance_status_kafka_cluster.go new file mode 100644 index 0000000..1ce0abc --- /dev/null +++ b/pkg/paasta_api/models/instance_status_kafka_cluster.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// InstanceStatusKafkaCluster Kafka instance status +// +// swagger:model InstanceStatusKafkaCluster +type InstanceStatusKafkaCluster interface{} diff --git a/pkg/paasta_api/models/instance_status_kubernetes.go b/pkg/paasta_api/models/instance_status_kubernetes.go new file mode 100644 index 0000000..8984d28 --- /dev/null +++ b/pkg/paasta_api/models/instance_status_kubernetes.go @@ -0,0 +1,456 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InstanceStatusKubernetes instance status kubernetes +// +// swagger:model InstanceStatusKubernetes +type InstanceStatusKubernetes struct { + + // The number of different running versions of the same service (0 for stopped, 1 for running and 1+ for bouncing) + // Required: true + AppCount *int32 `json:"app_count"` + + // ID of the desired version of a service instance + AppID string `json:"app_id,omitempty"` + + // autoscaling status + AutoscalingStatus *InstanceStatusKubernetesAutoscalingStatus `json:"autoscaling_status,omitempty"` + + // backoff in seconds before launching the next task + BackoffSeconds int32 `json:"backoff_seconds,omitempty"` + + // Method to transit between new and old versions of a service + // Required: true + // Enum: [brutal upthendown downthenup crossover] + BounceMethod *string `json:"bounce_method"` + + // Unix timestamp when this app was created + CreateTimestamp float32 `json:"create_timestamp,omitempty"` + + // Deploy status of a Kubernetes service + // Enum: [Running Deploying Stopped Delayed Waiting NotRunning] + DeployStatus string `json:"deploy_status,omitempty"` + + // Reason for the deploy status + DeployStatusMessage string `json:"deploy_status_message,omitempty"` + + // Desired state of a service, for Kubernetes + // Required: true + // Enum: [start stop] + DesiredState *string `json:"desired_state"` + + // Error message when a kubernetes object (Deployment/Statefulset) cannot be found + ErrorMessage string `json:"error_message,omitempty"` + + // The number of desired instances of the service + ExpectedInstanceCount int32 `json:"expected_instance_count,omitempty"` + + // The namespace this app is running + Namespace string `json:"namespace,omitempty"` + + // Pods associated to this app + Pods []*KubernetesPod `json:"pods"` + + // ReplicaSets associated to this app + Replicasets []*KubernetesReplicaSet `json:"replicasets"` + + // The number of actual running instances of the service + RunningInstanceCount int32 `json:"running_instance_count,omitempty"` + + // Status of the service in smartstack + Smartstack *SmartstackStatus `json:"smartstack,omitempty"` +} + +// Validate validates this instance status kubernetes +func (m *InstanceStatusKubernetes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAppCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAutoscalingStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBounceMethod(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeployStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDesiredState(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePods(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReplicasets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSmartstack(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InstanceStatusKubernetes) validateAppCount(formats strfmt.Registry) error { + + if err := validate.Required("app_count", "body", m.AppCount); err != nil { + return err + } + + return nil +} + +func (m *InstanceStatusKubernetes) validateAutoscalingStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.AutoscalingStatus) { // not required + return nil + } + + if m.AutoscalingStatus != nil { + if err := m.AutoscalingStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("autoscaling_status") + } + return err + } + } + + return nil +} + +var instanceStatusKubernetesTypeBounceMethodPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["brutal","upthendown","downthenup","crossover"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + instanceStatusKubernetesTypeBounceMethodPropEnum = append(instanceStatusKubernetesTypeBounceMethodPropEnum, v) + } +} + +const ( + + // InstanceStatusKubernetesBounceMethodBrutal captures enum value "brutal" + InstanceStatusKubernetesBounceMethodBrutal string = "brutal" + + // InstanceStatusKubernetesBounceMethodUpthendown captures enum value "upthendown" + InstanceStatusKubernetesBounceMethodUpthendown string = "upthendown" + + // InstanceStatusKubernetesBounceMethodDownthenup captures enum value "downthenup" + InstanceStatusKubernetesBounceMethodDownthenup string = "downthenup" + + // InstanceStatusKubernetesBounceMethodCrossover captures enum value "crossover" + InstanceStatusKubernetesBounceMethodCrossover string = "crossover" +) + +// prop value enum +func (m *InstanceStatusKubernetes) validateBounceMethodEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, instanceStatusKubernetesTypeBounceMethodPropEnum); err != nil { + return err + } + return nil +} + +func (m *InstanceStatusKubernetes) validateBounceMethod(formats strfmt.Registry) error { + + if err := validate.Required("bounce_method", "body", m.BounceMethod); err != nil { + return err + } + + // value enum + if err := m.validateBounceMethodEnum("bounce_method", "body", *m.BounceMethod); err != nil { + return err + } + + return nil +} + +var instanceStatusKubernetesTypeDeployStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Running","Deploying","Stopped","Delayed","Waiting","NotRunning"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + instanceStatusKubernetesTypeDeployStatusPropEnum = append(instanceStatusKubernetesTypeDeployStatusPropEnum, v) + } +} + +const ( + + // InstanceStatusKubernetesDeployStatusRunning captures enum value "Running" + InstanceStatusKubernetesDeployStatusRunning string = "Running" + + // InstanceStatusKubernetesDeployStatusDeploying captures enum value "Deploying" + InstanceStatusKubernetesDeployStatusDeploying string = "Deploying" + + // InstanceStatusKubernetesDeployStatusStopped captures enum value "Stopped" + InstanceStatusKubernetesDeployStatusStopped string = "Stopped" + + // InstanceStatusKubernetesDeployStatusDelayed captures enum value "Delayed" + InstanceStatusKubernetesDeployStatusDelayed string = "Delayed" + + // InstanceStatusKubernetesDeployStatusWaiting captures enum value "Waiting" + InstanceStatusKubernetesDeployStatusWaiting string = "Waiting" + + // InstanceStatusKubernetesDeployStatusNotRunning captures enum value "NotRunning" + InstanceStatusKubernetesDeployStatusNotRunning string = "NotRunning" +) + +// prop value enum +func (m *InstanceStatusKubernetes) validateDeployStatusEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, instanceStatusKubernetesTypeDeployStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *InstanceStatusKubernetes) validateDeployStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.DeployStatus) { // not required + return nil + } + + // value enum + if err := m.validateDeployStatusEnum("deploy_status", "body", m.DeployStatus); err != nil { + return err + } + + return nil +} + +var instanceStatusKubernetesTypeDesiredStatePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["start","stop"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + instanceStatusKubernetesTypeDesiredStatePropEnum = append(instanceStatusKubernetesTypeDesiredStatePropEnum, v) + } +} + +const ( + + // InstanceStatusKubernetesDesiredStateStart captures enum value "start" + InstanceStatusKubernetesDesiredStateStart string = "start" + + // InstanceStatusKubernetesDesiredStateStop captures enum value "stop" + InstanceStatusKubernetesDesiredStateStop string = "stop" +) + +// prop value enum +func (m *InstanceStatusKubernetes) validateDesiredStateEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, instanceStatusKubernetesTypeDesiredStatePropEnum); err != nil { + return err + } + return nil +} + +func (m *InstanceStatusKubernetes) validateDesiredState(formats strfmt.Registry) error { + + if err := validate.Required("desired_state", "body", m.DesiredState); err != nil { + return err + } + + // value enum + if err := m.validateDesiredStateEnum("desired_state", "body", *m.DesiredState); err != nil { + return err + } + + return nil +} + +func (m *InstanceStatusKubernetes) validatePods(formats strfmt.Registry) error { + + if swag.IsZero(m.Pods) { // not required + return nil + } + + for i := 0; i < len(m.Pods); i++ { + if swag.IsZero(m.Pods[i]) { // not required + continue + } + + if m.Pods[i] != nil { + if err := m.Pods[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pods" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *InstanceStatusKubernetes) validateReplicasets(formats strfmt.Registry) error { + + if swag.IsZero(m.Replicasets) { // not required + return nil + } + + for i := 0; i < len(m.Replicasets); i++ { + if swag.IsZero(m.Replicasets[i]) { // not required + continue + } + + if m.Replicasets[i] != nil { + if err := m.Replicasets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replicasets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *InstanceStatusKubernetes) validateSmartstack(formats strfmt.Registry) error { + + if swag.IsZero(m.Smartstack) { // not required + return nil + } + + if m.Smartstack != nil { + if err := m.Smartstack.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("smartstack") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InstanceStatusKubernetes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InstanceStatusKubernetes) UnmarshalBinary(b []byte) error { + var res InstanceStatusKubernetes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// InstanceStatusKubernetesAutoscalingStatus HPA associated to this app +// +// swagger:model InstanceStatusKubernetesAutoscalingStatus +type InstanceStatusKubernetesAutoscalingStatus struct { + + // desired number of _instances as calculated by HPA + DesiredReplicas int64 `json:"desired_replicas,omitempty"` + + // timestamp of last autoscale + LastScaleTime string `json:"last_scale_time,omitempty"` + + // min_instances as specified in yelpsoa_configs + MaxInstances int64 `json:"max_instances,omitempty"` + + // Current metrics + Metrics []*HPAMetric `json:"metrics"` + + // min_instances as specified in yelpsoa_configs + MinInstances int64 `json:"min_instances,omitempty"` +} + +// Validate validates this instance status kubernetes autoscaling status +func (m *InstanceStatusKubernetesAutoscalingStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMetrics(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InstanceStatusKubernetesAutoscalingStatus) validateMetrics(formats strfmt.Registry) error { + + if swag.IsZero(m.Metrics) { // not required + return nil + } + + for i := 0; i < len(m.Metrics); i++ { + if swag.IsZero(m.Metrics[i]) { // not required + continue + } + + if m.Metrics[i] != nil { + if err := m.Metrics[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("autoscaling_status" + "." + "metrics" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InstanceStatusKubernetesAutoscalingStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InstanceStatusKubernetesAutoscalingStatus) UnmarshalBinary(b []byte) error { + var res InstanceStatusKubernetesAutoscalingStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/instance_status_marathon.go b/pkg/paasta_api/models/instance_status_marathon.go new file mode 100644 index 0000000..6ce4f42 --- /dev/null +++ b/pkg/paasta_api/models/instance_status_marathon.go @@ -0,0 +1,390 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InstanceStatusMarathon instance status marathon +// +// swagger:model InstanceStatusMarathon +type InstanceStatusMarathon struct { + + // The number of different running versions of the same service (0 for stopped, 1 for running and 1+ for bouncing) + // Required: true + AppCount *int32 `json:"app_count"` + + // Statuses of each app of the service + AppStatuses []*MarathonAppStatus `json:"app_statuses"` + + // Autoscaling information for the service + AutoscalingInfo *MarathonAutoscalingInfo `json:"autoscaling_info,omitempty"` + + // backoff in seconds before launching the next task + BackoffSeconds int32 `json:"backoff_seconds,omitempty"` + + // Method to transit between new and old versions of a service + // Required: true + // Enum: [brutal upthendown downthenup crossover] + BounceMethod *string `json:"bounce_method"` + + // Deploy status of a marathon service + // Enum: [Running Deploying Stopped Delayed Waiting Waiting for bounce NotRunning] + DeployStatus string `json:"deploy_status,omitempty"` + + // ID of the desired version of a service instance + DesiredAppID string `json:"desired_app_id,omitempty"` + + // Desired state of a service, for Marathon + // Required: true + // Enum: [start stop] + DesiredState *string `json:"desired_state"` + + // Status of the service in Envoy + Envoy *EnvoyStatus `json:"envoy,omitempty"` + + // Error message when a marathon job ID cannot be found + ErrorMessage string `json:"error_message,omitempty"` + + // The number of desired instances of the service + ExpectedInstanceCount int32 `json:"expected_instance_count,omitempty"` + + // Status of the service in Mesos + Mesos *MarathonMesosStatus `json:"mesos,omitempty"` + + // The number of actual running instances of the service + RunningInstanceCount int32 `json:"running_instance_count,omitempty"` + + // Status of the service in smartstack + Smartstack *SmartstackStatus `json:"smartstack,omitempty"` +} + +// Validate validates this instance status marathon +func (m *InstanceStatusMarathon) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAppCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAppStatuses(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAutoscalingInfo(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBounceMethod(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeployStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDesiredState(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEnvoy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMesos(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSmartstack(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InstanceStatusMarathon) validateAppCount(formats strfmt.Registry) error { + + if err := validate.Required("app_count", "body", m.AppCount); err != nil { + return err + } + + return nil +} + +func (m *InstanceStatusMarathon) validateAppStatuses(formats strfmt.Registry) error { + + if swag.IsZero(m.AppStatuses) { // not required + return nil + } + + for i := 0; i < len(m.AppStatuses); i++ { + if swag.IsZero(m.AppStatuses[i]) { // not required + continue + } + + if m.AppStatuses[i] != nil { + if err := m.AppStatuses[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("app_statuses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *InstanceStatusMarathon) validateAutoscalingInfo(formats strfmt.Registry) error { + + if swag.IsZero(m.AutoscalingInfo) { // not required + return nil + } + + if m.AutoscalingInfo != nil { + if err := m.AutoscalingInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("autoscaling_info") + } + return err + } + } + + return nil +} + +var instanceStatusMarathonTypeBounceMethodPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["brutal","upthendown","downthenup","crossover"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + instanceStatusMarathonTypeBounceMethodPropEnum = append(instanceStatusMarathonTypeBounceMethodPropEnum, v) + } +} + +const ( + + // InstanceStatusMarathonBounceMethodBrutal captures enum value "brutal" + InstanceStatusMarathonBounceMethodBrutal string = "brutal" + + // InstanceStatusMarathonBounceMethodUpthendown captures enum value "upthendown" + InstanceStatusMarathonBounceMethodUpthendown string = "upthendown" + + // InstanceStatusMarathonBounceMethodDownthenup captures enum value "downthenup" + InstanceStatusMarathonBounceMethodDownthenup string = "downthenup" + + // InstanceStatusMarathonBounceMethodCrossover captures enum value "crossover" + InstanceStatusMarathonBounceMethodCrossover string = "crossover" +) + +// prop value enum +func (m *InstanceStatusMarathon) validateBounceMethodEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, instanceStatusMarathonTypeBounceMethodPropEnum); err != nil { + return err + } + return nil +} + +func (m *InstanceStatusMarathon) validateBounceMethod(formats strfmt.Registry) error { + + if err := validate.Required("bounce_method", "body", m.BounceMethod); err != nil { + return err + } + + // value enum + if err := m.validateBounceMethodEnum("bounce_method", "body", *m.BounceMethod); err != nil { + return err + } + + return nil +} + +var instanceStatusMarathonTypeDeployStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Running","Deploying","Stopped","Delayed","Waiting","Waiting for bounce","NotRunning"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + instanceStatusMarathonTypeDeployStatusPropEnum = append(instanceStatusMarathonTypeDeployStatusPropEnum, v) + } +} + +const ( + + // InstanceStatusMarathonDeployStatusRunning captures enum value "Running" + InstanceStatusMarathonDeployStatusRunning string = "Running" + + // InstanceStatusMarathonDeployStatusDeploying captures enum value "Deploying" + InstanceStatusMarathonDeployStatusDeploying string = "Deploying" + + // InstanceStatusMarathonDeployStatusStopped captures enum value "Stopped" + InstanceStatusMarathonDeployStatusStopped string = "Stopped" + + // InstanceStatusMarathonDeployStatusDelayed captures enum value "Delayed" + InstanceStatusMarathonDeployStatusDelayed string = "Delayed" + + // InstanceStatusMarathonDeployStatusWaiting captures enum value "Waiting" + InstanceStatusMarathonDeployStatusWaiting string = "Waiting" + + // InstanceStatusMarathonDeployStatusWaitingForBounce captures enum value "Waiting for bounce" + InstanceStatusMarathonDeployStatusWaitingForBounce string = "Waiting for bounce" + + // InstanceStatusMarathonDeployStatusNotRunning captures enum value "NotRunning" + InstanceStatusMarathonDeployStatusNotRunning string = "NotRunning" +) + +// prop value enum +func (m *InstanceStatusMarathon) validateDeployStatusEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, instanceStatusMarathonTypeDeployStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *InstanceStatusMarathon) validateDeployStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.DeployStatus) { // not required + return nil + } + + // value enum + if err := m.validateDeployStatusEnum("deploy_status", "body", m.DeployStatus); err != nil { + return err + } + + return nil +} + +var instanceStatusMarathonTypeDesiredStatePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["start","stop"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + instanceStatusMarathonTypeDesiredStatePropEnum = append(instanceStatusMarathonTypeDesiredStatePropEnum, v) + } +} + +const ( + + // InstanceStatusMarathonDesiredStateStart captures enum value "start" + InstanceStatusMarathonDesiredStateStart string = "start" + + // InstanceStatusMarathonDesiredStateStop captures enum value "stop" + InstanceStatusMarathonDesiredStateStop string = "stop" +) + +// prop value enum +func (m *InstanceStatusMarathon) validateDesiredStateEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, instanceStatusMarathonTypeDesiredStatePropEnum); err != nil { + return err + } + return nil +} + +func (m *InstanceStatusMarathon) validateDesiredState(formats strfmt.Registry) error { + + if err := validate.Required("desired_state", "body", m.DesiredState); err != nil { + return err + } + + // value enum + if err := m.validateDesiredStateEnum("desired_state", "body", *m.DesiredState); err != nil { + return err + } + + return nil +} + +func (m *InstanceStatusMarathon) validateEnvoy(formats strfmt.Registry) error { + + if swag.IsZero(m.Envoy) { // not required + return nil + } + + if m.Envoy != nil { + if err := m.Envoy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("envoy") + } + return err + } + } + + return nil +} + +func (m *InstanceStatusMarathon) validateMesos(formats strfmt.Registry) error { + + if swag.IsZero(m.Mesos) { // not required + return nil + } + + if m.Mesos != nil { + if err := m.Mesos.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mesos") + } + return err + } + } + + return nil +} + +func (m *InstanceStatusMarathon) validateSmartstack(formats strfmt.Registry) error { + + if swag.IsZero(m.Smartstack) { // not required + return nil + } + + if m.Smartstack != nil { + if err := m.Smartstack.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("smartstack") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InstanceStatusMarathon) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InstanceStatusMarathon) UnmarshalBinary(b []byte) error { + var res InstanceStatusMarathon + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/instance_status_tron.go b/pkg/paasta_api/models/instance_status_tron.go new file mode 100644 index 0000000..dda087b --- /dev/null +++ b/pkg/paasta_api/models/instance_status_tron.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InstanceStatusTron instance status tron +// +// swagger:model InstanceStatusTron +type InstanceStatusTron struct { + + // The command of the action + ActionCommand string `json:"action_command,omitempty"` + + // The name of the action + ActionName string `json:"action_name,omitempty"` + + // The raw command of the action + ActionRawCommand string `json:"action_raw_command,omitempty"` + + // The start time of the action + ActionStartTime string `json:"action_start_time,omitempty"` + + // The state of the action + ActionState string `json:"action_state,omitempty"` + + // The stderr command of the action + ActionStderr string `json:"action_stderr,omitempty"` + + // The stdout command of the action + ActionStdout string `json:"action_stdout,omitempty"` + + // The name of this job + // Required: true + JobName *string `json:"job_name"` + + // The job schedule of the job + JobSchedule string `json:"job_schedule,omitempty"` + + // The status of the job + JobStatus string `json:"job_status,omitempty"` + + // The dashboard url of the job + // Required: true + JobURL *string `json:"job_url"` +} + +// Validate validates this instance status tron +func (m *InstanceStatusTron) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateJobName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateJobURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InstanceStatusTron) validateJobName(formats strfmt.Registry) error { + + if err := validate.Required("job_name", "body", m.JobName); err != nil { + return err + } + + return nil +} + +func (m *InstanceStatusTron) validateJobURL(formats strfmt.Registry) error { + + if err := validate.Required("job_url", "body", m.JobURL); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InstanceStatusTron) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InstanceStatusTron) UnmarshalBinary(b []byte) error { + var res InstanceStatusTron + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/instance_task.go b/pkg/paasta_api/models/instance_task.go new file mode 100644 index 0000000..b7cfd25 --- /dev/null +++ b/pkg/paasta_api/models/instance_task.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// InstanceTask instance task +// +// swagger:model InstanceTask +type InstanceTask interface{} diff --git a/pkg/paasta_api/models/instance_tasks.go b/pkg/paasta_api/models/instance_tasks.go new file mode 100644 index 0000000..3f29281 --- /dev/null +++ b/pkg/paasta_api/models/instance_tasks.go @@ -0,0 +1,20 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" +) + +// InstanceTasks List of tasks associated with instance +// +// swagger:model InstanceTasks +type InstanceTasks []InstanceTask + +// Validate validates this instance tasks +func (m InstanceTasks) Validate(formats strfmt.Registry) error { + return nil +} diff --git a/pkg/paasta_api/models/integer_and_error.go b/pkg/paasta_api/models/integer_and_error.go new file mode 100644 index 0000000..61636f3 --- /dev/null +++ b/pkg/paasta_api/models/integer_and_error.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// IntegerAndError integer and error +// +// swagger:model IntegerAndError +type IntegerAndError struct { + + // error message + ErrorMessage string `json:"error_message,omitempty"` + + // value + Value int32 `json:"value,omitempty"` +} + +// Validate validates this integer and error +func (m *IntegerAndError) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *IntegerAndError) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IntegerAndError) UnmarshalBinary(b []byte) error { + var res IntegerAndError + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/kubernetes_container.go b/pkg/paasta_api/models/kubernetes_container.go new file mode 100644 index 0000000..5b3a66b --- /dev/null +++ b/pkg/paasta_api/models/kubernetes_container.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// KubernetesContainer kubernetes container +// +// swagger:model KubernetesContainer +type KubernetesContainer struct { + + // Name of the container + Name string `json:"name,omitempty"` + + // Stdout and stderr tail of the container + TailLines *TaskTailLines `json:"tail_lines,omitempty"` +} + +// Validate validates this kubernetes container +func (m *KubernetesContainer) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTailLines(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *KubernetesContainer) validateTailLines(formats strfmt.Registry) error { + + if swag.IsZero(m.TailLines) { // not required + return nil + } + + if m.TailLines != nil { + if err := m.TailLines.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tail_lines") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *KubernetesContainer) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *KubernetesContainer) UnmarshalBinary(b []byte) error { + var res KubernetesContainer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/kubernetes_pod.go b/pkg/paasta_api/models/kubernetes_pod.go new file mode 100644 index 0000000..648f35d --- /dev/null +++ b/pkg/paasta_api/models/kubernetes_pod.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// KubernetesPod kubernetes pod +// +// swagger:model KubernetesPod +type KubernetesPod struct { + + // containers + Containers []*KubernetesContainer `json:"containers"` + + // Time at which the pod was deployed + DeployedTimestamp float32 `json:"deployed_timestamp,omitempty"` + + // name of the pod's host + Host string `json:"host,omitempty"` + + // long message explaining the pod's state + Message *string `json:"message,omitempty"` + + // name of the pod in Kubernetes + Name string `json:"name,omitempty"` + + // The status of the pod + Phase string `json:"phase,omitempty"` + + // Whether or not the pod is ready (i.e. all containers up) + Ready bool `json:"ready,omitempty"` + + // short message explaining the pod's state + Reason *string `json:"reason,omitempty"` +} + +// Validate validates this kubernetes pod +func (m *KubernetesPod) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContainers(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *KubernetesPod) validateContainers(formats strfmt.Registry) error { + + if swag.IsZero(m.Containers) { // not required + return nil + } + + for i := 0; i < len(m.Containers); i++ { + if swag.IsZero(m.Containers[i]) { // not required + continue + } + + if m.Containers[i] != nil { + if err := m.Containers[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("containers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *KubernetesPod) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *KubernetesPod) UnmarshalBinary(b []byte) error { + var res KubernetesPod + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/kubernetes_replica_set.go b/pkg/paasta_api/models/kubernetes_replica_set.go new file mode 100644 index 0000000..015b9e4 --- /dev/null +++ b/pkg/paasta_api/models/kubernetes_replica_set.go @@ -0,0 +1,52 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// KubernetesReplicaSet kubernetes replica set +// +// swagger:model KubernetesReplicaSet +type KubernetesReplicaSet struct { + + // Time at which the replicaset was created + CreateTimestamp float32 `json:"create_timestamp,omitempty"` + + // name of the replicaset in Kubernetes + Name string `json:"name,omitempty"` + + // number of ready replicas for the replicaset + ReadyReplicas int32 `json:"ready_replicas,omitempty"` + + // number of desired replicas for the replicaset + Replicas int32 `json:"replicas,omitempty"` +} + +// Validate validates this kubernetes replica set +func (m *KubernetesReplicaSet) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *KubernetesReplicaSet) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *KubernetesReplicaSet) UnmarshalBinary(b []byte) error { + var res KubernetesReplicaSet + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/marathon_app_status.go b/pkg/paasta_api/models/marathon_app_status.go new file mode 100644 index 0000000..e04b0bc --- /dev/null +++ b/pkg/paasta_api/models/marathon_app_status.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MarathonAppStatus marathon app status +// +// swagger:model MarathonAppStatus +type MarathonAppStatus struct { + + // Backoff in seconds before launching next task + BackoffSeconds int32 `json:"backoff_seconds,omitempty"` + + // Unix timestamp when this app was created + CreateTimestamp float32 `json:"create_timestamp,omitempty"` + + // Marathon dashboard URL for this app + DashboardURL string `json:"dashboard_url,omitempty"` + + // Deploy status of this app + DeployStatus string `json:"deploy_status,omitempty"` + + // Tasks associated to this app + Tasks []*MarathonTask `json:"tasks"` + + // Number of healthy tasks for this app + TasksHealthy int32 `json:"tasks_healthy,omitempty"` + + // Number running tasks for this app + TasksRunning int32 `json:"tasks_running,omitempty"` + + // Number of staged tasks for this app + TasksStaged int32 `json:"tasks_staged,omitempty"` + + // Total number of tasks for this app + TasksTotal int32 `json:"tasks_total,omitempty"` + + // Mapping of reason offer was refused to the number of times that type of refusal was seen + UnusedOfferReasonCounts interface{} `json:"unused_offer_reason_counts,omitempty"` +} + +// Validate validates this marathon app status +func (m *MarathonAppStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTasks(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MarathonAppStatus) validateTasks(formats strfmt.Registry) error { + + if swag.IsZero(m.Tasks) { // not required + return nil + } + + for i := 0; i < len(m.Tasks); i++ { + if swag.IsZero(m.Tasks[i]) { // not required + continue + } + + if m.Tasks[i] != nil { + if err := m.Tasks[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tasks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MarathonAppStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MarathonAppStatus) UnmarshalBinary(b []byte) error { + var res MarathonAppStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/marathon_autoscaling_info.go b/pkg/paasta_api/models/marathon_autoscaling_info.go new file mode 100644 index 0000000..cfe69c0 --- /dev/null +++ b/pkg/paasta_api/models/marathon_autoscaling_info.go @@ -0,0 +1,55 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MarathonAutoscalingInfo marathon autoscaling info +// +// swagger:model MarathonAutoscalingInfo +type MarathonAutoscalingInfo struct { + + // The number of instances of the service currently running + CurrentInstances int32 `json:"current_instances,omitempty"` + + // The current utilization of the instances' allocated resources + CurrentUtilization float32 `json:"current_utilization,omitempty"` + + // The maximum number of instances that the autoscaler will scale to + MaxInstances int32 `json:"max_instances,omitempty"` + + // The minimum number of instances that the autoscaler will scale to + MinInstances int32 `json:"min_instances,omitempty"` + + // The autoscaler's current target number of instances of this service to run + TargetInstances int32 `json:"target_instances,omitempty"` +} + +// Validate validates this marathon autoscaling info +func (m *MarathonAutoscalingInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MarathonAutoscalingInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MarathonAutoscalingInfo) UnmarshalBinary(b []byte) error { + var res MarathonAutoscalingInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/marathon_dashboard.go b/pkg/paasta_api/models/marathon_dashboard.go new file mode 100644 index 0000000..090d427 --- /dev/null +++ b/pkg/paasta_api/models/marathon_dashboard.go @@ -0,0 +1,42 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MarathonDashboard A list of Marathon service, instance, and shard url for one or more clusters +// +// swagger:model MarathonDashboard +type MarathonDashboard map[string]MarathonDashboardCluster + +// Validate validates this marathon dashboard +func (m MarathonDashboard) Validate(formats strfmt.Registry) error { + var res []error + + for k := range m { + + if err := validate.Required(k, "body", m[k]); err != nil { + return err + } + + if err := m[k].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(k) + } + return err + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/models/marathon_dashboard_cluster.go b/pkg/paasta_api/models/marathon_dashboard_cluster.go new file mode 100644 index 0000000..c72ca00 --- /dev/null +++ b/pkg/paasta_api/models/marathon_dashboard_cluster.go @@ -0,0 +1,45 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MarathonDashboardCluster List of all the MarathonDashboardItems for a cluster +// +// swagger:model MarathonDashboardCluster +type MarathonDashboardCluster []*MarathonDashboardItem + +// Validate validates this marathon dashboard cluster +func (m MarathonDashboardCluster) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/models/marathon_dashboard_item.go b/pkg/paasta_api/models/marathon_dashboard_item.go new file mode 100644 index 0000000..7a3d453 --- /dev/null +++ b/pkg/paasta_api/models/marathon_dashboard_item.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MarathonDashboardItem Marathon service, instance, and shard url +// +// swagger:model MarathonDashboardItem +type MarathonDashboardItem struct { + + // Instance name + Instance string `json:"instance,omitempty"` + + // Service name + Service string `json:"service,omitempty"` + + // Marathon Shard URL + ShardURL string `json:"shard_url,omitempty"` +} + +// Validate validates this marathon dashboard item +func (m *MarathonDashboardItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MarathonDashboardItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MarathonDashboardItem) UnmarshalBinary(b []byte) error { + var res MarathonDashboardItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/marathon_mesos_nonrunning_task.go b/pkg/paasta_api/models/marathon_mesos_nonrunning_task.go new file mode 100644 index 0000000..79f6711 --- /dev/null +++ b/pkg/paasta_api/models/marathon_mesos_nonrunning_task.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MarathonMesosNonrunningTask marathon mesos nonrunning task +// +// swagger:model MarathonMesosNonrunningTask +type MarathonMesosNonrunningTask struct { + + // The unix timestamp at which the task was deployed + DeployedTimestamp float32 `json:"deployed_timestamp,omitempty"` + + // Name of the Mesos agent on which this task is running + Hostname string `json:"hostname,omitempty"` + + // The ID of the task in Mesos + ID string `json:"id,omitempty"` + + // The current state of the task + State string `json:"state,omitempty"` + + // Stdout and stderr tail of the task + TailLines *TaskTailLines `json:"tail_lines,omitempty"` +} + +// Validate validates this marathon mesos nonrunning task +func (m *MarathonMesosNonrunningTask) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTailLines(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MarathonMesosNonrunningTask) validateTailLines(formats strfmt.Registry) error { + + if swag.IsZero(m.TailLines) { // not required + return nil + } + + if m.TailLines != nil { + if err := m.TailLines.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tail_lines") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MarathonMesosNonrunningTask) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MarathonMesosNonrunningTask) UnmarshalBinary(b []byte) error { + var res MarathonMesosNonrunningTask + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/marathon_mesos_running_task.go b/pkg/paasta_api/models/marathon_mesos_running_task.go new file mode 100644 index 0000000..0f0f2b1 --- /dev/null +++ b/pkg/paasta_api/models/marathon_mesos_running_task.go @@ -0,0 +1,183 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MarathonMesosRunningTask marathon mesos running task +// +// swagger:model MarathonMesosRunningTask +type MarathonMesosRunningTask struct { + + // The portion of a CPU that the task can use + CPUShares *FloatAndError `json:"cpu_shares,omitempty"` + + // The number of seconds of CPU time the task has used + CPUUsedSeconds *FloatAndError `json:"cpu_used_seconds,omitempty"` + + // The unix timestamp at which the task was deployed + DeployedTimestamp float32 `json:"deployed_timestamp,omitempty"` + + // The duration over which the task has been running in seconds + DurationSeconds int32 `json:"duration_seconds,omitempty"` + + // Name of the Mesos agent on which this task is running + Hostname string `json:"hostname,omitempty"` + + // The ID of the task in Mesos + ID string `json:"id,omitempty"` + + // The maximum amount of memory the task is allowed to use + MemLimit *IntegerAndError `json:"mem_limit,omitempty"` + + // The tasks's resident set size + Rss *IntegerAndError `json:"rss,omitempty"` + + // Stdout and stderr tail of the task + TailLines *TaskTailLines `json:"tail_lines,omitempty"` +} + +// Validate validates this marathon mesos running task +func (m *MarathonMesosRunningTask) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCPUShares(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCPUUsedSeconds(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMemLimit(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRss(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTailLines(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MarathonMesosRunningTask) validateCPUShares(formats strfmt.Registry) error { + + if swag.IsZero(m.CPUShares) { // not required + return nil + } + + if m.CPUShares != nil { + if err := m.CPUShares.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cpu_shares") + } + return err + } + } + + return nil +} + +func (m *MarathonMesosRunningTask) validateCPUUsedSeconds(formats strfmt.Registry) error { + + if swag.IsZero(m.CPUUsedSeconds) { // not required + return nil + } + + if m.CPUUsedSeconds != nil { + if err := m.CPUUsedSeconds.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cpu_used_seconds") + } + return err + } + } + + return nil +} + +func (m *MarathonMesosRunningTask) validateMemLimit(formats strfmt.Registry) error { + + if swag.IsZero(m.MemLimit) { // not required + return nil + } + + if m.MemLimit != nil { + if err := m.MemLimit.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mem_limit") + } + return err + } + } + + return nil +} + +func (m *MarathonMesosRunningTask) validateRss(formats strfmt.Registry) error { + + if swag.IsZero(m.Rss) { // not required + return nil + } + + if m.Rss != nil { + if err := m.Rss.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rss") + } + return err + } + } + + return nil +} + +func (m *MarathonMesosRunningTask) validateTailLines(formats strfmt.Registry) error { + + if swag.IsZero(m.TailLines) { // not required + return nil + } + + if m.TailLines != nil { + if err := m.TailLines.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tail_lines") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MarathonMesosRunningTask) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MarathonMesosRunningTask) UnmarshalBinary(b []byte) error { + var res MarathonMesosRunningTask + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/marathon_mesos_status.go b/pkg/paasta_api/models/marathon_mesos_status.go new file mode 100644 index 0000000..2fcffac --- /dev/null +++ b/pkg/paasta_api/models/marathon_mesos_status.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MarathonMesosStatus marathon mesos status +// +// swagger:model MarathonMesosStatus +type MarathonMesosStatus struct { + + // Error message when Mesos tasks cannot be queried + ErrorMessage string `json:"error_message,omitempty"` + + // Non-running tasks associated to this service + NonRunningTasks []*MarathonMesosNonrunningTask `json:"non_running_tasks"` + + // The number of running Mesos tasks associated to this service + RunningTaskCount int32 `json:"running_task_count,omitempty"` + + // Currently running tasks associated to this service + RunningTasks []*MarathonMesosRunningTask `json:"running_tasks"` +} + +// Validate validates this marathon mesos status +func (m *MarathonMesosStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNonRunningTasks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRunningTasks(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MarathonMesosStatus) validateNonRunningTasks(formats strfmt.Registry) error { + + if swag.IsZero(m.NonRunningTasks) { // not required + return nil + } + + for i := 0; i < len(m.NonRunningTasks); i++ { + if swag.IsZero(m.NonRunningTasks[i]) { // not required + continue + } + + if m.NonRunningTasks[i] != nil { + if err := m.NonRunningTasks[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("non_running_tasks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MarathonMesosStatus) validateRunningTasks(formats strfmt.Registry) error { + + if swag.IsZero(m.RunningTasks) { // not required + return nil + } + + for i := 0; i < len(m.RunningTasks); i++ { + if swag.IsZero(m.RunningTasks[i]) { // not required + continue + } + + if m.RunningTasks[i] != nil { + if err := m.RunningTasks[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("running_tasks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MarathonMesosStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MarathonMesosStatus) UnmarshalBinary(b []byte) error { + var res MarathonMesosStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/marathon_task.go b/pkg/paasta_api/models/marathon_task.go new file mode 100644 index 0000000..903c1f0 --- /dev/null +++ b/pkg/paasta_api/models/marathon_task.go @@ -0,0 +1,55 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MarathonTask marathon task +// +// swagger:model MarathonTask +type MarathonTask struct { + + // Time at which the task was deployed + DeployedTimestamp float32 `json:"deployed_timestamp,omitempty"` + + // Name of the host on which the task is running + Host string `json:"host,omitempty"` + + // ID of the task in Mesos + ID string `json:"id,omitempty"` + + // Whether Marathon thinks the task is healthy + IsHealthy bool `json:"is_healthy,omitempty"` + + // Port on which the task is listening + Port int32 `json:"port,omitempty"` +} + +// Validate validates this marathon task +func (m *MarathonTask) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MarathonTask) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MarathonTask) UnmarshalBinary(b []byte) error { + var res MarathonTask + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/meta_status.go b/pkg/paasta_api/models/meta_status.go new file mode 100644 index 0000000..3257987 --- /dev/null +++ b/pkg/paasta_api/models/meta_status.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MetaStatus Result of `paasta metastatus` command +// +// swagger:model MetaStatus +type MetaStatus struct { + + // Exit code from `paasta metastatus` command + ExitCode int64 `json:"exit_code,omitempty"` + + // Output from `paasta metastatus` command + Output string `json:"output,omitempty"` +} + +// Validate validates this meta status +func (m *MetaStatus) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MetaStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MetaStatus) UnmarshalBinary(b []byte) error { + var res MetaStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/resource.go b/pkg/paasta_api/models/resource.go new file mode 100644 index 0000000..aa529c6 --- /dev/null +++ b/pkg/paasta_api/models/resource.go @@ -0,0 +1,45 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Resource resource +// +// swagger:model Resource +type Resource []*ResourceItem + +// Validate validates this resource +func (m Resource) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/paasta_api/models/resource_item.go b/pkg/paasta_api/models/resource_item.go new file mode 100644 index 0000000..b63b20b --- /dev/null +++ b/pkg/paasta_api/models/resource_item.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ResourceItem resource item +// +// swagger:model ResourceItem +type ResourceItem struct { + + // cpus + Cpus *ResourceValue `json:"cpus,omitempty"` + + // disk + Disk *ResourceValue `json:"disk,omitempty"` + + // groupings + Groupings interface{} `json:"groupings,omitempty"` + + // mem + Mem *ResourceValue `json:"mem,omitempty"` +} + +// Validate validates this resource item +func (m *ResourceItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCpus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDisk(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMem(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ResourceItem) validateCpus(formats strfmt.Registry) error { + + if swag.IsZero(m.Cpus) { // not required + return nil + } + + if m.Cpus != nil { + if err := m.Cpus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cpus") + } + return err + } + } + + return nil +} + +func (m *ResourceItem) validateDisk(formats strfmt.Registry) error { + + if swag.IsZero(m.Disk) { // not required + return nil + } + + if m.Disk != nil { + if err := m.Disk.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("disk") + } + return err + } + } + + return nil +} + +func (m *ResourceItem) validateMem(formats strfmt.Registry) error { + + if swag.IsZero(m.Mem) { // not required + return nil + } + + if m.Mem != nil { + if err := m.Mem.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mem") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ResourceItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResourceItem) UnmarshalBinary(b []byte) error { + var res ResourceItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/resource_value.go b/pkg/paasta_api/models/resource_value.go new file mode 100644 index 0000000..4569060 --- /dev/null +++ b/pkg/paasta_api/models/resource_value.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ResourceValue resource value +// +// swagger:model ResourceValue +type ResourceValue struct { + + // free + Free float64 `json:"free,omitempty"` + + // total + Total float64 `json:"total,omitempty"` + + // used + Used float64 `json:"used,omitempty"` +} + +// Validate validates this resource value +func (m *ResourceValue) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ResourceValue) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResourceValue) UnmarshalBinary(b []byte) error { + var res ResourceValue + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/smartstack_backend.go b/pkg/paasta_api/models/smartstack_backend.go new file mode 100644 index 0000000..74301d4 --- /dev/null +++ b/pkg/paasta_api/models/smartstack_backend.go @@ -0,0 +1,64 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SmartstackBackend smartstack backend +// +// swagger:model SmartstackBackend +type SmartstackBackend struct { + + // Check code reported by HAProxy + CheckCode string `json:"check_code,omitempty"` + + // Duration in ms of the last health check performed by HAProxy + CheckDuration int32 `json:"check_duration,omitempty"` + + // Status of last health check of the backend + CheckStatus string `json:"check_status,omitempty"` + + // Whether this backend has an associated task running + HasAssociatedTask bool `json:"has_associated_task,omitempty"` + + // Name of the host on which the backend is running + Hostname string `json:"hostname,omitempty"` + + // Seconds since last change in backend status + LastChange int32 `json:"last_change,omitempty"` + + // Port number on which the backend responds + Port int32 `json:"port,omitempty"` + + // Status of the backend in HAProxy + Status string `json:"status,omitempty"` +} + +// Validate validates this smartstack backend +func (m *SmartstackBackend) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SmartstackBackend) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SmartstackBackend) UnmarshalBinary(b []byte) error { + var res SmartstackBackend + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/smartstack_location.go b/pkg/paasta_api/models/smartstack_location.go new file mode 100644 index 0000000..fdc8b13 --- /dev/null +++ b/pkg/paasta_api/models/smartstack_location.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SmartstackLocation smartstack location +// +// swagger:model SmartstackLocation +type SmartstackLocation struct { + + // Smartstack backends running in this location + Backends []*SmartstackBackend `json:"backends"` + + // Name of the location + Name string `json:"name,omitempty"` + + // Number of running backends for the service in this location + RunningBackendsCount int32 `json:"running_backends_count,omitempty"` +} + +// Validate validates this smartstack location +func (m *SmartstackLocation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBackends(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SmartstackLocation) validateBackends(formats strfmt.Registry) error { + + if swag.IsZero(m.Backends) { // not required + return nil + } + + for i := 0; i < len(m.Backends); i++ { + if swag.IsZero(m.Backends[i]) { // not required + continue + } + + if m.Backends[i] != nil { + if err := m.Backends[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backends" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SmartstackLocation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SmartstackLocation) UnmarshalBinary(b []byte) error { + var res SmartstackLocation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/smartstack_status.go b/pkg/paasta_api/models/smartstack_status.go new file mode 100644 index 0000000..15f963e --- /dev/null +++ b/pkg/paasta_api/models/smartstack_status.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SmartstackStatus smartstack status +// +// swagger:model SmartstackStatus +type SmartstackStatus struct { + + // Number of backends expected to be present in each location + ExpectedBackendsPerLocation int32 `json:"expected_backends_per_location,omitempty"` + + // Locations the service is deployed + Locations []*SmartstackLocation `json:"locations"` + + // Registration name of the service in Smartstack + Registration string `json:"registration,omitempty"` +} + +// Validate validates this smartstack status +func (m *SmartstackStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLocations(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SmartstackStatus) validateLocations(formats strfmt.Registry) error { + + if swag.IsZero(m.Locations) { // not required + return nil + } + + for i := 0; i < len(m.Locations); i++ { + if swag.IsZero(m.Locations[i]) { // not required + continue + } + + if m.Locations[i] != nil { + if err := m.Locations[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("locations" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SmartstackStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SmartstackStatus) UnmarshalBinary(b []byte) error { + var res SmartstackStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/task_tail_lines.go b/pkg/paasta_api/models/task_tail_lines.go new file mode 100644 index 0000000..1166d9d --- /dev/null +++ b/pkg/paasta_api/models/task_tail_lines.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaskTailLines task tail lines +// +// swagger:model TaskTailLines +type TaskTailLines struct { + + // Error message when fetching tail lines fails + ErrorMessage string `json:"error_message,omitempty"` + + // The requested number of lines from the task's stderr + Stderr []string `json:"stderr"` + + // The requested number of lines from the task's stdout + Stdout []string `json:"stdout"` +} + +// Validate validates this task tail lines +func (m *TaskTailLines) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaskTailLines) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaskTailLines) UnmarshalBinary(b []byte) error { + var res TaskTailLines + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/swagger.json b/swagger.json new file mode 100644 index 0000000..286ca37 --- /dev/null +++ b/swagger.json @@ -0,0 +1,1682 @@ +{ + "swagger": "2.0", + "info": { + "title": "Paasta API", + "version": "1.0.0" + }, + "basePath": "/v1", + "schemes": [ + "http" + ], + "consumes": [ + "application/x-www-form-urlencoded" + ], + "produces": [ + "application/json" + ], + "tags": [ + { + "name": "service", + "description": "information about a paasta service" + } + ], + "paths": { + "/version": { + "get": { + "responses": { + "200": { + "description": "Version of paasta_tools package", + "schema": { + "type": "string" + } + } + }, + "summary": "Version of paasta_tools package", + "operationId": "showVersion" + } + }, + "/metastatus": { + "get": { + "parameters": [ + { + "in": "query", + "description": "comma separated list of command arguments", + "name": "cmd_args", + "required": true, + "type": "array", + "collectionFormat": "csv", + "items": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Detailed metastatus", + "schema": { + "$ref": "#/definitions/MetaStatus" + } + }, + "500": { + "description": "Metastatus failure" + } + }, + "summary": "Get metastatus", + "operationId": "metastatus" + } + }, + "/deploy_queue": { + "get": { + "responses": { + "200": { + "description": "Contents of deploy queue", + "schema": { + "$ref": "#/definitions/DeployQueue" + } + } + }, + "summary": "Get deploy queue contents", + "operationId": "deploy_queue" + } + }, + "/service_autoscaler/pause": { + "get": { + "responses": { + "200": { + "description": "The time until which the servcie autoscaler is paused for", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Unable to talk to zookeeper" + } + }, + "summary": "Get autoscaling pause time", + "operationId": "get_service_autoscaler_pause" + }, + "post": { + "responses": { + "200": { + "description": "Service autoscaler successfully paused" + }, + "500": { + "description": "Unable to talk to zookeeper" + } + }, + "operationId": "update_service_autoscaler_pause", + "parameters": [ + { + "in": "body", + "name": "json_body", + "required": true, + "schema": { + "type": "object", + "properties": { + "minutes": { + "type": "integer" + } + } + } + } + ] + }, + "delete": { + "responses": { + "200": { + "description": "Service autoscaler successfully unpaused" + }, + "500": { + "description": "Unable to talk to zookeeper" + } + }, + "summary": "Unpause the autoscaler", + "operationId": "delete_service_autoscaler_pause" + } + }, + "/marathon_dashboard": { + "get": { + "responses": { + "200": { + "description": "List of service instances and information on their Marathon shard", + "schema": { + "$ref": "#/definitions/MarathonDashboard" + } + } + }, + "summary": "Get marathon service instances and their shards", + "operationId": "marathon_dashboard", + "tags": [ + "marathon_dashboard" + ] + } + }, + "/resources/utilization": { + "get": { + "responses": { + "200": { + "description": "Resources in the cluster, filtered and grouped by parameters", + "schema": { + "$ref": "#/definitions/Resource" + } + }, + "400": { + "description": "Poorly formated query parameters" + } + }, + "summary": "Get resources in the cluster", + "operationId": "resources", + "tags": [ + "resources" + ], + "parameters": [ + { + "in": "query", + "description": "comma separated list of keys to group by", + "name": "groupings", + "required": false, + "type": "array", + "collectionFormat": "csv", + "items": { + "type": "string" + } + }, + { + "in": "query", + "description": "List of slave filters in format 'filter=attr_name:value1,value2&filter=attr2:value3,value4'. Matches attr_name=(value1 OR value2) AND attr2=(value3 OR value4)", + "name": "filter", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string", + "pattern": "(.*):(.*,)*(.*)" + } + } + ] + } + }, + "/services": { + "get": { + "responses": { + "200": { + "description": "Services and their instances on the current cluster", + "schema": { + "type": "object", + "properties": { + "services": { + "type": "array", + "items": { + "type": "array", + "items": {} + } + } + } + } + } + }, + "summary": "List service names and service instance names on the current cluster", + "operationId": "list_services_for_cluster", + "tags": [ + "service" + ] + } + }, + "/services/{service}": { + "get": { + "responses": { + "200": { + "description": "Instances of a service", + "schema": { + "type": "object", + "properties": { + "instances": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "summary": "List instances of service_name", + "operationId": "list_instances", + "tags": [ + "service" + ], + "parameters": [ + { + "in": "path", + "description": "Service name", + "name": "service", + "required": true, + "type": "string" + } + ] + } + }, + "/services/{service}/{instance}/state/{desired_state}": { + "post": { + "responses": { + "200": { + "description": "Result of instance state change" + }, + "404": { + "description": "Deployment key not found" + }, + "500": { + "description": "Instance failure" + } + }, + "summary": "Change state of service_name.instance_name", + "operationId": "instance_set_state", + "tags": [ + "service" + ], + "parameters": [ + { + "in": "path", + "description": "Service name", + "name": "service", + "required": true, + "type": "string" + }, + { + "in": "path", + "description": "Instance name", + "name": "instance", + "required": true, + "type": "string" + }, + { + "in": "path", + "description": "Desired state", + "name": "desired_state", + "required": true, + "type": "string" + } + ] + } + }, + "/services/{service}/{instance}/status": { + "get": { + "responses": { + "200": { + "description": "Detailed status of an instance", + "schema": { + "$ref": "#/definitions/InstanceStatus" + } + }, + "404": { + "description": "Deployment key not found" + }, + "500": { + "description": "Instance failure" + } + }, + "summary": "Get status of service_name.instance_name", + "operationId": "status_instance", + "tags": [ + "service" + ], + "parameters": [ + { + "in": "path", + "description": "Service name", + "name": "service", + "required": true, + "type": "string" + }, + { + "in": "path", + "description": "Instance name", + "name": "instance", + "required": true, + "type": "string" + }, + { + "in": "query", + "description": "Include verbose status information", + "name": "verbose", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "in": "query", + "description": "Include Smartstack information", + "name": "include_smartstack", + "required": false, + "type": "boolean" + }, + { + "in": "query", + "description": "Include Envoy information", + "name": "include_envoy", + "required": false, + "type": "boolean" + }, + { + "in": "query", + "description": "Include Mesos information", + "name": "include_mesos", + "required": false, + "type": "boolean" + } + ] + } + }, + "/services/{service}/{instance}/delay": { + "get": { + "responses": { + "200": { + "description": "The service is delayed for these possible reasons", + "schema": { + "$ref": "#/definitions/InstanceDelay" + } + }, + "204": { + "description": "Could not find any reasons for a delay" + }, + "404": { + "description": "Deployment key not found" + }, + "500": { + "description": "Instance failure" + } + }, + "summary": "Get the possible reasons for a deployment delay for a marathon service.instance", + "operationId": "delay_instance", + "tags": [ + "service" + ], + "parameters": [ + { + "in": "path", + "description": "Service name", + "name": "service", + "required": true, + "type": "string" + }, + { + "in": "path", + "description": "Instance name", + "name": "instance", + "required": true, + "type": "string" + } + ] + } + }, + "/services/{service}/{instance}/tasks": { + "get": { + "responses": { + "200": { + "description": "List of tasks associated with an instance", + "schema": { + "$ref": "#/definitions/InstanceTasks" + } + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Deployment key not found" + }, + "500": { + "description": "Instance failure" + } + }, + "summary": "Get mesos tasks of service_name.instance_name", + "operationId": "tasks_instance", + "tags": [ + "service" + ], + "parameters": [ + { + "in": "path", + "description": "Service name", + "name": "service", + "required": true, + "type": "string" + }, + { + "in": "path", + "description": "Instance name", + "name": "instance", + "required": true, + "type": "string" + }, + { + "in": "query", + "description": "slave hostname to filter tasks by", + "name": "slave_hostname", + "required": false, + "type": "string" + }, + { + "in": "query", + "description": "Return slave and executor for task", + "name": "verbose", + "required": false, + "type": "boolean" + } + ] + } + }, + "/services/{service}/{instance}/tasks/{task_id}": { + "get": { + "responses": { + "200": { + "description": "Task associated with an instance with specified ID", + "schema": { + "$ref": "#/definitions/InstanceTask" + } + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Task with ID not found" + }, + "500": { + "description": "Instance failure" + } + }, + "summary": "Get mesos task of service_name.instance_name by task_id", + "operationId": "task_instance", + "tags": [ + "service" + ], + "parameters": [ + { + "in": "path", + "description": "Service name", + "name": "service", + "required": true, + "type": "string" + }, + { + "in": "path", + "description": "Instance name", + "name": "instance", + "required": true, + "type": "string" + }, + { + "in": "path", + "description": "mesos task id", + "name": "task_id", + "required": true, + "type": "string" + }, + { + "in": "query", + "description": "Return slave and executor for task", + "name": "verbose", + "required": false, + "type": "boolean" + } + ] + } + }, + "/services/{service}/{instance}/autoscaler": { + "get": { + "responses": { + "200": { + "description": "Get desired instance count for a service instance", + "schema": { + "type": "object", + "properties": { + "desired_instances": { + "type": "integer" + } + } + } + }, + "404": { + "description": "Deployment key not found" + }, + "500": { + "description": "Instance failure" + } + }, + "summary": "Get status of service_name.instance_name", + "operationId": "get_autoscaler_count", + "tags": [ + "autoscaler" + ], + "parameters": [ + { + "in": "path", + "description": "Service name", + "name": "service", + "required": true, + "type": "string" + }, + { + "in": "path", + "description": "Instance name", + "name": "instance", + "required": true, + "type": "string" + } + ] + }, + "post": { + "responses": { + "202": { + "description": "Set desired instance count for a service instance", + "schema": { + "type": "object", + "properties": { + "desired_instances": { + "type": "integer" + }, + "status": { + "type": "string" + } + } + } + }, + "404": { + "description": "Deployment key not found" + }, + "500": { + "description": "Instance failure" + } + }, + "summary": "Get status of service_name.instance_name", + "operationId": "update_autoscaler_count", + "tags": [ + "autoscaler" + ], + "parameters": [ + { + "in": "path", + "description": "Service name", + "name": "service", + "required": true, + "type": "string" + }, + { + "in": "path", + "description": "Instance name", + "name": "instance", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "json_body", + "required": true, + "schema": { + "type": "object", + "properties": { + "desired_instances": { + "type": "integer" + }, + "calculated_instances": { + "type": "integer" + } + } + } + } + ] + } + } + }, + "definitions": { + "InstanceStatus": { + "type": "object", + "properties": { + "service": { + "type": "string", + "description": "Service name" + }, + "instance": { + "type": "string", + "description": "Instance name" + }, + "git_sha": { + "type": "string", + "description": "Git sha of a service" + }, + "marathon": { + "$ref": "#/definitions/InstanceStatusMarathon", + "description": "Marathon instance status" + }, + "kubernetes": { + "$ref": "#/definitions/InstanceStatusKubernetes", + "description": "Kubernetes instance status" + }, + "tron": { + "$ref": "#/definitions/InstanceStatusTron", + "description": "Tron instance status" + }, + "adhoc": { + "$ref": "#/definitions/InstanceStatusAdhoc", + "description": "Adhoc instance status" + }, + "flink": { + "type": "object", + "properties": { + "status": { + "$ref": "#/definitions/InstanceStatusFlink" + }, + "metadata": { + "$ref": "#/definitions/InstanceMetadataFlink" + } + }, + "description": "Nullable Flink instance status and metadata" + }, + "kafkacluster": { + "type": "object", + "properties": { + "status": { + "$ref": "#/definitions/InstanceStatusKafkaCluster" + }, + "metadata": { + "$ref": "#/definitions/InstanceMetadataKafkaCluster" + } + }, + "description": "Nullable KafkaCluster instance status and metadata" + } + } + }, + "InstanceDelay": { + "type": "object" + }, + "InstanceStatusMarathon": { + "type": "object", + "properties": { + "desired_state": { + "type": "string", + "description": "Desired state of a service, for Marathon", + "enum": [ + "start", + "stop" + ] + }, + "app_count": { + "type": "integer", + "format": "int32", + "description": "The number of different running versions of the same service (0 for stopped, 1 for running and 1+ for bouncing)" + }, + "desired_app_id": { + "type": "string", + "description": "ID of the desired version of a service instance" + }, + "bounce_method": { + "type": "string", + "description": "Method to transit between new and old versions of a service", + "enum": [ + "brutal", + "upthendown", + "downthenup", + "crossover" + ] + }, + "deploy_status": { + "type": "string", + "description": "Deploy status of a marathon service", + "enum": [ + "Running", + "Deploying", + "Stopped", + "Delayed", + "Waiting", + "Waiting for bounce", + "NotRunning" + ] + }, + "backoff_seconds": { + "type": "integer", + "format": "int32", + "description": "backoff in seconds before launching the next task" + }, + "running_instance_count": { + "type": "integer", + "format": "int32", + "description": "The number of actual running instances of the service" + }, + "expected_instance_count": { + "type": "integer", + "format": "int32", + "description": "The number of desired instances of the service" + }, + "autoscaling_info": { + "$ref": "#/definitions/MarathonAutoscalingInfo", + "description": "Autoscaling information for the service" + }, + "app_statuses": { + "type": "array", + "description": "Statuses of each app of the service", + "items": { + "$ref": "#/definitions/MarathonAppStatus" + } + }, + "mesos": { + "$ref": "#/definitions/MarathonMesosStatus", + "description": "Status of the service in Mesos" + }, + "smartstack": { + "$ref": "#/definitions/SmartstackStatus", + "description": "Status of the service in smartstack" + }, + "envoy": { + "$ref": "#/definitions/EnvoyStatus", + "description": "Status of the service in Envoy" + }, + "error_message": { + "type": "string", + "description": "Error message when a marathon job ID cannot be found" + } + }, + "required": [ + "desired_state", + "app_count", + "bounce_method" + ] + }, + "MarathonMesosStatus": { + "type": "object", + "properties": { + "running_task_count": { + "type": "integer", + "format": "int32", + "description": "The number of running Mesos tasks associated to this service" + }, + "running_tasks": { + "type": "array", + "description": "Currently running tasks associated to this service", + "items": { + "$ref": "#/definitions/MarathonMesosRunningTask" + } + }, + "non_running_tasks": { + "type": "array", + "description": "Non-running tasks associated to this service", + "items": { + "$ref": "#/definitions/MarathonMesosNonrunningTask" + } + }, + "error_message": { + "type": "string", + "description": "Error message when Mesos tasks cannot be queried" + } + } + }, + "MarathonMesosRunningTask": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the task in Mesos" + }, + "hostname": { + "type": "string", + "description": "Name of the Mesos agent on which this task is running" + }, + "mem_limit": { + "$ref": "#/definitions/IntegerAndError", + "description": "The maximum amount of memory the task is allowed to use" + }, + "rss": { + "$ref": "#/definitions/IntegerAndError", + "description": "The tasks's resident set size" + }, + "cpu_shares": { + "$ref": "#/definitions/FloatAndError", + "description": "The portion of a CPU that the task can use" + }, + "cpu_used_seconds": { + "$ref": "#/definitions/FloatAndError", + "description": "The number of seconds of CPU time the task has used" + }, + "duration_seconds": { + "type": "integer", + "format": "int32", + "description": "The duration over which the task has been running in seconds" + }, + "deployed_timestamp": { + "type": "number", + "format": "float", + "description": "The unix timestamp at which the task was deployed" + }, + "tail_lines": { + "$ref": "#/definitions/TaskTailLines", + "description": "Stdout and stderr tail of the task" + } + } + }, + "MarathonMesosNonrunningTask": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the task in Mesos" + }, + "hostname": { + "type": "string", + "description": "Name of the Mesos agent on which this task is running" + }, + "deployed_timestamp": { + "type": "number", + "format": "float", + "description": "The unix timestamp at which the task was deployed" + }, + "state": { + "type": "string", + "description": "The current state of the task" + }, + "tail_lines": { + "$ref": "#/definitions/TaskTailLines", + "description": "Stdout and stderr tail of the task" + } + } + }, + "TaskTailLines": { + "type": "object", + "properties": { + "stdout": { + "type": "array", + "description": "The requested number of lines from the task's stdout", + "items": { + "type": "string" + } + }, + "stderr": { + "type": "array", + "description": "The requested number of lines from the task's stderr", + "items": { + "type": "string" + } + }, + "error_message": { + "type": "string", + "description": "Error message when fetching tail lines fails" + } + } + }, + "MarathonAutoscalingInfo": { + "type": "object", + "properties": { + "current_instances": { + "type": "integer", + "format": "int32", + "description": "The number of instances of the service currently running" + }, + "max_instances": { + "type": "integer", + "format": "int32", + "description": "The maximum number of instances that the autoscaler will scale to" + }, + "min_instances": { + "type": "integer", + "format": "int32", + "description": "The minimum number of instances that the autoscaler will scale to" + }, + "current_utilization": { + "type": "number", + "format": "float", + "description": "The current utilization of the instances' allocated resources" + }, + "target_instances": { + "type": "integer", + "format": "int32", + "description": "The autoscaler's current target number of instances of this service to run" + } + } + }, + "MarathonAppStatus": { + "type": "object", + "properties": { + "tasks_running": { + "type": "integer", + "format": "int32", + "description": "Number running tasks for this app" + }, + "tasks_healthy": { + "type": "integer", + "format": "int32", + "description": "Number of healthy tasks for this app" + }, + "tasks_staged": { + "type": "integer", + "format": "int32", + "description": "Number of staged tasks for this app" + }, + "tasks_total": { + "type": "integer", + "format": "int32", + "description": "Total number of tasks for this app" + }, + "create_timestamp": { + "type": "number", + "format": "float", + "description": "Unix timestamp when this app was created" + }, + "deploy_status": { + "type": "string", + "description": "Deploy status of this app" + }, + "dashboard_url": { + "type": "string", + "description": "Marathon dashboard URL for this app" + }, + "backoff_seconds": { + "type": "integer", + "format": "int32", + "description": "Backoff in seconds before launching next task" + }, + "unused_offer_reason_counts": { + "type": "object", + "description": "Mapping of reason offer was refused to the number of times that type of refusal was seen" + }, + "tasks": { + "type": "array", + "description": "Tasks associated to this app", + "items": { + "$ref": "#/definitions/MarathonTask" + } + } + } + }, + "MarathonTask": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "ID of the task in Mesos" + }, + "host": { + "type": "string", + "description": "Name of the host on which the task is running" + }, + "port": { + "type": "integer", + "format": "int32", + "description": "Port on which the task is listening" + }, + "deployed_timestamp": { + "type": "number", + "format": "float", + "description": "Time at which the task was deployed" + }, + "is_healthy": { + "type": "boolean", + "description": "Whether Marathon thinks the task is healthy" + } + } + }, + "SmartstackStatus": { + "type": "object", + "properties": { + "registration": { + "type": "string", + "description": "Registration name of the service in Smartstack" + }, + "expected_backends_per_location": { + "type": "integer", + "format": "int32", + "description": "Number of backends expected to be present in each location" + }, + "locations": { + "type": "array", + "description": "Locations the service is deployed", + "items": { + "$ref": "#/definitions/SmartstackLocation" + } + } + } + }, + "SmartstackLocation": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the location" + }, + "running_backends_count": { + "type": "integer", + "format": "int32", + "description": "Number of running backends for the service in this location" + }, + "backends": { + "type": "array", + "description": "Smartstack backends running in this location", + "items": { + "$ref": "#/definitions/SmartstackBackend" + } + } + } + }, + "SmartstackBackend": { + "type": "object", + "properties": { + "hostname": { + "type": "string", + "description": "Name of the host on which the backend is running" + }, + "port": { + "type": "integer", + "format": "int32", + "description": "Port number on which the backend responds" + }, + "status": { + "type": "string", + "description": "Status of the backend in HAProxy" + }, + "check_status": { + "type": "string", + "description": "Status of last health check of the backend" + }, + "check_code": { + "type": "string", + "description": "Check code reported by HAProxy" + }, + "check_duration": { + "type": "integer", + "format": "int32", + "description": "Duration in ms of the last health check performed by HAProxy" + }, + "last_change": { + "type": "integer", + "format": "int32", + "description": "Seconds since last change in backend status" + }, + "has_associated_task": { + "type": "boolean", + "description": "Whether this backend has an associated task running" + } + } + }, + "EnvoyStatus": { + "type": "object", + "properties": { + "registration": { + "type": "string", + "description": "Registration name of the service in Smartstack" + }, + "expected_backends_per_location": { + "type": "integer", + "format": "int32", + "description": "Number of backends expected to be present in each location" + }, + "locations": { + "type": "array", + "description": "Locations the service is deployed", + "items": { + "$ref": "#/definitions/EnvoyLocation" + } + } + } + }, + "EnvoyLocation": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the location" + }, + "running_backends_count": { + "type": "integer", + "format": "int32", + "description": "Number of running backends for the service in this location" + }, + "backends": { + "type": "array", + "description": "Envoy backends running in this location", + "items": { + "$ref": "#/definitions/EnvoyBackend" + } + }, + "is_proxied_through_casper": { + "type": "boolean", + "description": "Whether this backend is proxied through Casper" + } + } + }, + "EnvoyBackend": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "Address of the host on which the backend is running" + }, + "port_value": { + "type": "integer", + "format": "int32", + "description": "Port number on which the backend responds" + }, + "hostname": { + "type": "string", + "description": "Name of the host on which the backend is running" + }, + "eds_health_status": { + "type": "string", + "description": "Status of the backend in Envoy as reported by the EDS" + }, + "weight": { + "type": "integer", + "format": "int32", + "description": "The weight of this backend in the cluster" + }, + "has_associated_task": { + "type": "boolean", + "description": "Whether this backend has an associated task running" + } + } + }, + "InstanceStatusKubernetes": { + "type": "object", + "properties": { + "desired_state": { + "type": "string", + "description": "Desired state of a service, for Kubernetes", + "enum": [ + "start", + "stop" + ] + }, + "app_count": { + "type": "integer", + "format": "int32", + "description": "The number of different running versions of the same service (0 for stopped, 1 for running and 1+ for bouncing)" + }, + "app_id": { + "type": "string", + "description": "ID of the desired version of a service instance" + }, + "bounce_method": { + "type": "string", + "description": "Method to transit between new and old versions of a service", + "enum": [ + "brutal", + "upthendown", + "downthenup", + "crossover" + ] + }, + "deploy_status": { + "type": "string", + "description": "Deploy status of a Kubernetes service", + "enum": [ + "Running", + "Deploying", + "Stopped", + "Delayed", + "Waiting", + "NotRunning" + ] + }, + "deploy_status_message": { + "type": "string", + "description": "Reason for the deploy status" + }, + "backoff_seconds": { + "type": "integer", + "format": "int32", + "description": "backoff in seconds before launching the next task" + }, + "running_instance_count": { + "type": "integer", + "format": "int32", + "description": "The number of actual running instances of the service" + }, + "expected_instance_count": { + "type": "integer", + "format": "int32", + "description": "The number of desired instances of the service" + }, + "create_timestamp": { + "type": "number", + "format": "float", + "description": "Unix timestamp when this app was created" + }, + "smartstack": { + "$ref": "#/definitions/SmartstackStatus", + "description": "Status of the service in smartstack" + }, + "namespace": { + "type": "string", + "description": "The namespace this app is running" + }, + "replicasets": { + "type": "array", + "description": "ReplicaSets associated to this app", + "items": { + "$ref": "#/definitions/KubernetesReplicaSet" + } + }, + "pods": { + "type": "array", + "description": "Pods associated to this app", + "items": { + "$ref": "#/definitions/KubernetesPod" + } + }, + "autoscaling_status": { + "type": "object", + "description": "HPA associated to this app", + "properties": { + "min_instances": { + "type": "integer", + "description": "min_instances as specified in yelpsoa_configs" + }, + "max_instances": { + "type": "integer", + "description": "min_instances as specified in yelpsoa_configs" + }, + "desired_replicas": { + "type": "integer", + "description": "desired number of _instances as calculated by HPA" + }, + "last_scale_time": { + "type": "string", + "description": "timestamp of last autoscale" + }, + "metrics": { + "type": "array", + "description": "Current metrics", + "items": { + "$ref": "#/definitions/HPAMetric" + } + } + } + }, + "error_message": { + "type": "string", + "description": "Error message when a kubernetes object (Deployment/Statefulset) cannot be found" + } + }, + "required": [ + "desired_state", + "app_count", + "bounce_method" + ] + }, + "HPAMetric": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "name of the metric" + }, + "target_value": { + "type": "string", + "description": "setpoint/target_value as specified in yelpsoa_configs" + }, + "current_value": { + "type": "string", + "description": "setpoint/target_value as specified in yelpsoa_configs" + } + } + }, + "KubernetesReplicaSet": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "name of the replicaset in Kubernetes" + }, + "ready_replicas": { + "type": "integer", + "format": "int32", + "description": "number of ready replicas for the replicaset" + }, + "replicas": { + "type": "integer", + "format": "int32", + "description": "number of desired replicas for the replicaset" + }, + "create_timestamp": { + "type": "number", + "format": "float", + "description": "Time at which the replicaset was created" + } + } + }, + "KubernetesPod": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "name of the pod in Kubernetes" + }, + "host": { + "type": "string", + "description": "name of the pod's host" + }, + "deployed_timestamp": { + "type": "number", + "format": "float", + "description": "Time at which the pod was deployed" + }, + "phase": { + "type": "string", + "description": "The status of the pod" + }, + "ready": { + "type": "boolean", + "description": "Whether or not the pod is ready (i.e. all containers up)" + }, + "containers": { + "type": "array", + "items": { + "$ref": "#/definitions/KubernetesContainer", + "description": "List of containers in the pod" + } + }, + "reason": { + "type": "string", + "x-nullable": true, + "description": "short message explaining the pod's state" + }, + "message": { + "type": "string", + "x-nullable": true, + "description": "long message explaining the pod's state" + } + } + }, + "KubernetesContainer": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the container" + }, + "tail_lines": { + "$ref": "#/definitions/TaskTailLines", + "description": "Stdout and stderr tail of the container" + } + } + }, + "InstanceStatusTron": { + "type": "object", + "required": [ + "job_name", + "job_url" + ], + "properties": { + "job_name": { + "type": "string", + "description": "The name of this job" + }, + "job_status": { + "type": "string", + "description": "The status of the job" + }, + "job_schedule": { + "type": "string", + "description": "The job schedule of the job" + }, + "job_url": { + "type": "string", + "description": "The dashboard url of the job" + }, + "action_name": { + "type": "string", + "description": "The name of the action" + }, + "action_state": { + "type": "string", + "description": "The state of the action" + }, + "action_raw_command": { + "type": "string", + "description": "The raw command of the action" + }, + "action_command": { + "type": "string", + "description": "The command of the action" + }, + "action_start_time": { + "type": "string", + "description": "The start time of the action" + }, + "action_stderr": { + "type": "string", + "description": "The stderr command of the action" + }, + "action_stdout": { + "type": "string", + "description": "The stdout command of the action" + } + } + }, + "InstanceStatusFlink": { + "type": "object", + "description": "Flink instance status" + }, + "InstanceMetadataFlink": { + "type": "object", + "description": "Flink instance metadata" + }, + "InstanceStatusKafkaCluster": { + "type": "object", + "description": "Kafka instance status" + }, + "InstanceMetadataKafkaCluster": { + "type": "object", + "description": "Kafka instance metadata" + }, + "InstanceSpecKafkaCluster": { + "type": "object", + "description": "Kafka instance spec" + }, + "InstanceTasks": { + "type": "array", + "description": "List of tasks associated with instance", + "items": { + "$ref": "#/definitions/InstanceTask" + } + }, + "InstanceTask": { + "type": "object" + }, + "InstanceStatusAdhoc": { + "type": "array", + "description": "List of runs associated with job", + "items": { + "$ref": "#/definitions/AdhocLaunchHistory" + } + }, + "AdhocLaunchHistory": { + "type": "object", + "description": "A single run", + "properties": { + "launch_time": { + "type": "string", + "description": "when the job was launched" + }, + "run_id": { + "type": "string", + "description": "id of the single run" + }, + "framework_id": { + "type": "string", + "description": "framework id" + } + } + }, + "MarathonDashboard": { + "type": "object", + "description": "A list of Marathon service, instance, and shard url for one or more clusters", + "additionalProperties": { + "$ref": "#/definitions/MarathonDashboardCluster" + } + }, + "MarathonDashboardCluster": { + "type": "array", + "description": "List of all the MarathonDashboardItems for a cluster", + "items": { + "$ref": "#/definitions/MarathonDashboardItem" + } + }, + "MarathonDashboardItem": { + "type": "object", + "description": "Marathon service, instance, and shard url", + "properties": { + "service": { + "type": "string", + "description": "Service name" + }, + "instance": { + "type": "string", + "description": "Instance name" + }, + "shard_url": { + "type": "string", + "description": "Marathon Shard URL" + } + } + }, + "MetaStatus": { + "type": "object", + "description": "Result of `paasta metastatus` command", + "properties": { + "output": { + "type": "string", + "description": "Output from `paasta metastatus` command" + }, + "exit_code": { + "type": "integer", + "description": "Exit code from `paasta metastatus` command" + } + } + }, + "DeployQueue": { + "type": "object", + "description": "Current state of the deployd queue", + "properties": { + "available_service_instances": { + "type": "array", + "description": "Service instances that are ready to be acted on by deployd", + "items": { + "$ref": "#/definitions/DeployQueueServiceInstance" + } + }, + "unavailable_service_instances": { + "type": "array", + "description": "Service instances that deployd is waiting to act on", + "items": { + "$ref": "#/definitions/DeployQueueServiceInstance" + } + } + } + }, + "DeployQueueServiceInstance": { + "type": "object", + "description": "An instance of a service in the deploy queue", + "properties": { + "service": { + "type": "string", + "description": "Name of the service" + }, + "instance": { + "type": "string", + "description": "Name of the instance of the service" + }, + "bounce_by": { + "type": "number", + "format": "float", + "description": "Desired timestamp by which the service instance should be bounced" + }, + "wait_until": { + "type": "number", + "format": "float", + "description": "Timestamp before which no action should be taken on this service instance" + }, + "enqueue_time": { + "type": "number", + "format": "float", + "description": "Timestamp at which the service instance was last added to the queue" + }, + "bounce_start_time": { + "type": "number", + "format": "float", + "description": "Timestamp at which service instance was first added to the queue" + }, + "watcher": { + "type": "string", + "description": "The process that enqueued the task" + }, + "failures": { + "type": "integer", + "format": "int32", + "description": "Number of times deployment actions have failed on this service instance" + }, + "processed_count": { + "type": "integer", + "format": "int32", + "description": "Number of times any deployment action has been taken on this service instance" + } + } + }, + "Resource": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceItem" + } + }, + "ResourceItem": { + "type": "object", + "properties": { + "groupings": { + "type": "object" + }, + "cpus": { + "$ref": "#/definitions/ResourceValue" + }, + "mem": { + "$ref": "#/definitions/ResourceValue" + }, + "disk": { + "$ref": "#/definitions/ResourceValue" + } + } + }, + "ResourceValue": { + "type": "object", + "properties": { + "free": { + "type": "number" + }, + "used": { + "type": "number" + }, + "total": { + "type": "number" + } + } + }, + "FloatAndError": { + "type": "object", + "properties": { + "value": { + "type": "number", + "format": "float" + }, + "error_message": { + "type": "string" + } + } + }, + "IntegerAndError": { + "type": "object", + "properties": { + "value": { + "type": "integer", + "format": "int32" + }, + "error_message": { + "type": "string" + } + } + } + } +} From 86939805ce7dbf889c665e14c10eae1dd438fca6 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Mon, 25 Nov 2019 18:25:13 +0100 Subject: [PATCH 02/38] configstore for access to paasta system and instance configs in json and yaml files --- go.mod | 42 ++--- go.sum | 228 ---------------------------- pkg/configstore/store.go | 107 ++++--------- pkg/configstore/store_test.go | 93 +++--------- pkg/deployments/deployments.go | 15 +- pkg/deployments/deployments_test.go | 71 +++++---- pkg/volumes/converter_test.go | 16 +- pkg/volumes/volumes.go | 11 +- pkg/volumes/volumes_test.go | 16 +- 9 files changed, 126 insertions(+), 473 deletions(-) diff --git a/go.mod b/go.mod index 323769e..d766678 100644 --- a/go.mod +++ b/go.mod @@ -1,35 +1,23 @@ module github.com/Yelp/paasta-tools-go require ( - github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754 - github.com/fatih/structs v1.1.0 - github.com/go-logr/zapr v0.1.1 // indirect + github.com/fatih/structs v1.1.0 // indirect github.com/gogo/protobuf v1.2.1 // indirect - github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 // indirect - github.com/hashicorp/golang-lru v0.5.3 // indirect - github.com/imdario/mergo v0.3.8 // indirect - github.com/mitchellh/mapstructure v1.2.2 + github.com/json-iterator/go v1.1.7 // indirect + github.com/mitchellh/mapstructure v1.1.2 github.com/modern-go/reflect2 v1.0.1 // indirect - github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 - github.com/pborman/uuid v1.2.0 // indirect - github.com/pkg/errors v0.8.1 - github.com/pmezard/go-difflib v1.0.0 - github.com/prometheus/client_golang v1.3.0 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/spf13/pflag v1.0.3 // indirect - github.com/stretchr/testify v1.4.0 - github.com/subosito/gotenv v1.2.0 - go.uber.org/zap v1.13.0 // indirect - golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 // indirect - golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 // indirect - golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect - gopkg.in/yaml.v2 v2.2.2 - k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b - k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d - k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible - k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a // indirect - k8s.io/kubernetes v1.14.0 - k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 // indirect - sigs.k8s.io/controller-runtime v0.2.2 + github.com/stretchr/testify v1.3.0 + golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 // indirect + golang.org/x/text v0.3.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v2 v2.2.2 // indirect + k8s.io/api v0.0.0-20190202010724-74b699b93c15 + k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c + k8s.io/klog v0.2.0 // indirect + k8s.io/kubernetes v1.14.0 // indirect + sigs.k8s.io/yaml v1.1.0 // indirect ) -go 1.12 +go 1.13 diff --git a/go.sum b/go.sum index f725407..f54e037 100644 --- a/go.sum +++ b/go.sum @@ -1,278 +1,50 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/appscode/jsonpatch v2.0.1+incompatible h1:Ksl+gGquV3TeYmiZPBsDNauiyloE7sg9OMUWKr5Ctmg= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754 h1:Qd6djMDE2KFeLwuKQ4B316XYt101DFoymbgoxFHeKCY= -github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754/go.mod h1:rTr8X4qZPRmQKsyAjhECPi+zPnmlcmv5W9s1F11oBSo= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= -github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-logr/zapr v0.1.1 h1:qXBXPDdNncunGs7XeEpsJt8wCjYBygluzfdLO0G5baE= -github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= -github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= -github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= -github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= -github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.2.2 h1:dxe5oCinTXiTIcfgmZecdCzPmAJKd46KsCWc35r0TV4= -github.com/mitchellh/mapstructure v1.2.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= -github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.3.0 h1:miYCvYqFXtl/J9FIy8eNpBfYthAEFg+Ys0XyUVEcDsc= -github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.1.0 h1:ElTg5tNp4DqfV7UQjDqv2+RJlNzsDtvNAWccbItceIE= -github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 h1:ulvT7fqt0yHWzpJwI57MezWnYDVpCAYBVuYst/L+fAY= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f h1:68K/z8GLUxV76xGSqwTWw2gyk/jwn79LUL43rES2g8o= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gomodules.xyz/jsonpatch/v2 v2.0.1 h1:xyiBuvkD2g5n7cYzx6u2sxQvsAy4QJsZFCzGVdzOXZ0= -gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= k8s.io/api v0.0.0-20190202010724-74b699b93c15 h1:AoUGjnJ3PJMFz+Rkp4lx3X+6mPUnY1MESJhbUSGX+pc= k8s.io/api v0.0.0-20190202010724-74b699b93c15/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= -k8s.io/api v0.0.0-20190313235455-40a48860b5ab h1:DG9A67baNpoeweOy2spF1OWHhnVY5KR7/Ek/+U1lVZc= -k8s.io/api v0.0.0-20190313235455-40a48860b5ab/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= -k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b h1:aBGgKJUM9Hk/3AE8WaZIApnTxG35kbuQba2w+SXqezo= -k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= -k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8 h1:q1Qvjzs/iEdXF6A1a8H3AKVFDzJNcJn3nXMs6R6qFtA= -k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c h1:02KEBFny6M5VWKj6Y8Ns27epjefTqLJXD4fvqP5tGFg= k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= -k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1 h1:IS7K02iBkQXpCeieSiyJjGoLSdVOv2DbPaWHJ+ZtgKg= -k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= -k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d h1:Jmdtdt1ZnoGfWWIIik61Z7nKYgO3J+swQJtPYsP9wHA= -k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= -k8s.io/client-go v11.0.0+incompatible h1:LBbX2+lOwY9flffWlJM7f1Ct8V2SRNiMRDFeiwnJo9o= -k8s.io/client-go v11.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= -k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible h1:U5Bt+dab9K8qaUmXINrkXO135kA11/i5Kg1RUydgaMQ= -k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.2.0 h1:0ElL0OHzF3N+OhoJTL0uca20SxtYt4X4+bzHeqrB83c= k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE= -k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kubernetes v1.14.0 h1:6T2iAEoOYQnzQb3WvPlUkcczEEXZ7+YPlAO8olwujRw= k8s.io/kubernetes v1.14.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 h1:p0Ai3qVtkbCG/Af26dBmU0E1W58NID3hSSh7cMyylpM= -k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -sigs.k8s.io/controller-runtime v0.1.10 h1:amLOmcekVdnsD1uIpmgRqfTbQWJ2qxvQkcdeFhcotn4= -sigs.k8s.io/controller-runtime v0.1.10/go.mod h1:HFAYoOh6XMV+jKF1UjFwrknPbowfyHEHHRdJMf2jMX8= -sigs.k8s.io/controller-runtime v0.2.2 h1:JT/vJJhUjjL9NZNwnm8AXmqCBUXSCFKmTaNjwDi28N0= -sigs.k8s.io/controller-runtime v0.2.2/go.mod h1:9dyohw3ZtoXQuV1e766PHUn+cmrRCIcBh6XIMFNMZ+I= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/testing_frameworks v0.1.1/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9qL6ht1zEr/U= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/pkg/configstore/store.go b/pkg/configstore/store.go index 9e36b95..f0c959d 100644 --- a/pkg/configstore/store.go +++ b/pkg/configstore/store.go @@ -1,6 +1,3 @@ -// Package configstore provides an object to fetch config data from disk -// according to PaaSTA conventions. Loaded values are cached to avoid repeated -// disk access. For more details, see docs for `configstore.Store`. package configstore import ( @@ -15,31 +12,10 @@ import ( "github.com/mitchellh/mapstructure" ) -// Store is a container that fetches and caches config values from disk and -// destructures them into PaaSTA value structures. -// -// `Store` object will mimic config loading from original paasta-tools, which -// works as following for `store.Get("foo")` call: -// -// 1. look on disk for file `foo.json` or `foo.yaml` -// 2. if file exists, load it and fetch `foo` key from top-level dictionary -// 3. if file is missing, load all `.json` or `.yaml` files and merge them -// into single dictionary and look for `foo` key in there -// -// To avoid eagerly loading all existing configuration files, `Store` object -// accepts optional `hints` dictionary, with mapping from keys to file paths, -// where to look for those keys. If requested key is missing from hints, it will -// trigger eager loading as per default functionality. -// -// There are two ways to get config data, via `Get` or `Load` methods. `Get` -// will parse the config value and return it as `interface{}` type, while `Load` -// will accept destination pointer and use `mapstructure.Decode` to destructure -// the value. -// -// TODO: since `Store` is meant to be a long-lived object we need to keep track -// of updated configs and a possibility to manually reset the cache. +// Store holds config data type Store struct { - Data *sync.Map + // If you care about sanity, never write here, just read + Data map[string]interface{} Dir string Hints map[string]string sync.Mutex @@ -52,7 +28,7 @@ type Store struct { func listFiles(dirname string) ([]string, error) { files, err := ioutil.ReadDir(dirname) if err != nil { - return nil, fmt.Errorf("Failed to list directory %v: %v", dirname, err) + return nil, err } ret := make([]string, len(files)) @@ -67,7 +43,7 @@ func parseFile(path string, value interface{}) error { reader, err := os.Open(path) defer reader.Close() if err != nil { - return fmt.Errorf("Failed to open %s: %v", path, err) + return err } return json.NewDecoder(reader).Decode(value) @@ -93,7 +69,6 @@ func NewStore(dir string, hints map[string]string) *Store { hints = map[string]string{} } return &Store{ - Data: &sync.Map{}, Dir: dir, Hints: hints, ListFiles: listFiles, @@ -106,15 +81,15 @@ func NewStore(dir string, hints map[string]string) *Store { // into s.Data, unlock the mutex func (s *Store) loadPath(path string) error { value := map[string]interface{}{} - err := s.ParseFile(path, &value) + err := s.ParseFile(path, value) if err != nil { - return fmt.Errorf("Failed to parse %s: %v", path, err) + return err } s.Lock() defer s.Unlock() for key, val := range value { - s.Data.Store(key, val) + s.Data[key] = val } return nil @@ -124,90 +99,68 @@ func (s *Store) loadPath(path string) error { func (s *Store) loadAll() error { files, err := s.ListFiles(s.Dir) if err != nil { - return fmt.Errorf("Failed to list %s: %v", s.Dir, err) + return err } for _, file := range files { - filepath := path.Join(s.Dir, file) - err := s.loadPath(filepath) + err := s.loadPath(path.Join(s.Dir, file)) if err != nil { - return fmt.Errorf("Failed to load %s: %v", filepath, err) + return err } } return nil } -var extensions = []string{"json", "yaml"} - // Look for `file`.json or `file`.yaml, if not found try loading all files and // print a warning about hints func (s *Store) load(file string) error { + extensions := []string{"json", "yaml"} for _, ext := range extensions { path := path.Join(s.Dir, fmt.Sprintf("%s.%s", file, ext)) exists, err := s.FileExists(path) if err != nil { - return fmt.Errorf("Failed to find %s: %v", path, err) + return err } if exists { - err = s.loadPath(path) - if err != nil { - return fmt.Errorf("Failed to load %s: %v", path, err) - } - return nil + return s.loadPath(path) } } - return nil + log.Printf( + "WARN: loading all configs, consider adding some hints" + + fmt.Sprintf("for %s in %s", file, s.Dir), + ) + return s.loadAll() } // Get returns value for given `key`. If not found in `s.data`, call // `s.load` function with `file` from `s.hints` or `key` itself. -func (s *Store) Get(key string) (interface{}, bool, error) { - if val, ok := s.Data.Load(key); ok { - return val, ok, nil +func (s *Store) Get(key string) (interface{}, error) { + if val, ok := s.Data[key]; ok { + return val, nil } var file string - var fromHint bool if val, ok := s.Hints[key]; ok { file = val - fromHint = true } else { file = key - fromHint = false - } - err := s.load(file) - if err != nil { - return nil, false, fmt.Errorf("Failed to load %v: %v", file, err) } + s.load(file) - val, ok := s.Data.Load(key) + val, ok := s.Data[key] if !ok { - if !fromHint { - log.Printf( - "WARN: loading all configs, consider adding some hints in %s", - path.Join(s.Dir, file), - ) - err := s.loadAll() - if err != nil { - return nil, false, fmt.Errorf("failed to load all configs: %v", err) - } - val, ok = s.Data.Load(key) - } + return nil, fmt.Errorf("key not found: %s", key) } - - return val, ok, nil + return val, nil } // Load uses mapstructure.Decode to parse result of a Get into provided // destination value -func (s *Store) Load(key string, dst interface{}) (bool, error) { - val, ok, err := s.Get(key) +func (s *Store) Load(key string, dst interface{}) error { + val, err := s.Get(key) if err != nil { - return false, fmt.Errorf("Failed to get %s: %v", key, err) - } - if !ok { - return false, nil + return err } - return true, mapstructure.Decode(val, dst) + return mapstructure.Decode(val, dst) } diff --git a/pkg/configstore/store_test.go b/pkg/configstore/store_test.go index 6289b2d..2662c67 100644 --- a/pkg/configstore/store_test.go +++ b/pkg/configstore/store_test.go @@ -2,7 +2,6 @@ package configstore import ( "fmt" - "sync" "testing" ) @@ -40,21 +39,21 @@ func unexpectedfileExists(test *testing.T) func(path string) (bool, error) { func TestStore_loadPath(test *testing.T) { key := "test key" s := &Store{ - Data: &sync.Map{}, + Data: map[string]interface{}{}, ParseFile: func(file string, val interface{}) error { - v, ok := val.(*map[string]interface{}) + v, ok := val.(map[string]interface{}) if !ok { panic("assert failed") } - (*v)[key] = file + v[key] = file return nil }, } expected := "old value" - s.Data.Store(key, expected) + s.Data[key] = expected s.loadPath("new value") - if actual, ok := s.Data.Load(key); ok { + if actual, ok := s.Data[key]; ok { if actual != "new value" { test.Fatalf("%+v was expected, got %+v", expected, actual) } @@ -66,14 +65,14 @@ func TestStore_loadPath(test *testing.T) { func TestStore_loadAll(test *testing.T) { s := &Store{ Dir: "zero", - Data: &sync.Map{}, + Data: map[string]interface{}{}, ParseFile: func(file string, val interface{}) error { fmt.Printf("parse file called: %s\n", file) - v, ok := val.(*map[string]interface{}) + v, ok := val.(map[string]interface{}) if !ok { panic("assert failed") } - (*v)[file] = "loaded" + v[file] = "loaded" return nil }, ListFiles: func(dirname string) ([]string, error) { @@ -83,7 +82,7 @@ func TestStore_loadAll(test *testing.T) { s.loadAll() for _, key := range []string{"zero/one", "zero/two"} { - if actual, ok := s.Data.Load(key); ok { + if actual, ok := s.Data[key]; ok { if actual != "loaded" { test.Fatalf("%s wasn't loaded correctly", key) } @@ -96,7 +95,7 @@ func TestStore_loadAll(test *testing.T) { func TestStore_load(test *testing.T) { s := &Store{ Dir: "zero", - Data: &sync.Map{}, + Data: map[string]interface{}{}, ParseFile: func(file string, val interface{}) error { return nil }, ListFiles: unexpectedListFiles(test), FileExists: func(path string) (bool, error) { @@ -118,7 +117,7 @@ func TestStore_load(test *testing.T) { func TestStore_Get(test *testing.T) { s := &Store{ Dir: "zero", - Data: &sync.Map{}, + Data: map[string]interface{}{}, ParseFile: unexpectedParseFile(test), ListFiles: unexpectedListFiles(test), FileExists: func(path string) (bool, error) { @@ -126,22 +125,20 @@ func TestStore_Get(test *testing.T) { return true, nil }, } - s.Data.Store("one", "two") - val, ok, err := s.Get("one") - errorIf(test, !ok, "key not found") - errorIf(test, err != nil, fmt.Sprintf("err when loading: %v", err)) + s.Data["one"] = "two" + val, err := s.Get("one") + errorIf(test, err != nil, "key not found") errorUnexpected(test, "two", val) // key is missing, file with same name exists s.FileExists = func(path string) (bool, error) { return true, nil } s.ParseFile = func(file string, val interface{}) error { - v := val.(*map[string]interface{}) - (*v)["two"] = "three" + v := val.(map[string]interface{}) + v["two"] = "three" return nil } - val, ok, err = s.Get("two") - errorIf(test, !ok, "key not found") - errorIf(test, err != nil, fmt.Sprintf("err when loading: %v", err)) + val, err = s.Get("two") + errorIf(test, err != nil, "key not found") errorUnexpected(test, "three", val) // key is missing, file corresponding to a hint exists @@ -152,27 +149,13 @@ func TestStore_Get(test *testing.T) { } s.ParseFile = func(file string, val interface{}) error { errorUnexpected(test, "zero/four.json", file) - v := val.(*map[string]interface{}) - (*v)["three"] = "four" + v := val.(map[string]interface{}) + v["three"] = "four" return nil } - val, ok, err = s.Get("three") - errorIf(test, !ok, "key not found") - errorIf(test, err != nil, fmt.Sprintf("err when loading: %v", err)) + val, err = s.Get("three") + errorIf(test, err != nil, "key not found") errorUnexpected(test, "four", val) -} - -func TestStore_GetLoadAllWhenNoKey(test *testing.T) { - s := &Store{ - Dir: "zero", - Data: &sync.Map{}, - ParseFile: unexpectedParseFile(test), - ListFiles: unexpectedListFiles(test), - FileExists: func(path string) (bool, error) { - test.Fatalf("unexpected call to fileExists(%s)", path) - return true, nil - }, - } // key is missing, file is missing, hint is missing, loaded from all listFilesCalled := false @@ -183,36 +166,6 @@ func TestStore_GetLoadAllWhenNoKey(test *testing.T) { s.FileExists = func(string) (bool, error) { return false, nil } - s.Get("four") + val, _ = s.Get("four") errorIf(test, !listFilesCalled, "listFiles wasn't called") } - -func TestStore_GetCallsListAllWhenMatchingFileHasNoKey(test *testing.T) { - s := &Store{ - Dir: "zero", - Data: &sync.Map{}, - ParseFile: unexpectedParseFile(test), - ListFiles: unexpectedListFiles(test), - FileExists: func(path string) (bool, error) { - test.Fatalf("unexpected call to fileExists(%s)", path) - return true, nil - }, - } - - // file exists, but key in different file - listFilesCalled := false - s.ListFiles = func(string) ([]string, error) { - listFilesCalled = true - return []string{}, nil - } - s.FileExists = func(string) (bool, error) { - return true, nil - } - s.ParseFile = func(file string, val interface{}) error { - v := val.(*map[string]interface{}) - (*v)["five"] = "five" - return nil - } - s.Get("five") - errorIf(test, listFilesCalled, "listFiles wasn't called") -} diff --git a/pkg/deployments/deployments.go b/pkg/deployments/deployments.go index 01b855c..9bc1ff5 100644 --- a/pkg/deployments/deployments.go +++ b/pkg/deployments/deployments.go @@ -96,22 +96,16 @@ func (provider *DefaultImageProvider) DockerImageURLForDeployGroup(deploymentGro func (provider *DefaultImageProvider) getDockerRegistry() (string, error) { dockerRegistry := &DockerRegistry{Registry: ""} - ok, err := provider.PaastaConfig.Load("docker_registry", &dockerRegistry) - if !ok { - return "", fmt.Errorf("docker registry not found") - } + err := provider.PaastaConfig.Load("registry", &dockerRegistry.Registry) return dockerRegistry.Registry, err } func (provider *DefaultImageProvider) getImageForDeployGroup(deploymentGroup string) (string, error) { deployments := &Deployments{V2: V2DeploymentsConfig{}} - ok, err := provider.ServiceConfig.Load("v2", &deployments.V2) + err := provider.ServiceConfig.Load("v2", &deployments.V2) if err != nil { return "", err } - if !ok { - return "", fmt.Errorf("image for deploymentGroup %v not found", deploymentGroup) - } deployment, ok := deployments.V2.Deployments[deploymentGroup] if !ok { @@ -144,10 +138,7 @@ func DeploymentAnnotations( func deploymentsFromConfig(cr *configstore.Store) (*Deployments, error) { deployments := &Deployments{} - ok, err := cr.Load("v2", deployments) - if !ok { - return nil, fmt.Errorf("deployments not found") - } + err := cr.Load("v2", deployments) return deployments, err } diff --git a/pkg/deployments/deployments_test.go b/pkg/deployments/deployments_test.go index bbc4e49..88a8cb2 100644 --- a/pkg/deployments/deployments_test.go +++ b/pkg/deployments/deployments_test.go @@ -2,7 +2,6 @@ package deployments import ( "fmt" - "sync" "testing" "github.com/Yelp/paasta-tools-go/pkg/configstore" @@ -13,28 +12,30 @@ const ( ) func TestDefaultProviderGetDeployment(test *testing.T) { - paastaConfigData := &sync.Map{} - paastaConfigData.Store("docker_registry", map[string]interface{}{ - "docker_registry": "fakeregistry.yelp.com", - }) - - serviceConfigData := &sync.Map{} - serviceConfigData.Store("v2", map[string]interface{}{ - "deployments": map[string]interface{}{ - "dev.every": map[string]interface{}{ - "docker_image": "busybox:latest", - "git_sha": "03d6f783c99695af0e716588abb9ba83ac957be2", + imageProvider := DefaultImageProvider{ + PaastaConfig: &configstore.Store{ + Data: map[string]interface{}{ + "docker_registry": map[string]interface{}{ + "registry": "fakeregistry.yelp.com", + }, }, - "test.every": map[string]interface{}{ - "docker_image": "ubuntu:latest", - "git_sha": "f3d6f783c99695af0e716588abb9ba83ac957be3", + }, + ServiceConfig: &configstore.Store{ + Data: map[string]interface{}{ + "v2": map[string]interface{}{ + "deployments": map[string]interface{}{ + "dev.every": map[string]interface{}{ + "docker_image": "busybox:latest", + "git_sha": "03d6f783c99695af0e716588abb9ba83ac957be2", + }, + "test.every": map[string]interface{}{ + "docker_image": "ubuntu:latest", + "git_sha": "f3d6f783c99695af0e716588abb9ba83ac957be3", + }, + }, + }, }, }, - }) - - imageProvider := DefaultImageProvider{ - PaastaConfig: &configstore.Store{Data: paastaConfigData}, - ServiceConfig: &configstore.Store{Data: serviceConfigData}, } testcases := map[string]string{ "dev.every": "busybox:latest", @@ -105,24 +106,22 @@ func TestDeploymentAnnotationsForControlGroup(test *testing.T) { } func TestDefaultGetRegistry(t *testing.T) { - paastaConfigData := &sync.Map{} - paastaConfigData.Store("docker_registry", map[string]interface{}{ - "docker_registry": "fakeregistry.yelp.com", - }) - - serviceConfigData := &sync.Map{} - serviceConfigData.Store("v2", map[string]interface{}{ - "deployments": map[string]interface{}{}, - }) - imageProvider := DefaultImageProvider{ - PaastaConfig: &configstore.Store{Data: paastaConfigData}, - ServiceConfig: &configstore.Store{Data: serviceConfigData}, + PaastaConfig: &configstore.Store{ + Data: map[string]interface{}{ + "registry": "fakeregistry.yelp.com", + }, + }, + ServiceConfig: &configstore.Store{ + Data: map[string]interface{}{ + "v2": map[string]interface{}{ + "deployments": map[string]interface{}{}, + }, + }, + }, } - url, err := imageProvider.getDockerRegistry() - if err != nil { - t.Errorf("expected %s actual: error %+v", "fakeregistry.yelp.com", err) - } else if url != "fakeregistry.yelp.com" { + url, _ := imageProvider.getDockerRegistry() + if url != "fakeregistry.yelp.com" { t.Errorf("expected %s actual %+v", "fakeregistry.yelp.com", url) } } diff --git a/pkg/volumes/converter_test.go b/pkg/volumes/converter_test.go index f0fb20c..3dbd185 100644 --- a/pkg/volumes/converter_test.go +++ b/pkg/volumes/converter_test.go @@ -2,7 +2,6 @@ package volumes import ( "reflect" - "sync" "testing" "github.com/Yelp/paasta-tools-go/pkg/configstore" @@ -73,14 +72,15 @@ func TestFormatMountName(t *testing.T) { } func TestGetDefaultPaastaKubernetesVolumes(t *testing.T) { - fakeVolumeConfig := &sync.Map{} - fakeVolumeConfig.Store("volumes", []map[string]interface{}{ - map[string]interface{}{ - "hostPath": "/foo", - "containerPath": "/bar", - "mode": "RO", + fakeVolumeConfig := map[string]interface{}{ + "volumes": []map[string]interface{}{ + map[string]interface{}{ + "hostPath": "/foo", + "containerPath": "/bar", + "mode": "RO", + }, }, - }) + } reader := &configstore.Store{Data: fakeVolumeConfig} volumeMounts, volumes, err := GetDefaultPaastaKubernetesVolumes(reader) if err != nil { diff --git a/pkg/volumes/volumes.go b/pkg/volumes/volumes.go index 8d46ccb..166ce9d 100644 --- a/pkg/volumes/volumes.go +++ b/pkg/volumes/volumes.go @@ -1,8 +1,6 @@ package volumes import ( - "fmt" - "github.com/Yelp/paasta-tools-go/pkg/configstore" ) @@ -16,11 +14,10 @@ type Volume struct { Mode string `json:"mode" mapstructure:"mode"` } -func DefaultVolumesFromReader(configStore *configstore.Store) ([]Volume, error) { +func DefaultVolumesFromReader( + configStore *configstore.Store, +) (volumes []Volume, err error) { volumeConfig := &VolumeConfig{Volumes: []Volume{}} - ok, err := configStore.Load("volumes", &volumeConfig.Volumes) - if !ok { - return nil, fmt.Errorf("volumes not found") - } + err = configStore.Load("volumes", &volumeConfig.Volumes) return volumeConfig.Volumes, err } diff --git a/pkg/volumes/volumes_test.go b/pkg/volumes/volumes_test.go index 40149b9..189f238 100644 --- a/pkg/volumes/volumes_test.go +++ b/pkg/volumes/volumes_test.go @@ -2,21 +2,21 @@ package volumes import ( "reflect" - "sync" "testing" "github.com/Yelp/paasta-tools-go/pkg/configstore" ) func TestDefaultVolumesFromReader(test *testing.T) { - fakeVolumeConfig := &sync.Map{} - fakeVolumeConfig.Store("volumes", []map[string]interface{}{ - map[string]interface{}{ - "hostPath": "/foo", - "containerPath": "/bar", - "mode": "RO", + fakeVolumeConfig := map[string]interface{}{ + "volumes": []map[string]interface{}{ + map[string]interface{}{ + "hostPath": "/foo", + "containerPath": "/bar", + "mode": "RO", + }, }, - }) + } reader := &configstore.Store{Data: fakeVolumeConfig} actual, err := DefaultVolumesFromReader(reader) if err != nil { From 3352d39ef1458e08a15068d3a07c40cb854c1a1c Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Fri, 17 Jan 2020 16:23:42 +0100 Subject: [PATCH 03/38] sync go.mod with master --- go.mod | 38 +++++++----- go.sum | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 205 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index d766678..9e8a714 100644 --- a/go.mod +++ b/go.mod @@ -1,23 +1,35 @@ module github.com/Yelp/paasta-tools-go require ( - github.com/fatih/structs v1.1.0 // indirect + github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754 + github.com/fatih/structs v1.1.0 + github.com/go-logr/logr v0.1.0 // indirect + github.com/go-logr/zapr v0.1.1 // indirect github.com/gogo/protobuf v1.2.1 // indirect - github.com/json-iterator/go v1.1.7 // indirect + github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 // indirect + github.com/googleapis/gnostic v0.3.1 // indirect + github.com/hashicorp/golang-lru v0.5.3 // indirect + github.com/imdario/mergo v0.3.8 // indirect github.com/mitchellh/mapstructure v1.1.2 - github.com/modern-go/reflect2 v1.0.1 // indirect - github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 + github.com/pborman/uuid v1.2.0 // indirect + github.com/pkg/errors v0.8.1 + github.com/prometheus/client_golang v1.3.0 // indirect github.com/spf13/pflag v1.0.3 // indirect - github.com/stretchr/testify v1.3.0 - golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 // indirect - golang.org/x/text v0.3.0 // indirect + github.com/stretchr/testify v1.4.0 + github.com/subosito/gotenv v1.2.0 + go.uber.org/zap v1.13.0 // indirect + golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 // indirect + golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 // indirect + golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/yaml.v2 v2.2.2 // indirect - k8s.io/api v0.0.0-20190202010724-74b699b93c15 - k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c - k8s.io/klog v0.2.0 // indirect - k8s.io/kubernetes v1.14.0 // indirect - sigs.k8s.io/yaml v1.1.0 // indirect + k8s.io/api v0.0.0-20190313235455-40a48860b5ab + k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1 + k8s.io/client-go v11.0.0+incompatible + k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a // indirect + k8s.io/kubernetes v1.14.0 + k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 // indirect + sigs.k8s.io/controller-runtime v0.1.10 ) go 1.13 diff --git a/go.sum b/go.sum index f54e037..7a0d2ec 100644 --- a/go.sum +++ b/go.sum @@ -1,50 +1,230 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/appscode/jsonpatch v2.0.1+incompatible h1:Ksl+gGquV3TeYmiZPBsDNauiyloE7sg9OMUWKr5Ctmg= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754 h1:Qd6djMDE2KFeLwuKQ4B316XYt101DFoymbgoxFHeKCY= +github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754/go.mod h1:rTr8X4qZPRmQKsyAjhECPi+zPnmlcmv5W9s1F11oBSo= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/zapr v0.1.1 h1:qXBXPDdNncunGs7XeEpsJt8wCjYBygluzfdLO0G5baE= +github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= +github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= +github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= +github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= +github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= +github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= +github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= +github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0 h1:miYCvYqFXtl/J9FIy8eNpBfYthAEFg+Ys0XyUVEcDsc= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0 h1:ElTg5tNp4DqfV7UQjDqv2+RJlNzsDtvNAWccbItceIE= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 h1:ulvT7fqt0yHWzpJwI57MezWnYDVpCAYBVuYst/L+fAY= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f h1:68K/z8GLUxV76xGSqwTWw2gyk/jwn79LUL43rES2g8o= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= k8s.io/api v0.0.0-20190202010724-74b699b93c15 h1:AoUGjnJ3PJMFz+Rkp4lx3X+6mPUnY1MESJhbUSGX+pc= k8s.io/api v0.0.0-20190202010724-74b699b93c15/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= +k8s.io/api v0.0.0-20190313235455-40a48860b5ab h1:DG9A67baNpoeweOy2spF1OWHhnVY5KR7/Ek/+U1lVZc= +k8s.io/api v0.0.0-20190313235455-40a48860b5ab/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c h1:02KEBFny6M5VWKj6Y8Ns27epjefTqLJXD4fvqP5tGFg= k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= +k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1 h1:IS7K02iBkQXpCeieSiyJjGoLSdVOv2DbPaWHJ+ZtgKg= +k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= +k8s.io/client-go v11.0.0+incompatible h1:LBbX2+lOwY9flffWlJM7f1Ct8V2SRNiMRDFeiwnJo9o= +k8s.io/client-go v11.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= +k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.2.0 h1:0ElL0OHzF3N+OhoJTL0uca20SxtYt4X4+bzHeqrB83c= k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE= +k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= +k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kubernetes v1.14.0 h1:6T2iAEoOYQnzQb3WvPlUkcczEEXZ7+YPlAO8olwujRw= k8s.io/kubernetes v1.14.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= +k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 h1:p0Ai3qVtkbCG/Af26dBmU0E1W58NID3hSSh7cMyylpM= +k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +sigs.k8s.io/controller-runtime v0.1.10 h1:amLOmcekVdnsD1uIpmgRqfTbQWJ2qxvQkcdeFhcotn4= +sigs.k8s.io/controller-runtime v0.1.10/go.mod h1:HFAYoOh6XMV+jKF1UjFwrknPbowfyHEHHRdJMf2jMX8= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= From 085144295436e05cf5574a019adfdcabbfbab265 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Fri, 17 Jan 2020 16:34:11 +0100 Subject: [PATCH 04/38] add more descriptive error messages to configstore/store.go --- pkg/configstore/store.go | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/pkg/configstore/store.go b/pkg/configstore/store.go index f0c959d..a0b6b6b 100644 --- a/pkg/configstore/store.go +++ b/pkg/configstore/store.go @@ -43,7 +43,7 @@ func parseFile(path string, value interface{}) error { reader, err := os.Open(path) defer reader.Close() if err != nil { - return err + return fmt.Errorf("Failed to open %s: %v", path, err) } return json.NewDecoder(reader).Decode(value) @@ -83,7 +83,7 @@ func (s *Store) loadPath(path string) error { value := map[string]interface{}{} err := s.ParseFile(path, value) if err != nil { - return err + return fmt.Errorf("Failed to parse %s: %v", path, err) } s.Lock() @@ -99,36 +99,42 @@ func (s *Store) loadPath(path string) error { func (s *Store) loadAll() error { files, err := s.ListFiles(s.Dir) if err != nil { - return err + return fmt.Errorf("Failed to list %s: %v", s.Dir, err) } for _, file := range files { - err := s.loadPath(path.Join(s.Dir, file)) + filepath := path.Join(s.Dir, file) + err := s.loadPath(filepath) if err != nil { - return err + return fmt.Errorf("Failed to load %s: %v", filepath, err) } } return nil } +var extensions = []string{"json", "yaml"} + // Look for `file`.json or `file`.yaml, if not found try loading all files and // print a warning about hints func (s *Store) load(file string) error { - extensions := []string{"json", "yaml"} for _, ext := range extensions { path := path.Join(s.Dir, fmt.Sprintf("%s.%s", file, ext)) exists, err := s.FileExists(path) if err != nil { - return err + return fmt.Errorf("Failed to find %s: %v", path, err) } if exists { - return s.loadPath(path) + err = s.loadPath(path) + if err != nil { + return fmt.Errorf("Failed to load %s: %v", path, err) + } + return nil } } log.Printf( - "WARN: loading all configs, consider adding some hints" + - fmt.Sprintf("for %s in %s", file, s.Dir), + "WARN: loading all configs, consider adding some hints in %s", + path.Join(s.Dir, file), ) return s.loadAll() } @@ -160,7 +166,7 @@ func (s *Store) Get(key string) (interface{}, error) { func (s *Store) Load(key string, dst interface{}) error { val, err := s.Get(key) if err != nil { - return err + return fmt.Errorf("Failed to get %s: %v", key, err) } return mapstructure.Decode(val, dst) } From 2220ecb5e8e394ab1c666b80b1affc839992739b Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Mon, 20 Jan 2020 19:39:10 +0100 Subject: [PATCH 05/38] wrap map reads in lock/unlock --- pkg/configstore/store.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/configstore/store.go b/pkg/configstore/store.go index a0b6b6b..6a1e14d 100644 --- a/pkg/configstore/store.go +++ b/pkg/configstore/store.go @@ -139,10 +139,17 @@ func (s *Store) load(file string) error { return s.loadAll() } +func (s *Store) syncGet(key string) (interface{}, bool) { + s.Lock() + defer s.Unlock() + val, ok := s.Data[key] + return val, ok +} + // Get returns value for given `key`. If not found in `s.data`, call // `s.load` function with `file` from `s.hints` or `key` itself. func (s *Store) Get(key string) (interface{}, error) { - if val, ok := s.Data[key]; ok { + if val, ok := s.syncGet(key); ok { return val, nil } @@ -154,7 +161,7 @@ func (s *Store) Get(key string) (interface{}, error) { } s.load(file) - val, ok := s.Data[key] + val, ok := s.syncGet(key) if !ok { return nil, fmt.Errorf("key not found: %s", key) } From 7716c6b18ce5c1fbe292dfdcc5535e7dc68d09f2 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Fri, 24 Jan 2020 14:35:21 +0100 Subject: [PATCH 06/38] use sync.Map --- pkg/configstore/store.go | 15 ++++----------- pkg/configstore/store_test.go | 17 +++++++++-------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/pkg/configstore/store.go b/pkg/configstore/store.go index 6a1e14d..c53effb 100644 --- a/pkg/configstore/store.go +++ b/pkg/configstore/store.go @@ -15,7 +15,7 @@ import ( // Store holds config data type Store struct { // If you care about sanity, never write here, just read - Data map[string]interface{} + Data sync.Map Dir string Hints map[string]string sync.Mutex @@ -89,7 +89,7 @@ func (s *Store) loadPath(path string) error { s.Lock() defer s.Unlock() for key, val := range value { - s.Data[key] = val + s.Data.Store(key, val) } return nil @@ -139,17 +139,10 @@ func (s *Store) load(file string) error { return s.loadAll() } -func (s *Store) syncGet(key string) (interface{}, bool) { - s.Lock() - defer s.Unlock() - val, ok := s.Data[key] - return val, ok -} - // Get returns value for given `key`. If not found in `s.data`, call // `s.load` function with `file` from `s.hints` or `key` itself. func (s *Store) Get(key string) (interface{}, error) { - if val, ok := s.syncGet(key); ok { + if val, ok := s.Data.Load(key); ok { return val, nil } @@ -161,7 +154,7 @@ func (s *Store) Get(key string) (interface{}, error) { } s.load(file) - val, ok := s.syncGet(key) + val, ok := s.Data.Load(key) if !ok { return nil, fmt.Errorf("key not found: %s", key) } diff --git a/pkg/configstore/store_test.go b/pkg/configstore/store_test.go index 2662c67..c1aa078 100644 --- a/pkg/configstore/store_test.go +++ b/pkg/configstore/store_test.go @@ -2,6 +2,7 @@ package configstore import ( "fmt" + "sync" "testing" ) @@ -39,7 +40,7 @@ func unexpectedfileExists(test *testing.T) func(path string) (bool, error) { func TestStore_loadPath(test *testing.T) { key := "test key" s := &Store{ - Data: map[string]interface{}{}, + Data: sync.Map{}, ParseFile: func(file string, val interface{}) error { v, ok := val.(map[string]interface{}) if !ok { @@ -50,10 +51,10 @@ func TestStore_loadPath(test *testing.T) { }, } expected := "old value" - s.Data[key] = expected + s.Data.Store(key, expected) s.loadPath("new value") - if actual, ok := s.Data[key]; ok { + if actual, ok := s.Data.Load(key); ok { if actual != "new value" { test.Fatalf("%+v was expected, got %+v", expected, actual) } @@ -65,7 +66,7 @@ func TestStore_loadPath(test *testing.T) { func TestStore_loadAll(test *testing.T) { s := &Store{ Dir: "zero", - Data: map[string]interface{}{}, + Data: sync.Map{}, ParseFile: func(file string, val interface{}) error { fmt.Printf("parse file called: %s\n", file) v, ok := val.(map[string]interface{}) @@ -82,7 +83,7 @@ func TestStore_loadAll(test *testing.T) { s.loadAll() for _, key := range []string{"zero/one", "zero/two"} { - if actual, ok := s.Data[key]; ok { + if actual, ok := s.Data.Load(key); ok { if actual != "loaded" { test.Fatalf("%s wasn't loaded correctly", key) } @@ -95,7 +96,7 @@ func TestStore_loadAll(test *testing.T) { func TestStore_load(test *testing.T) { s := &Store{ Dir: "zero", - Data: map[string]interface{}{}, + Data: sync.Map{}, ParseFile: func(file string, val interface{}) error { return nil }, ListFiles: unexpectedListFiles(test), FileExists: func(path string) (bool, error) { @@ -117,7 +118,7 @@ func TestStore_load(test *testing.T) { func TestStore_Get(test *testing.T) { s := &Store{ Dir: "zero", - Data: map[string]interface{}{}, + Data: sync.Map{}, ParseFile: unexpectedParseFile(test), ListFiles: unexpectedListFiles(test), FileExists: func(path string) (bool, error) { @@ -125,7 +126,7 @@ func TestStore_Get(test *testing.T) { return true, nil }, } - s.Data["one"] = "two" + s.Data.Store("one", "two") val, err := s.Get("one") errorIf(test, err != nil, "key not found") errorUnexpected(test, "two", val) From 19c762d1d54ab0fbb879e5abec9c633ba1761c7f Mon Sep 17 00:00:00 2001 From: Ashish Khatkar Date: Mon, 2 Mar 2020 15:43:24 +0000 Subject: [PATCH 07/38] Adding support to get Yaml for k8s object (#45) * Adding support to get Yaml for k8s object * Added logic to compute yaml diff, refactored hashing helper * Nit changes for review * Updating link for unified context --- go.mod | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go.mod b/go.mod index 9e8a714..92c0573 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ require ( github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 github.com/pborman/uuid v1.2.0 // indirect github.com/pkg/errors v0.8.1 + github.com/pmezard/go-difflib v1.0.0 github.com/prometheus/client_golang v1.3.0 // indirect github.com/spf13/pflag v1.0.3 // indirect github.com/stretchr/testify v1.4.0 @@ -23,6 +24,7 @@ require ( golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v2 v2.2.2 k8s.io/api v0.0.0-20190313235455-40a48860b5ab k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1 k8s.io/client-go v11.0.0+incompatible From 8e0003f47d8a27be9b5a44734172ac2c025a2c73 Mon Sep 17 00:00:00 2001 From: Bronek Kozicki Date: Thu, 5 Mar 2020 14:13:23 +0000 Subject: [PATCH 08/38] Use golang 1.12 Also add an indirect dependency for reflect2 --- go.mod | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 92c0573..91fa283 100644 --- a/go.mod +++ b/go.mod @@ -11,6 +11,7 @@ require ( github.com/hashicorp/golang-lru v0.5.3 // indirect github.com/imdario/mergo v0.3.8 // indirect github.com/mitchellh/mapstructure v1.1.2 + github.com/modern-go/reflect2 v1.0.1 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 github.com/pborman/uuid v1.2.0 // indirect github.com/pkg/errors v0.8.1 @@ -34,4 +35,4 @@ require ( sigs.k8s.io/controller-runtime v0.1.10 ) -go 1.13 +go 1.12 From 90cf486b788996d6d4657db3ef551fbe83f68e41 Mon Sep 17 00:00:00 2001 From: Bronek Kozicki Date: Thu, 5 Mar 2020 19:11:00 +0000 Subject: [PATCH 09/38] Refactor test options --- pkg/test_framework/harness_test.go | 213 +++++++++-------------------- pkg/test_framework/test_test.go | 149 ++++++++------------ 2 files changed, 121 insertions(+), 241 deletions(-) diff --git a/pkg/test_framework/harness_test.go b/pkg/test_framework/harness_test.go index d78dded..c9e47a7 100644 --- a/pkg/test_framework/harness_test.go +++ b/pkg/test_framework/harness_test.go @@ -2,14 +2,14 @@ package framework import ( "bytes" - "flag" "fmt" "io" "os" "path/filepath" "testing" - "time" + harness "github.com/dlespiau/kube-test-harness" + "github.com/dlespiau/kube-test-harness/logger" "github.com/stretchr/testify/assert" ) @@ -78,9 +78,9 @@ func TestSanitizePrefix(t *testing.T) { func TestRunNoOutput(t *testing.T) { args := []string{"make", "-s", "-C", "tests", "default"} _ = os.Setenv("RND", "BAZ") - err := run([]io.Writer{}, nil, args, nil) + err := run([]io.Writer{}, nil, args) assert.NoError(t, err) - err = run(nil, []io.Writer{}, args, nil) + err = run(nil, []io.Writer{}, args) assert.NoError(t, err) } @@ -89,137 +89,48 @@ func TestRunSimple(t *testing.T) { cout := bytes.Buffer{} cerr := bytes.Buffer{} args := []string{"make", "-s", "-C", "tests", "default"} - envs := map[string]string{"RND": "BAZ"} - err := run([]io.Writer{&cout}, []io.Writer{&cerr}, args, envs) + _ = os.Setenv("RND", "BAZ") + err := run([]io.Writer{&cout}, []io.Writer{&cerr}, args) assert.NoError(t, err) assert.Equal(t, "default BAZ\n", cout.String()) assert.Empty(t, cerr.String()) } -func TestParse(t *testing.T) { - // Verify default options - defs := *Parse(OverrideOsArgs([]string{})) - assert.Equal(t, "manifests", defs.ManifestDirectory) - assert.Equal(t, false, defs.NoCleanup) - assert.Equal(t, "Makefile", defs.Makefile) - assert.Equal(t, sanitizeMakeDir(""), defs.MakeDir) - assert.Equal(t, "test-", defs.Prefix) - assert.Equal(t, 2 * time.Second, defs.OperatorDelay) - assert.Equal(t, false, defs.EnvAlways) - - // Test handling of unknown options - assert.Panics(t, func() { - _ = Parse( - OverrideOsArgs([]string{"-no-such-option"}), - OverrideCmdLine(flag.NewFlagSet("tests", flag.PanicOnError)), - ) - }) - - // Test individual options (except verbose) - r1 := defs - r1.MakeDir = sanitizeMakeDir("foo") - r1.ManifestDirectory = "baz" - r1.Prefix = "fizz-" - r1.OperatorDelay = 5 * time.Second - r1.NoCleanup = true - r1.EnvAlways = true - - // Options can be set with Default... functions - o1 := *Parse( - DefaultMakeDir("foo"), - DefaultManifests("baz"), - DefaultPrefix("fizz"), - DefaultOperatorDelay(5 * time.Second), - DefaultNoCleanup(), - DefaultEnvAlways(), - OverrideOsArgs([]string{}), - OverrideCmdLine(flag.NewFlagSet("tests", flag.PanicOnError)), - ) - - // Options can be set with command line - assert.Equal(t, r1, o1) - o2 := *Parse( - OverrideOsArgs([]string{ - "-k8s.makedir=foo", - "-k8s.manifests=baz", - "-k8s.prefix=fizz", - "-k8s.op-delay=5s", - "-k8s.no-cleanup=true", - "-k8s.env-always=true", - }), - OverrideCmdLine(flag.NewFlagSet("tests", flag.PanicOnError)), - ) - assert.Equal(t, r1, o2) - - // Options can be set with Default... functions and overridden from command line - o3 := *Parse( - DefaultMakeDir("foo"), - DefaultManifests("baz"), - DefaultPrefix("fizz"), - DefaultOperatorDelay(5 * time.Second), - DefaultNoCleanup(), - DefaultEnvAlways(), - OverrideOsArgs([]string{ - "-k8s.makedir=tests", - "-k8s.manifests=manifests", - "-k8s.prefix=tests", - "-k8s.op-delay=2s", - "-k8s.no-cleanup=false", - "-k8s.env-always=false", - }), - OverrideCmdLine(flag.NewFlagSet("tests", flag.PanicOnError)), - ) - r2 := defs - r2.Prefix = "tests-" - r2.MakeDir = sanitizeMakeDir("tests") - assert.Equal(t, r2, o3) - - // Test merging of options - oflags := flag.NewFlagSet("tests", flag.PanicOnError) - something := oflags.Bool("something", false, "some bool value") - o4 := *Parse( - OverrideOsArgs([]string{"-k8s.no-cleanup", "-k8s.prefix", "buzz", "-something", "true"}), - OverrideCmdLine(oflags), - ) - r3 := defs - r3.NoCleanup = true - r3.Prefix = "buzz-" - assert.Equal(t, r3, o4) - assert.Equal(t, true, *something) +func newOptions(args ... string) *Options { + prefix := "tests" + if len(args) >= 1 { + prefix = args[0] + } + nocleanup := false + if len(args) >= 2 { + nocleanup = args[1] == "nocleanup" + } + + return &Options{ + Options: harness.Options{ + ManifestDirectory: "", + NoCleanup: nocleanup, + Logger: &logger.PrintfLogger{}, + }, + Makefile: "Makefile", + MakeDir: sanitizeMakeDir("tests"), + Prefix: sanitizePrefix(prefix), + } } -func newOptions(opts ...ParseOptionFn) *Options { - // The options in the front are applied first - opts = append([]ParseOptionFn{ - OverrideOsArgs([]string{}), - OverrideCmdLine(flag.NewFlagSet("tests", flag.PanicOnError)), - DefaultMakeDir("tests"), - DefaultPrefix("tests"), - }, opts ...) - return Parse(opts...) -} - -func newSinks() (Sinks, *bytes.Buffer, *bytes.Buffer, *bytes.Buffer) { +func TestCheckAll(t *testing.T) { + options := *newOptions() cout := bytes.Buffer{} cerr := bytes.Buffer{} operator := bytes.Buffer{} - return Sinks{ - Stdout: []io.Writer{&cout}, - Stderr: []io.Writer{&cerr}, - Operator: []io.Writer{&operator}, - }, &cout, &cerr, &operator -} - -func TestCheckAll(t *testing.T) { - options := *newOptions() - sinks, cout, cerr, operator := newSinks() + sinks := Sinks{[]io.Writer{&cout}, []io.Writer{&cerr}, []io.Writer{&operator}} checkMakefile(options, sinks) assert.Regexp(t, `^echo "export RND=.* echo "tests-cluster-start \$\{RND\}" echo "tests-cluster-stop \$\{RND\}" -echo "tests-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" -echo "tests-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" -echo "tests-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "tests-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "tests-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "tests-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\}" $`, cout.String()) assert.Empty(t, cerr.String()) assert.Empty(t, operator.String()) @@ -227,8 +138,11 @@ $`, cout.String()) func TestCheckFail(t *testing.T) { // expect fail-close-cluster-stop to fail, not skipped - options := *newOptions(DefaultPrefix("fail-close")) - sinks, cout, cerr, operator := newSinks() + options := *newOptions("fail-close") + cout := bytes.Buffer{} + cerr := bytes.Buffer{} + operator := bytes.Buffer{} + sinks := Sinks{[]io.Writer{&cout}, []io.Writer{&cerr}, []io.Writer{&operator}} assert.Panics(t, func() { checkMakefile(options, sinks) }) // however, stopCluster() just swallows errors stopCluster(options, sinks) @@ -241,38 +155,40 @@ $`, cout.String()) func TestCheckNoCleanup(t *testing.T) { // expect fail-close-cluster-stop to fail, should be skipped - options := *newOptions( - DefaultPrefix("fail-close"), - DefaultNoCleanup(), - ) - sinks, cout, cerr, operator := newSinks() + options := *newOptions("fail-close", "nocleanup") + cout := bytes.Buffer{} + cerr := bytes.Buffer{} + operator := bytes.Buffer{} + sinks := Sinks{[]io.Writer{&cout}, []io.Writer{&cerr}, []io.Writer{&operator}} checkMakefile(options, sinks) assert.Regexp(t, `^echo "export RND=.* echo "fail-close-cluster-start \$\{RND\}" -echo "fail-close-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" -echo "fail-close-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" -echo "fail-close-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "fail-close-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "fail-close-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "fail-close-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\}" $`, cout.String()) assert.Empty(t, cerr.String()) assert.Empty(t, operator.String()) } func TestStart(t *testing.T) { - options := *newOptions(DefaultEnvAlways()) - sinks, cout, cerr, operator := newSinks() + options := *newOptions() + cout := bytes.Buffer{} + cerr := bytes.Buffer{} + operator := bytes.Buffer{} + sinks := Sinks{[]io.Writer{&cout}, []io.Writer{&cerr}, []io.Writer{&operator}} // NOTE: buildEnv never overwrites existing env. variable - _ = os.Setenv("RND", "DUMMYDATA") - kube := startHarness(options, sinks, nil) + _ = os.Unsetenv("RND") + kube := startHarness(options, sinks) assert.NotNil(t, kube) rnd, ok := os.LookupEnv("RND") - assert.NotEqual(t, "DUMMYDATA", rnd) assert.Equal(t, true, ok) cmp := `^echo "export RND=.* echo "tests-cluster-start \$\{RND\}" echo "tests-cluster-stop \$\{RND\}" -echo "tests-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" -echo "tests-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" -echo "tests-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "tests-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "tests-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "tests-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\}" ` err := kube.Close() assert.NoError(t, err) @@ -288,21 +204,22 @@ $`, rnd, rnd, rnd, rnd) func TestStartNoCleanup(t *testing.T) { // expect fail-close-cluster-stop to fail, should be skipped - options := *newOptions( - DefaultPrefix("fail-close"), - DefaultNoCleanup(), - ) - sinks, cout, cerr, operator := newSinks() + options := *newOptions("fail-close", "nocleanup") + cout := bytes.Buffer{} + cerr := bytes.Buffer{} + operator := bytes.Buffer{} + sinks := Sinks{[]io.Writer{&cout}, []io.Writer{&cerr}, []io.Writer{&operator}} + // NOTE: buildEnv never overwrites existing env. variable _ = os.Unsetenv("RND") - kube := startHarness(options, sinks, nil) + kube := startHarness(options, sinks) assert.NotNil(t, kube) rnd, ok := os.LookupEnv("RND") assert.Equal(t, true, ok) cmp := `^echo "export RND=.* echo "fail-close-cluster-start \$\{RND\}" -echo "fail-close-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" -echo "fail-close-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" -echo "fail-close-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "fail-close-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "fail-close-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "fail-close-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\}" ` err := kube.Close() assert.NoError(t, err) diff --git a/pkg/test_framework/test_test.go b/pkg/test_framework/test_test.go index 5cac4b4..77df111 100644 --- a/pkg/test_framework/test_test.go +++ b/pkg/test_framework/test_test.go @@ -1,9 +1,10 @@ package framework import ( + "bytes" "fmt" + "io" "os" - "runtime" "testing" "time" @@ -11,74 +12,86 @@ import ( ) func TestStartQuick(t *testing.T) { - options := *newOptions(DefaultOperatorDelay(500 * time.Millisecond)) - sinks, cout, cerr, operator := newSinks() + options := *newOptions() + options.OperatorStartDelay = 500 * time.Millisecond + cout := bytes.Buffer{} + cerr := bytes.Buffer{} + operator := bytes.Buffer{} + sinks := Sinks{[]io.Writer{&cout}, []io.Writer{&cerr}, []io.Writer{&operator}} + // NOTE: buildEnv never overwrites existing env. variable _ = os.Unsetenv("RND") - kube := startHarness(options, sinks, nil) + kube := startHarness(options, sinks) assert.NotNil(t, kube) test := kube.NewTest(t).Setup() err := test.StartOperator() // error because make tests-operator-start is not blocking assert.NotNil(t, err) + ns, nset := os.LookupEnv("TEST_OPERATOR_NS") + assert.Equal(t,true, nset) + assert.Equal(t, test.Namespace, ns) - ns := test.Namespace rnd, ok := os.LookupEnv("RND") assert.Equal(t, true, ok) cmp := `^echo "export RND=.* echo "tests-cluster-start \$\{RND\}" echo "tests-cluster-stop \$\{RND\}" -echo "tests-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" -echo "tests-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" -echo "tests-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "tests-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "tests-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "tests-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\}" ` cmp += fmt.Sprintf(`export RND=%s tests-cluster-stop %s tests-cluster-start %s -tests-cleanup %s %s 1 +tests-cleanup %s %s tests-cluster-stop %s $`, rnd, rnd, rnd, rnd, ns, rnd) test.Close() err = kube.Close() assert.NoError(t, err) assert.Regexp(t, cmp, cout.String()) - cmp = fmt.Sprintf("tests-operator-start %s %s 1\n", rnd, test.Namespace) + cmp = fmt.Sprintf("tests-operator-start %s %s\n", rnd, test.Namespace) assert.Equal(t, cmp, operator.String()) assert.Empty(t, cerr.String()) } func TestStartSlowNoCleanup(t *testing.T) { - options := *newOptions( - DefaultEnvAlways(), - DefaultPrefix("test-sleep05"), - DefaultNoCleanup(), - DefaultOperatorDelay(200 * time.Millisecond), - ) - sinks, cout, cerr, operator := newSinks() - kube := startHarness(options, sinks, nil) + options := *newOptions("test-sleep05", "nocleanup") + options.OperatorStartDelay = 200 * time.Millisecond + cout := bytes.Buffer{} + cerr := bytes.Buffer{} + operator := bytes.Buffer{} + sinks := Sinks{[]io.Writer{&cout}, []io.Writer{&cerr}, []io.Writer{&operator}} + // NOTE: buildEnv never overwrites existing env. variable + _ = os.Unsetenv("RND") + kube := startHarness(options, sinks) assert.NotNil(t, kube) test := kube.NewTest(t).Setup() // this will block long enough to register "operator running" err := test.StartOperator() assert.NoError(t, err) - + ns, nset := os.LookupEnv("TEST_OPERATOR_NS") + assert.Equal(t, true, nset) + assert.Equal(t, test.Namespace, ns) err = test.StartOperator() // operator already started assert.NotNil(t, err) + ns, nset = os.LookupEnv("TEST_OPERATOR_NS") + assert.Equal(t, true, nset) + assert.Equal(t, test.Namespace, ns) - ns := test.Namespace rnd, ok := os.LookupEnv("RND") assert.Equal(t, true, ok) cmp := `^echo "export RND=.* echo "test-sleep05-cluster-start \$\{RND\}" -echo "test-sleep05-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "test-sleep05-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\}" sleep 0\.5s -echo "test-sleep05-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" -echo "test-sleep05-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "test-sleep05-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "test-sleep05-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\}" ` cmp += fmt.Sprintf(`export RND=%s test-sleep05-cluster-start %s -test-sleep05-operator-stop %s %s 1 +test-sleep05-operator-stop %s %s $`, rnd, rnd, rnd, ns) // intentionally not calling StopOperator(), test.Close() should call it for us test.Close() @@ -86,105 +99,55 @@ $`, rnd, rnd, rnd, ns) assert.NoError(t, err) assert.Regexp(t, cmp, cout.String()) // stdout output of the operator goes to the operator sink - cmp = fmt.Sprintf("test-sleep05-operator-start %s %s 1\n", rnd, ns) + cmp = fmt.Sprintf("test-sleep05-operator-start %s %s\n", rnd, ns) assert.Equal(t, cmp, operator.String()) assert.Empty(t, cerr.String()) } func TestStartSlowWithCleanup(t *testing.T) { - options := *newOptions( - DefaultEnvAlways(), - DefaultPrefix("test-sleep05"), - DefaultOperatorDelay(200 * time.Millisecond), - ) - sinks, cout, cerr, operator := newSinks() - kube := startHarness(options, sinks, nil) + options := *newOptions("test-sleep05") + options.OperatorStartDelay = 200 * time.Millisecond + cout := bytes.Buffer{} + cerr := bytes.Buffer{} + operator := bytes.Buffer{} + sinks := Sinks{[]io.Writer{&cout}, []io.Writer{&cerr}, []io.Writer{&operator}} + // NOTE: buildEnv never overwrites existing env. variable + _ = os.Unsetenv("RND") + kube := startHarness(options, sinks) assert.NotNil(t, kube) test := kube.NewTest(t).Setup() // this will block long enough to register "operator running" err := test.StartOperator() assert.NoError(t, err) + ns, nset := os.LookupEnv("TEST_OPERATOR_NS") + assert.Equal(t, true, nset) + assert.Equal(t, test.Namespace, ns) - ns := test.Namespace rnd, ok := os.LookupEnv("RND") assert.Equal(t, true, ok) cmp := `^echo "export RND=.* echo "test-sleep05-cluster-start \$\{RND\}" echo "test-sleep05-cluster-stop \$\{RND\}" -echo "test-sleep05-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "test-sleep05-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\}" sleep 0\.5s -echo "test-sleep05-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" -echo "test-sleep05-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "test-sleep05-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "test-sleep05-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\}" ` cmp += fmt.Sprintf(`export RND=%s test-sleep05-cluster-stop %s test-sleep05-cluster-start %s -test-sleep05-operator-stop %s %s 1 -test-sleep05-cleanup %s %s 1 +test-sleep05-operator-stop %s %s +test-sleep05-cleanup %s %s test-sleep05-cluster-stop %s $`, rnd, rnd, rnd, rnd, ns, rnd, ns, rnd) // intentionally not calling StopOperator(), test.Close() should call it for us test.Close() err = kube.Close() assert.NoError(t, err) - assert.Regexp(t, cmp, cout.String()) // stdout output of the operator goes to the operator sink - cmp = fmt.Sprintf("test-sleep05-operator-start %s %s 1\n", rnd, ns) + cmp = fmt.Sprintf("test-sleep05-operator-start %s %s\n", rnd, ns) assert.Equal(t, cmp, operator.String()) assert.Empty(t, cerr.String()) } - -func TestRunArbitraryTarget(t *testing.T) { - options := *newOptions( - DefaultEnvAlways(), - DefaultPrefix("test-sleep05"), - DefaultOperatorDelay(200 * time.Millisecond), - ) - sinks, cout, _, _ := newSinks() - kube := startHarness(options, sinks, nil) - assert.NotNil(t, kube) - - test := kube.NewTest(t).Setup() - // this will block long enough to register "operator running" - err := test.StartOperator() - assert.NoError(t, err) - - err = test.RunTarget("foo") - assert.NoError(t, err) - - // try again, detecting an error this time - err = test.RunTarget("bar") - assert.NotNil(t, err) - - rnd, ok := os.LookupEnv("RND") - assert.Equal(t, true, ok) - ns := test.Namespace - cmp := `^echo "export RND=.* -echo "test-sleep05-cluster-start \$\{RND\}" -echo "test-sleep05-cluster-stop \$\{RND\}" -echo "test-sleep05-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" -sleep 0\.5s -echo "test-sleep05-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" -echo "test-sleep05-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" -` - cmp += fmt.Sprintf(`export RND=%s -test-sleep05-cluster-stop %s -test-sleep05-cluster-start %s -test-sleep05-foo %s %s 1 -test-sleep05-bar %s %s 1.*error -`, rnd, rnd, rnd, rnd, ns, rnd, ns) - if runtime.GOOS == "linux" { - // I am very sorry, but there does not seem to be a way to tell the GNU make to keep quiet here - cmp += "Makefile:.* failed\n" - } - cmp += fmt.Sprintf(`test-sleep05-operator-stop %s %s 1 -test-sleep05-cleanup %s %s 1 -test-sleep05-cluster-stop %s -$`, rnd, ns, rnd, ns, rnd) - test.Close() - err = kube.Close() - assert.NoError(t, err) - assert.Regexp(t, cmp, cout.String()) -} From 53dcb6917eb635b3a80b0e9c8d7483e34c77ca3a Mon Sep 17 00:00:00 2001 From: Bronek Kozicki Date: Fri, 6 Mar 2020 11:26:37 +0000 Subject: [PATCH 10/38] Refactoring of Client access in Harness Let's not use an accessor for Client access, if public field is sufficient --- pkg/test_framework/harness.go | 153 +++++++--------------------------- 1 file changed, 28 insertions(+), 125 deletions(-) diff --git a/pkg/test_framework/harness.go b/pkg/test_framework/harness.go index 09ed86c..f13f69f 100644 --- a/pkg/test_framework/harness.go +++ b/pkg/test_framework/harness.go @@ -8,7 +8,6 @@ import ( "os" "path/filepath" "regexp" - "sync/atomic" "testing" "time" @@ -16,22 +15,15 @@ import ( "github.com/dlespiau/kube-test-harness/logger" htesting "github.com/dlespiau/kube-test-harness/testing" "github.com/subosito/gotenv" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" client "sigs.k8s.io/controller-runtime/pkg/client" ) -type internalState struct { - testCounter uint32 -} - type Harness struct { - internalState harness.Harness Options Options Sinks Sinks - Scheme *runtime.Scheme Client client.Client } @@ -51,8 +43,6 @@ func (h *Harness) NewTest(t htesting.T) *Test { Test: *test, operatorRunning: false, harness: h, - testCount: atomic.AddUint32(&h.internalState.testCounter, 1), - envs: map[string]string{}, } } @@ -69,11 +59,10 @@ func (h *Harness) OpenManifest(manifest string) (*os.File, error) { type Options struct { harness.Options - Makefile string - MakeDir string - Prefix string - OperatorDelay time.Duration - EnvAlways bool + Makefile string + MakeDir string + Prefix string + OperatorStartDelay time.Duration } // Users can use these to capture the "console" output from the spawned sub-processes rather than @@ -86,92 +75,16 @@ type Sinks struct { var Kube *Harness -type ParseOptions struct { - MakeDir string - Manifests string - Prefix string - NoCleanup bool - OperatorDelay time.Duration - EnvAlways bool - OsArgs []string - CmdLine *flag.FlagSet -} - -type ParseOptionFn func (a* ParseOptions) - -func DefaultMakeDir(makedir string) ParseOptionFn { - return func(a* ParseOptions) { - a.MakeDir = makedir - } -} - -func DefaultManifests(manifests string) ParseOptionFn { - return func(a* ParseOptions) { - a.Manifests = manifests - } -} - -func DefaultPrefix(prefix string) ParseOptionFn { - return func(a* ParseOptions) { - a.Prefix = prefix - } -} - -func DefaultNoCleanup() ParseOptionFn { - return func(a* ParseOptions) { - a.NoCleanup = true - } -} - -func DefaultOperatorDelay(opdelay time.Duration) ParseOptionFn { - return func(a* ParseOptions) { - a.OperatorDelay = opdelay - } -} - -func DefaultEnvAlways() ParseOptionFn { - return func(a* ParseOptions) { - a.EnvAlways = true - } -} - -func OverrideOsArgs(osargs []string) ParseOptionFn { - return func(a* ParseOptions) { - a.OsArgs = osargs - } -} - -func OverrideCmdLine(cmdline *flag.FlagSet) ParseOptionFn { - return func(a* ParseOptions) { - a.CmdLine = cmdline - } -} - -// We are making use of Functional Options pattern here. -func Parse(opts ...ParseOptionFn) *Options { - args := ParseOptions{ - MakeDir: "", - Manifests: "manifests", - Prefix: "test", - NoCleanup: false, - OperatorDelay: 2 * time.Second, - EnvAlways: false, - OsArgs: os.Args[1:], - CmdLine: flag.CommandLine, - } - for _, opt := range opts { - opt(&args) - } +func Parse() *Options { + noCleanup := flag.Bool("k8s.no-cleanup", false, "should test cleanup after themselves") + verbose := flag.Bool("k8s.log.verbose", false, "turn on more verbose logging") + makefile := flag.String("k8s.makefile", "Makefile", "makefile for cluster manipulation targets, relative to makedir") + makedir := flag.String("k8s.makedir", "", "directory to makefile") + prefix := flag.String("k8s.prefix", "test", "prefix for make cluster manipulation targets") + manifests := flag.String("k8s.manifests", "manifests", "directory to K8s manifests") + delay := flag.Duration("k8s.op-delay", 2 * time.Second, "operator start delay") - noCleanup := args.CmdLine.Bool("k8s.no-cleanup", args.NoCleanup, "should test cleanup after themselves") - verbose := args.CmdLine.Bool("k8s.log.verbose", false, "turn on more verbose logging") - makefile := args.CmdLine.String("k8s.makefile", "Makefile", "makefile for cluster manipulation targets, relative to MakeDir") - makedir := args.CmdLine.String("k8s.makedir", args.MakeDir, "directory to makefile") - prefix := args.CmdLine.String("k8s.prefix", args.Prefix, "prefix for make cluster manipulation targets") - manifests := args.CmdLine.String("k8s.manifests", args.Manifests, "directory to K8s manifests") - delay := args.CmdLine.Duration("k8s.op-delay", args.OperatorDelay, "operator start delay") - envAlways := args.CmdLine.Bool("k8s.env-always", args.EnvAlways, "always use environment variables from makefile") - _ = args.CmdLine.Parse(args.OsArgs) + flag.Parse() // NOTE: We call "sanitize" functions both here and in Start(). This is to enable // the users to create Options by hand, in case if they do not want to use this @@ -182,11 +95,10 @@ func Parse(opts ...ParseOptionFn) *Options { NoCleanup: *noCleanup, Logger: &logger.PrintfLogger{}, }, - Makefile: *makefile, - MakeDir: sanitizeMakeDir(*makedir), - Prefix: sanitizePrefix(*prefix), - OperatorDelay: *delay, - EnvAlways: *envAlways, + Makefile: *makefile, + MakeDir: sanitizeMakeDir(*makedir), + Prefix: sanitizePrefix(*prefix), + OperatorStartDelay: *delay, } if *verbose { options.LogLevel = logger.Debug @@ -195,18 +107,14 @@ func Parse(opts ...ParseOptionFn) *Options { return &options } -// We have a fair number of optional parameters here, let's use poor man's default -func Start(options Options, sinks* Sinks, scheme* runtime.Scheme) { +func Start(m *testing.M, options Options, sinks Sinks) { // NOTE: We call "sanitize" functions both here and in Parse() to avoid // strong coupling, i.e. we do not make strong assumption as to the format // of MakeDir and Prefix here, hence allowing the user to skip Parse() options.MakeDir = sanitizeMakeDir(options.MakeDir) options.Prefix = sanitizePrefix(options.Prefix) - if sinks == nil { - sinks = &Sinks{} - } - Kube = startHarness(options, *sinks, scheme) - Kube.Client = newClient(scheme) + Kube = startHarness(options, sinks) + Kube.Client = newClient() } // NOTE: this function MUST be idempotent, because it will be called both @@ -245,7 +153,7 @@ func newClientConfig(kubeconfig string) (*rest.Config, error) { ).ClientConfig() } -func newClient(scheme* runtime.Scheme) client.Client { +func newClient() client.Client { kubeconfig := os.Getenv("KUBECONFIG") if len(kubeconfig) == 0 { log.Panicf("KUBECONFIG is empty or not set") @@ -256,10 +164,7 @@ func newClient(scheme* runtime.Scheme) client.Client { log.Panic(err) } - cclient, err := client.New(config, client.Options{ - Scheme: scheme, - Mapper: nil, - }) + cclient, err := client.New(config, client.Options{}) if err != nil { log.Panic(err) } @@ -267,17 +172,15 @@ func newClient(scheme* runtime.Scheme) client.Client { return cclient } -func startHarness(options Options, sinks Sinks, scheme* runtime.Scheme) *Harness { +func startHarness(options Options, sinks Sinks) *Harness { checkMakefile(options, sinks) buildEnv(options, sinks) stopCluster(options, sinks) startCluster(options, sinks) return &Harness{ - internalState: internalState{0}, Harness: *harness.New(options.Options), Options: options, Sinks: sinks, - Scheme: scheme, Client: nil, } } @@ -288,7 +191,7 @@ func checkMakefile(options Options, sinks Sinks) { check := func(target string) { args := []string{"make", "-s", "-f", makefile, "-C", makedir, "--dry-run", target} log.Printf("Checking %v ...", args) - err := run(sinks.Stdout, sinks.Stderr, args, nil) + err := run(sinks.Stdout, sinks.Stderr, args) if err != nil { log.Panicf("error checking target %s: %v", target, err) } else { @@ -324,7 +227,7 @@ func buildEnv(options Options, sinks Sinks) { // clone sinks.Stdout and add exports cout := append([]io.Writer{}, sinks.Stdout...) cout = append(cout, &exports) - err := run(cout, sinks.Stderr, args, nil) + err := run(cout, sinks.Stderr, args) if err != nil { log.Panic(err) } @@ -337,7 +240,7 @@ func buildEnv(options Options, sinks Sinks) { for key, val := range env { // Empty environment variable looks the same as undefined to // the user, so let's treat them the same way here, too - if old, present := os.LookupEnv(key); options.EnvAlways || !present || old == "" { + if old, present := os.LookupEnv(key); !present || old == "" { if err := os.Setenv(key, val); err != nil { log.Panic(err) } @@ -350,7 +253,7 @@ func startCluster(options Options, sinks Sinks) { makedir := options.MakeDir args := []string{"make", "-s", "-f", makefile, "-C", makedir, options.clusterStart()} log.Printf("Running %v ...", args) - err := run(sinks.Stdout, sinks.Stderr, args, nil) + err := run(sinks.Stdout, sinks.Stderr, args) if err != nil { log.Panic(err) } @@ -372,6 +275,6 @@ func stopCluster(options Options, sinks Sinks) { args := []string{"make", "-s", "-f", makefile, "-C", makedir, options.clusterStop()} log.Printf("Running %v ...", args) // if this fails that's perfectly OK - the cluster might not have been running! - _ = run(sinks.Stdout, sinks.Stderr, args, nil) + _ = run(sinks.Stdout, sinks.Stderr, args) log.Print("... done") } From fac838d926351f88f4ad7006a0337422a01dabc8 Mon Sep 17 00:00:00 2001 From: Bronek Kozicki Date: Fri, 6 Mar 2020 14:30:51 +0000 Subject: [PATCH 11/38] Upgrade controller-runtime package to v0.2.2 --- go.mod | 11 ++++------- go.sum | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 91fa283..a435968 100644 --- a/go.mod +++ b/go.mod @@ -3,11 +3,9 @@ module github.com/Yelp/paasta-tools-go require ( github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754 github.com/fatih/structs v1.1.0 - github.com/go-logr/logr v0.1.0 // indirect github.com/go-logr/zapr v0.1.1 // indirect github.com/gogo/protobuf v1.2.1 // indirect github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 // indirect - github.com/googleapis/gnostic v0.3.1 // indirect github.com/hashicorp/golang-lru v0.5.3 // indirect github.com/imdario/mergo v0.3.8 // indirect github.com/mitchellh/mapstructure v1.1.2 @@ -24,15 +22,14 @@ require ( golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 // indirect golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect - gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.2.2 - k8s.io/api v0.0.0-20190313235455-40a48860b5ab - k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1 - k8s.io/client-go v11.0.0+incompatible + k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b + k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d + k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a // indirect k8s.io/kubernetes v1.14.0 k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 // indirect - sigs.k8s.io/controller-runtime v0.1.10 + sigs.k8s.io/controller-runtime v0.2.2 ) go 1.12 diff --git a/go.sum b/go.sum index 7a0d2ec..fbc76ef 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -22,8 +23,11 @@ github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754 h1:Qd6d github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754/go.mod h1:rTr8X4qZPRmQKsyAjhECPi+zPnmlcmv5W9s1F11oBSo= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= +github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -31,6 +35,7 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v0.1.1 h1:qXBXPDdNncunGs7XeEpsJt8wCjYBygluzfdLO0G5baE= github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= @@ -41,6 +46,7 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -50,6 +56,7 @@ github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= @@ -58,11 +65,15 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= +github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -94,7 +105,10 @@ github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwd github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -103,6 +117,7 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0 h1:miYCvYqFXtl/J9FIy8eNpBfYthAEFg+Ys0XyUVEcDsc= @@ -111,9 +126,11 @@ github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1: github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0 h1:ElTg5tNp4DqfV7UQjDqv2+RJlNzsDtvNAWccbItceIE= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= @@ -123,6 +140,7 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -135,13 +153,17 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -151,6 +173,7 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 h1:ulvT7fqt0yHWzpJwI57MezWnYDVpCAYBVuYst/L+fAY= @@ -161,8 +184,10 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -170,6 +195,7 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= @@ -180,6 +206,7 @@ golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -189,14 +216,20 @@ golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gomodules.xyz/jsonpatch/v2 v2.0.1 h1:xyiBuvkD2g5n7cYzx6u2sxQvsAy4QJsZFCzGVdzOXZ0= +gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -205,26 +238,39 @@ k8s.io/api v0.0.0-20190202010724-74b699b93c15 h1:AoUGjnJ3PJMFz+Rkp4lx3X+6mPUnY1M k8s.io/api v0.0.0-20190202010724-74b699b93c15/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.0.0-20190313235455-40a48860b5ab h1:DG9A67baNpoeweOy2spF1OWHhnVY5KR7/Ek/+U1lVZc= k8s.io/api v0.0.0-20190313235455-40a48860b5ab/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= +k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b h1:aBGgKJUM9Hk/3AE8WaZIApnTxG35kbuQba2w+SXqezo= +k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= +k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8 h1:q1Qvjzs/iEdXF6A1a8H3AKVFDzJNcJn3nXMs6R6qFtA= +k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c h1:02KEBFny6M5VWKj6Y8Ns27epjefTqLJXD4fvqP5tGFg= k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1 h1:IS7K02iBkQXpCeieSiyJjGoLSdVOv2DbPaWHJ+ZtgKg= k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= +k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d h1:Jmdtdt1ZnoGfWWIIik61Z7nKYgO3J+swQJtPYsP9wHA= +k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/client-go v11.0.0+incompatible h1:LBbX2+lOwY9flffWlJM7f1Ct8V2SRNiMRDFeiwnJo9o= k8s.io/client-go v11.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= +k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible h1:U5Bt+dab9K8qaUmXINrkXO135kA11/i5Kg1RUydgaMQ= +k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.2.0 h1:0ElL0OHzF3N+OhoJTL0uca20SxtYt4X4+bzHeqrB83c= k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kubernetes v1.14.0 h1:6T2iAEoOYQnzQb3WvPlUkcczEEXZ7+YPlAO8olwujRw= k8s.io/kubernetes v1.14.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= +k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 h1:p0Ai3qVtkbCG/Af26dBmU0E1W58NID3hSSh7cMyylpM= k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= sigs.k8s.io/controller-runtime v0.1.10 h1:amLOmcekVdnsD1uIpmgRqfTbQWJ2qxvQkcdeFhcotn4= sigs.k8s.io/controller-runtime v0.1.10/go.mod h1:HFAYoOh6XMV+jKF1UjFwrknPbowfyHEHHRdJMf2jMX8= +sigs.k8s.io/controller-runtime v0.2.2 h1:JT/vJJhUjjL9NZNwnm8AXmqCBUXSCFKmTaNjwDi28N0= +sigs.k8s.io/controller-runtime v0.2.2/go.mod h1:9dyohw3ZtoXQuV1e766PHUn+cmrRCIcBh6XIMFNMZ+I= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/testing_frameworks v0.1.1/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9qL6ht1zEr/U= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= From 6d0986513ff0422aab1f87a7a67b16eb29c6e551 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Mon, 25 Nov 2019 18:25:13 +0100 Subject: [PATCH 12/38] configstore for access to paasta system and instance configs in json and yaml files --- go.sum | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/go.sum b/go.sum index fbc76ef..0f18ed8 100644 --- a/go.sum +++ b/go.sum @@ -77,9 +77,6 @@ github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -94,9 +91,6 @@ github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQz github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -144,9 +138,6 @@ github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= @@ -233,7 +224,6 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= k8s.io/api v0.0.0-20190202010724-74b699b93c15 h1:AoUGjnJ3PJMFz+Rkp4lx3X+6mPUnY1MESJhbUSGX+pc= k8s.io/api v0.0.0-20190202010724-74b699b93c15/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.0.0-20190313235455-40a48860b5ab h1:DG9A67baNpoeweOy2spF1OWHhnVY5KR7/Ek/+U1lVZc= From 0d92a0d8c589286e57ae6948e33f42d88a2c9186 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Fri, 17 Jan 2020 16:23:42 +0100 Subject: [PATCH 13/38] sync go.mod with master --- go.sum | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/go.sum b/go.sum index 0f18ed8..fbc76ef 100644 --- a/go.sum +++ b/go.sum @@ -77,6 +77,9 @@ github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -91,6 +94,9 @@ github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQz github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -138,6 +144,9 @@ github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= @@ -224,6 +233,7 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= k8s.io/api v0.0.0-20190202010724-74b699b93c15 h1:AoUGjnJ3PJMFz+Rkp4lx3X+6mPUnY1MESJhbUSGX+pc= k8s.io/api v0.0.0-20190202010724-74b699b93c15/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.0.0-20190313235455-40a48860b5ab h1:DG9A67baNpoeweOy2spF1OWHhnVY5KR7/Ek/+U1lVZc= From 873aae1ff946d63699f72e970ea07331bd490bfc Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Thu, 23 Apr 2020 15:06:18 -0700 Subject: [PATCH 14/38] fix tests --- go.mod | 2 +- go.sum | 2 + pkg/configstore/store.go | 3 +- pkg/deployments/deployments.go | 2 +- pkg/deployments/deployments_test.go | 71 +++++++++++++++-------------- pkg/volumes/converter_test.go | 16 +++---- pkg/volumes/volumes_test.go | 16 +++---- 7 files changed, 58 insertions(+), 54 deletions(-) diff --git a/go.mod b/go.mod index a435968..323769e 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 // indirect github.com/hashicorp/golang-lru v0.5.3 // indirect github.com/imdario/mergo v0.3.8 // indirect - github.com/mitchellh/mapstructure v1.1.2 + github.com/mitchellh/mapstructure v1.2.2 github.com/modern-go/reflect2 v1.0.1 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 github.com/pborman/uuid v1.2.0 // indirect diff --git a/go.sum b/go.sum index fbc76ef..f725407 100644 --- a/go.sum +++ b/go.sum @@ -92,6 +92,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0j github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.2.2 h1:dxe5oCinTXiTIcfgmZecdCzPmAJKd46KsCWc35r0TV4= +github.com/mitchellh/mapstructure v1.2.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= diff --git a/pkg/configstore/store.go b/pkg/configstore/store.go index c53effb..20369ac 100644 --- a/pkg/configstore/store.go +++ b/pkg/configstore/store.go @@ -15,7 +15,7 @@ import ( // Store holds config data type Store struct { // If you care about sanity, never write here, just read - Data sync.Map + Data *sync.Map Dir string Hints map[string]string sync.Mutex @@ -69,6 +69,7 @@ func NewStore(dir string, hints map[string]string) *Store { hints = map[string]string{} } return &Store{ + Data: &sync.Map{}, Dir: dir, Hints: hints, ListFiles: listFiles, diff --git a/pkg/deployments/deployments.go b/pkg/deployments/deployments.go index 9bc1ff5..e476b07 100644 --- a/pkg/deployments/deployments.go +++ b/pkg/deployments/deployments.go @@ -96,7 +96,7 @@ func (provider *DefaultImageProvider) DockerImageURLForDeployGroup(deploymentGro func (provider *DefaultImageProvider) getDockerRegistry() (string, error) { dockerRegistry := &DockerRegistry{Registry: ""} - err := provider.PaastaConfig.Load("registry", &dockerRegistry.Registry) + err := provider.PaastaConfig.Load("docker_registry", &dockerRegistry) return dockerRegistry.Registry, err } diff --git a/pkg/deployments/deployments_test.go b/pkg/deployments/deployments_test.go index 88a8cb2..bbc4e49 100644 --- a/pkg/deployments/deployments_test.go +++ b/pkg/deployments/deployments_test.go @@ -2,6 +2,7 @@ package deployments import ( "fmt" + "sync" "testing" "github.com/Yelp/paasta-tools-go/pkg/configstore" @@ -12,30 +13,28 @@ const ( ) func TestDefaultProviderGetDeployment(test *testing.T) { - imageProvider := DefaultImageProvider{ - PaastaConfig: &configstore.Store{ - Data: map[string]interface{}{ - "docker_registry": map[string]interface{}{ - "registry": "fakeregistry.yelp.com", - }, + paastaConfigData := &sync.Map{} + paastaConfigData.Store("docker_registry", map[string]interface{}{ + "docker_registry": "fakeregistry.yelp.com", + }) + + serviceConfigData := &sync.Map{} + serviceConfigData.Store("v2", map[string]interface{}{ + "deployments": map[string]interface{}{ + "dev.every": map[string]interface{}{ + "docker_image": "busybox:latest", + "git_sha": "03d6f783c99695af0e716588abb9ba83ac957be2", }, - }, - ServiceConfig: &configstore.Store{ - Data: map[string]interface{}{ - "v2": map[string]interface{}{ - "deployments": map[string]interface{}{ - "dev.every": map[string]interface{}{ - "docker_image": "busybox:latest", - "git_sha": "03d6f783c99695af0e716588abb9ba83ac957be2", - }, - "test.every": map[string]interface{}{ - "docker_image": "ubuntu:latest", - "git_sha": "f3d6f783c99695af0e716588abb9ba83ac957be3", - }, - }, - }, + "test.every": map[string]interface{}{ + "docker_image": "ubuntu:latest", + "git_sha": "f3d6f783c99695af0e716588abb9ba83ac957be3", }, }, + }) + + imageProvider := DefaultImageProvider{ + PaastaConfig: &configstore.Store{Data: paastaConfigData}, + ServiceConfig: &configstore.Store{Data: serviceConfigData}, } testcases := map[string]string{ "dev.every": "busybox:latest", @@ -106,22 +105,24 @@ func TestDeploymentAnnotationsForControlGroup(test *testing.T) { } func TestDefaultGetRegistry(t *testing.T) { + paastaConfigData := &sync.Map{} + paastaConfigData.Store("docker_registry", map[string]interface{}{ + "docker_registry": "fakeregistry.yelp.com", + }) + + serviceConfigData := &sync.Map{} + serviceConfigData.Store("v2", map[string]interface{}{ + "deployments": map[string]interface{}{}, + }) + imageProvider := DefaultImageProvider{ - PaastaConfig: &configstore.Store{ - Data: map[string]interface{}{ - "registry": "fakeregistry.yelp.com", - }, - }, - ServiceConfig: &configstore.Store{ - Data: map[string]interface{}{ - "v2": map[string]interface{}{ - "deployments": map[string]interface{}{}, - }, - }, - }, + PaastaConfig: &configstore.Store{Data: paastaConfigData}, + ServiceConfig: &configstore.Store{Data: serviceConfigData}, } - url, _ := imageProvider.getDockerRegistry() - if url != "fakeregistry.yelp.com" { + url, err := imageProvider.getDockerRegistry() + if err != nil { + t.Errorf("expected %s actual: error %+v", "fakeregistry.yelp.com", err) + } else if url != "fakeregistry.yelp.com" { t.Errorf("expected %s actual %+v", "fakeregistry.yelp.com", url) } } diff --git a/pkg/volumes/converter_test.go b/pkg/volumes/converter_test.go index 3dbd185..f0fb20c 100644 --- a/pkg/volumes/converter_test.go +++ b/pkg/volumes/converter_test.go @@ -2,6 +2,7 @@ package volumes import ( "reflect" + "sync" "testing" "github.com/Yelp/paasta-tools-go/pkg/configstore" @@ -72,15 +73,14 @@ func TestFormatMountName(t *testing.T) { } func TestGetDefaultPaastaKubernetesVolumes(t *testing.T) { - fakeVolumeConfig := map[string]interface{}{ - "volumes": []map[string]interface{}{ - map[string]interface{}{ - "hostPath": "/foo", - "containerPath": "/bar", - "mode": "RO", - }, + fakeVolumeConfig := &sync.Map{} + fakeVolumeConfig.Store("volumes", []map[string]interface{}{ + map[string]interface{}{ + "hostPath": "/foo", + "containerPath": "/bar", + "mode": "RO", }, - } + }) reader := &configstore.Store{Data: fakeVolumeConfig} volumeMounts, volumes, err := GetDefaultPaastaKubernetesVolumes(reader) if err != nil { diff --git a/pkg/volumes/volumes_test.go b/pkg/volumes/volumes_test.go index 189f238..40149b9 100644 --- a/pkg/volumes/volumes_test.go +++ b/pkg/volumes/volumes_test.go @@ -2,21 +2,21 @@ package volumes import ( "reflect" + "sync" "testing" "github.com/Yelp/paasta-tools-go/pkg/configstore" ) func TestDefaultVolumesFromReader(test *testing.T) { - fakeVolumeConfig := map[string]interface{}{ - "volumes": []map[string]interface{}{ - map[string]interface{}{ - "hostPath": "/foo", - "containerPath": "/bar", - "mode": "RO", - }, + fakeVolumeConfig := &sync.Map{} + fakeVolumeConfig.Store("volumes", []map[string]interface{}{ + map[string]interface{}{ + "hostPath": "/foo", + "containerPath": "/bar", + "mode": "RO", }, - } + }) reader := &configstore.Store{Data: fakeVolumeConfig} actual, err := DefaultVolumesFromReader(reader) if err != nil { From eabe1b60b56f23031987fe249ae17ff3b0cf68b3 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Thu, 23 Apr 2020 15:18:01 -0700 Subject: [PATCH 15/38] fix more tests --- pkg/configstore/store_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/configstore/store_test.go b/pkg/configstore/store_test.go index c1aa078..85a89ff 100644 --- a/pkg/configstore/store_test.go +++ b/pkg/configstore/store_test.go @@ -40,7 +40,7 @@ func unexpectedfileExists(test *testing.T) func(path string) (bool, error) { func TestStore_loadPath(test *testing.T) { key := "test key" s := &Store{ - Data: sync.Map{}, + Data: &sync.Map{}, ParseFile: func(file string, val interface{}) error { v, ok := val.(map[string]interface{}) if !ok { @@ -66,7 +66,7 @@ func TestStore_loadPath(test *testing.T) { func TestStore_loadAll(test *testing.T) { s := &Store{ Dir: "zero", - Data: sync.Map{}, + Data: &sync.Map{}, ParseFile: func(file string, val interface{}) error { fmt.Printf("parse file called: %s\n", file) v, ok := val.(map[string]interface{}) @@ -96,7 +96,7 @@ func TestStore_loadAll(test *testing.T) { func TestStore_load(test *testing.T) { s := &Store{ Dir: "zero", - Data: sync.Map{}, + Data: &sync.Map{}, ParseFile: func(file string, val interface{}) error { return nil }, ListFiles: unexpectedListFiles(test), FileExists: func(path string) (bool, error) { @@ -118,7 +118,7 @@ func TestStore_load(test *testing.T) { func TestStore_Get(test *testing.T) { s := &Store{ Dir: "zero", - Data: sync.Map{}, + Data: &sync.Map{}, ParseFile: unexpectedParseFile(test), ListFiles: unexpectedListFiles(test), FileExists: func(path string) (bool, error) { From 926463362c48c20143d483e5b51d6c36de21a256 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Thu, 23 Apr 2020 15:41:23 -0700 Subject: [PATCH 16/38] add package docstring, add error context where missing --- pkg/configstore/store.go | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/pkg/configstore/store.go b/pkg/configstore/store.go index 20369ac..3fadeb5 100644 --- a/pkg/configstore/store.go +++ b/pkg/configstore/store.go @@ -1,3 +1,6 @@ +// Package configstore provides an object to fetch config data from disk +// according to PaaSTA conventions. Loaded values are cached to avoid repeated +// disk access. For more details, see docs for `configstore.Store`. package configstore import ( @@ -12,9 +15,30 @@ import ( "github.com/mitchellh/mapstructure" ) -// Store holds config data +// Store is a container that fetches and caches config values from disk and +// destructures them into PaaSTA value structures. +// +// `Store` object will mimic config loading from original paasta-tools, which +// works as following for `store.Get("foo")` call: +// +// 1. look on disk for file `foo.json` or `foo.yaml` +// 2. if file exists, load it and fetch `foo` key from top-level dictionary +// 3. if file is missing, load all `.json` or `.yaml` files and merge them +// into single dictionary and look for `foo` key in there +// +// To avoid eagerly loading all existing configuration files, `Store` object +// accepts optional `hints` dictionary, with mapping from keys to file paths, +// where to look for those keys. If requested key is missing from hints, it will +// trigger eager loading as per default functionality. +// +// There are two ways to get config data, via `Get` or `Load` methods. `Get` +// will parse the config value and return it as `interface{}` type, while `Load` +// will accept destination pointer and use `mapstructure.Decode` to destructure +// the value. +// +// TODO: since `Store` is meant to be a long-lived object we need to keep track +// of updated configs and a possibility to manually reset the cache. type Store struct { - // If you care about sanity, never write here, just read Data *sync.Map Dir string Hints map[string]string @@ -28,7 +52,7 @@ type Store struct { func listFiles(dirname string) ([]string, error) { files, err := ioutil.ReadDir(dirname) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to list directory %v: %v", dirname, err) } ret := make([]string, len(files)) From 4deaee4aa6eb5134477b64af56422a1b438ac94a Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Mon, 25 Nov 2019 18:25:13 +0100 Subject: [PATCH 17/38] implement config stores with support for key hints --- pkg/config/config.go | 139 ++++++++++++++++++++++++++---- pkg/config/config_test.go | 176 +++++++++++++++++++++++++++++++------- 2 files changed, 267 insertions(+), 48 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 3dd0472..754a2f2 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -2,39 +2,146 @@ package config import ( "encoding/json" - "io" + "fmt" "io/ioutil" + "log" "os" "path" + "sync" ) -type ConfigReader interface { - Read(interface{}) error +// Store holds config data +type Store struct { + // If you care about sanity, never write here, just read + data map[string]interface{} + dir string + hints map[string]string + sync.Mutex + + listFiles func(string) ([]string, error) + parseFile func(string, interface{}) error + fileExists func(string) (bool, error) } -type ConfigFileReader struct { - Basedir string - Filename string +func listFiles(dirname string) ([]string, error) { + files, err := ioutil.ReadDir(dirname) + if err != nil { + return nil, err + } + + ret := make([]string, len(files)) + for idx, file := range files { + ret[idx] = file.Name() + } + + return ret, nil } -func ParseContent(reader io.Reader, content interface{}) error { - buf, err := ioutil.ReadAll(reader) +func parseFile(path string, value interface{}) error { + reader, err := os.Open(path) + defer reader.Close() if err != nil { return err } - err = json.Unmarshal(buf, content) - return err + + return json.NewDecoder(reader).Decode(value) } -func (configReader ConfigFileReader) FileNameForConfig() string { - return path.Join(configReader.Basedir, configReader.Filename) +func fileExists(path string) (bool, error) { + _, err := os.Stat(path) + if err != nil { + if os.IsNotExist(err) { + return false, nil + } + return false, err + } + return true, nil } -func (configReader ConfigFileReader) Read(content interface{}) error { - reader, err := os.Open(configReader.FileNameForConfig()) - defer reader.Close() +// NewStore creates a new config store +// `dir` is a directory from where data will be loaded +// `hints` is a dictionary to find which file to load for +// a given key +func NewStore(dir string, hints map[string]string) *Store { + if hints == nil { + hints = map[string]string{} + } + return &Store{ + dir: dir, + hints: hints, + listFiles: listFiles, + parseFile: parseFile, + fileExists: fileExists, + } +} + +// Decode `path` contents using `json`, copy `s.data` into +// a new map, merge loaded data into the copy and swap `s.data` +func (s *Store) loadPath(path string) error { + value := map[string]interface{}{} + err := s.parseFile(path, value) if err != nil { return err } - return ParseContent(reader, content) + + s.Lock() + defer s.Unlock() + for key, val := range value { + s.data[key] = val + } + + return nil +} + +// Walk `s.dir` and `s.loadPath` all the files +func (s *Store) loadAll() error { + files, err := s.listFiles(s.dir) + if err != nil { + return err + } + + for _, file := range files { + err := s.loadPath(path.Join(s.dir, file)) + if err != nil { + return err + } + } + return nil +} + +// Look for `domain`.json file, if not found try loading all files and +// print a warning about hints +func (s *Store) load(domain string) error { + path := path.Join(s.dir, fmt.Sprintf("%s.json", domain)) + exists, err := s.fileExists(path) + if err != nil { + return err + } + if !exists { + log.Printf( + "WARN: loading all configs, consider adding some hints" + + fmt.Sprintf("for %s in %s", domain, s.dir), + ) + return s.loadAll() + } + return s.loadPath(path) +} + +// Get returns value for given `key`. If not found in `s.data`, call +// `s.load` function with `domain` from `s.hints` or `key` itself. +func (s *Store) Get(key string) (interface{}, bool) { + if val, ok := s.data[key]; ok { + return val, ok + } + + var domain string + if dom, ok := s.hints[key]; ok { + domain = dom + } else { + domain = key + } + s.load(domain) + + val, ok := s.data[key] + return val, ok } diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 380bf6c..6c53bdc 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -1,54 +1,166 @@ package config import ( - "bytes" - "encoding/json" - "io" - "reflect" + "fmt" "testing" ) -type FakeConfig struct { - Foo string +func errorIf(test *testing.T, pred bool, format string, args ...interface{}) { + if pred { + test.Fatalf(format, args...) + } } -type fakereader struct { - reader io.Reader - data *FakeConfig +func errorUnexpected(test *testing.T, expected, actual interface{}) { + errorIf(test, expected != actual, "expected %+v, actual %+v", expected, actual) } -func (fakereader fakereader) Read(bytes []byte) (n int, err error) { - return fakereader.reader.Read(bytes) +func TestStore_loadPath(test *testing.T) { + key := "test key" + s := &Store{ + data: map[string]interface{}{}, + parseFile: func(file string, val interface{}) error { + v, ok := val.(map[string]interface{}) + if !ok { + panic("assert failed") + } + v[key] = file + return nil + }, + } + expected := "old value" + s.data[key] = expected + s.loadPath("new value") + + if actual, ok := s.data[key]; ok { + if actual != "new value" { + test.Fatalf("%+v was expected, got %+v", expected, actual) + } + } else { + test.Fatalf("key %+v not found", key) + } } -func fakeDataReader(config *FakeConfig) fakereader { - content, _ := json.Marshal(*config) - return fakereader{ - data: config, - reader: bytes.NewReader(content), +func TestStore_loadAll(test *testing.T) { + s := &Store{ + dir: "zero", + data: map[string]interface{}{}, + parseFile: func(file string, val interface{}) error { + fmt.Printf("parse file called: %s\n", file) + v, ok := val.(map[string]interface{}) + if !ok { + panic("assert failed") + } + v[file] = "loaded" + return nil + }, + listFiles: func(dirname string) ([]string, error) { + fmt.Println("list files called") + return []string{"one", "two"}, nil + }, + } + s.loadAll() + + for _, key := range []string{"zero/one", "zero/two"} { + if actual, ok := s.data[key]; ok { + if actual != "loaded" { + test.Fatalf("%s wasn't loaded correctly", key) + } + } else { + test.Fatalf("key %+v wasn't loaded", key) + } } } -func TestParseContent(test *testing.T) { - fakeData := &FakeConfig{} - reader := fakeDataReader(fakeData) - err := ParseContent(reader, fakeData) - if err != nil { - test.Errorf("failed to decode content") +func TestStore_load(test *testing.T) { + s := &Store{ + dir: "zero", + data: map[string]interface{}{}, + parseFile: func(file string, val interface{}) error { + return nil + }, + listFiles: func(dirname string) ([]string, error) { + test.Fatalf("unexpected call to listFiles(%s)", dirname) + return []string{}, nil + }, + fileExists: func(path string) (bool, error) { + expected := "zero/one.json" + if path != expected { + test.Fatalf("expected path=%s, got path=%s", expected, path) + } + return true, nil + }, + } + s.load("one") + + s.fileExists = func(path string) (bool, error) { + return false, nil } - if !reflect.DeepEqual(reader.data, fakeData) { - test.Errorf("deserialized content was incorrect, got: %s, want: %s.", reader.data, fakeData) + s.parseFile = func(file string, val interface{}) error { + test.Fatalf("unexpected call to parseFile(%s)", file) + return nil } + s.listFiles = func(dirname string) ([]string, error) { + return []string{}, nil + } + s.load("one") } -func TestFileNameForConfig(test *testing.T) { - reader := ConfigFileReader{ - Basedir: "/etc/paasta", - Filename: "volumes.json", +func TestStore_Get(test *testing.T) { + s := &Store{ + dir: "zero", + data: map[string]interface{}{}, + parseFile: func(file string, val interface{}) error { + test.Fatalf("unexpected call to parseFile(%s)", file) + return nil + }, + listFiles: func(dirname string) ([]string, error) { + test.Fatalf("unexpected call to listFiles(%s)", dirname) + return []string{}, nil + }, + fileExists: func(path string) (bool, error) { + test.Fatalf("unexpected call to fileExists(%s)", path) + return true, nil + }, + } + s.data["one"] = "two" + val, ok := s.Get("one") + errorIf(test, !ok, "key not found") + errorUnexpected(test, "two", val) + + // key is missing, file with same name exists + s.fileExists = func(path string) (bool, error) { return true, nil } + s.parseFile = func(file string, val interface{}) error { + v := val.(map[string]interface{}) + v["two"] = "three" + return nil + } + val, ok = s.Get("two") + errorIf(test, !ok, "key not found") + errorUnexpected(test, "three", val) + + // key is missing, file corresponding to a hint exists + s.hints = map[string]string{"three": "four"} + s.fileExists = func(path string) (bool, error) { + errorUnexpected(test, "zero/four.json", path) + return true, nil } - expected := "/etc/paasta/volumes.json" - actual := reader.FileNameForConfig() - if actual != expected { - test.Errorf("filename incorrect incorrect, got: %s, want: %s.", actual, expected) + s.parseFile = func(file string, val interface{}) error { + errorUnexpected(test, "zero/four.json", file) + v := val.(map[string]interface{}) + v["three"] = "four" + return nil } + val, ok = s.Get("three") + errorIf(test, !ok, "key not found") + errorUnexpected(test, "four", val) + + // key is missing, file is missing, hint is missing, loaded from all + val, ok = s.Get("four") + errorIf(test, !ok, "key not found") + errorUnexpected(test, "five", val) + + // hint is wrong + + // missing from everywhere } From 3ebbdb25e2ee034a0b712302624843810f98d4e9 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Tue, 26 Nov 2019 16:27:48 +0100 Subject: [PATCH 18/38] fix tests in pkg/config --- go.mod | 41 +++++++-------------- pkg/config/config_test.go | 77 +++++++++++++++++++++------------------ 2 files changed, 55 insertions(+), 63 deletions(-) diff --git a/go.mod b/go.mod index 323769e..28210ed 100644 --- a/go.mod +++ b/go.mod @@ -1,35 +1,22 @@ module github.com/Yelp/paasta-tools-go require ( - github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754 - github.com/fatih/structs v1.1.0 - github.com/go-logr/zapr v0.1.1 // indirect + github.com/fatih/structs v1.1.0 // indirect github.com/gogo/protobuf v1.2.1 // indirect - github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 // indirect - github.com/hashicorp/golang-lru v0.5.3 // indirect - github.com/imdario/mergo v0.3.8 // indirect - github.com/mitchellh/mapstructure v1.2.2 + github.com/json-iterator/go v1.1.7 // indirect github.com/modern-go/reflect2 v1.0.1 // indirect - github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 - github.com/pborman/uuid v1.2.0 // indirect - github.com/pkg/errors v0.8.1 - github.com/pmezard/go-difflib v1.0.0 - github.com/prometheus/client_golang v1.3.0 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/spf13/pflag v1.0.3 // indirect - github.com/stretchr/testify v1.4.0 - github.com/subosito/gotenv v1.2.0 - go.uber.org/zap v1.13.0 // indirect - golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 // indirect - golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 // indirect - golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect - gopkg.in/yaml.v2 v2.2.2 - k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b - k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d - k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible - k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a // indirect - k8s.io/kubernetes v1.14.0 - k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 // indirect - sigs.k8s.io/controller-runtime v0.2.2 + github.com/stretchr/testify v1.3.0 + golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 // indirect + golang.org/x/text v0.3.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v2 v2.2.2 // indirect + k8s.io/api v0.0.0-20190202010724-74b699b93c15 + k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c + k8s.io/klog v0.2.0 // indirect + k8s.io/kubernetes v1.14.0 // indirect + sigs.k8s.io/yaml v1.1.0 // indirect ) -go 1.12 +go 1.13 diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 6c53bdc..9f22766 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -15,6 +15,27 @@ func errorUnexpected(test *testing.T, expected, actual interface{}) { errorIf(test, expected != actual, "expected %+v, actual %+v", expected, actual) } +func unexpectedParseFile(test *testing.T) func(string, interface{}) error { + return func(file string, val interface{}) error { + test.Fatalf("unexpected call to parseFile(%s, _)", file) + return nil + } +} + +func unexpectedListFiles(test *testing.T) func(string) ([]string, error) { + return func(dirname string) ([]string, error) { + test.Fatalf("unexpected call to listFiles(%s)", dirname) + return []string{}, nil + } +} + +func unexpectedfileExists(test *testing.T) func(path string) (bool, error) { + return func(path string) (bool, error) { + test.Fatalf("unexpected call to fileExists(%s)", path) + return false, nil + } +} + func TestStore_loadPath(test *testing.T) { key := "test key" s := &Store{ @@ -55,7 +76,6 @@ func TestStore_loadAll(test *testing.T) { return nil }, listFiles: func(dirname string) ([]string, error) { - fmt.Println("list files called") return []string{"one", "two"}, nil }, } @@ -74,15 +94,10 @@ func TestStore_loadAll(test *testing.T) { func TestStore_load(test *testing.T) { s := &Store{ - dir: "zero", - data: map[string]interface{}{}, - parseFile: func(file string, val interface{}) error { - return nil - }, - listFiles: func(dirname string) ([]string, error) { - test.Fatalf("unexpected call to listFiles(%s)", dirname) - return []string{}, nil - }, + dir: "zero", + data: map[string]interface{}{}, + parseFile: func(file string, val interface{}) error { return nil }, + listFiles: unexpectedListFiles(test), fileExists: func(path string) (bool, error) { expected := "zero/one.json" if path != expected { @@ -93,31 +108,18 @@ func TestStore_load(test *testing.T) { } s.load("one") - s.fileExists = func(path string) (bool, error) { - return false, nil - } - s.parseFile = func(file string, val interface{}) error { - test.Fatalf("unexpected call to parseFile(%s)", file) - return nil - } - s.listFiles = func(dirname string) ([]string, error) { - return []string{}, nil - } + s.fileExists = func(path string) (bool, error) { return false, nil } + s.parseFile = unexpectedParseFile(test) + s.listFiles = func(dirname string) ([]string, error) { return []string{}, nil } s.load("one") } func TestStore_Get(test *testing.T) { s := &Store{ - dir: "zero", - data: map[string]interface{}{}, - parseFile: func(file string, val interface{}) error { - test.Fatalf("unexpected call to parseFile(%s)", file) - return nil - }, - listFiles: func(dirname string) ([]string, error) { - test.Fatalf("unexpected call to listFiles(%s)", dirname) - return []string{}, nil - }, + dir: "zero", + data: map[string]interface{}{}, + parseFile: unexpectedParseFile(test), + listFiles: unexpectedListFiles(test), fileExists: func(path string) (bool, error) { test.Fatalf("unexpected call to fileExists(%s)", path) return true, nil @@ -156,11 +158,14 @@ func TestStore_Get(test *testing.T) { errorUnexpected(test, "four", val) // key is missing, file is missing, hint is missing, loaded from all + listFilesCalled := false + s.listFiles = func(string) ([]string, error) { + listFilesCalled = true + return []string{}, nil + } + s.fileExists = func(string) (bool, error) { + return false, nil + } val, ok = s.Get("four") - errorIf(test, !ok, "key not found") - errorUnexpected(test, "five", val) - - // hint is wrong - - // missing from everywhere + errorIf(test, !listFilesCalled, "listFiles wasn't called") } From 269ae7949c6e7f91a7fe250e8863ba9136813de1 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Wed, 27 Nov 2019 14:53:24 +0100 Subject: [PATCH 19/38] fix tests --- go.mod | 1 + go.sum | 51 ++------------------ pkg/config/config.go | 64 +++++++++++++++---------- pkg/config/config_test.go | 74 ++++++++++++++--------------- pkg/deployments/deployments.go | 16 +++---- pkg/deployments/deployments_test.go | 73 ++++++++++++++-------------- pkg/volumes/converter.go | 4 +- pkg/volumes/converter_test.go | 20 ++++---- pkg/volumes/volumes.go | 6 +-- pkg/volumes/volumes_test.go | 20 ++++---- 10 files changed, 149 insertions(+), 180 deletions(-) diff --git a/go.mod b/go.mod index 28210ed..d766678 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ require ( github.com/fatih/structs v1.1.0 // indirect github.com/gogo/protobuf v1.2.1 // indirect github.com/json-iterator/go v1.1.7 // indirect + github.com/mitchellh/mapstructure v1.1.2 github.com/modern-go/reflect2 v1.0.1 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/spf13/pflag v1.0.3 // indirect diff --git a/go.sum b/go.sum index f725407..7831081 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -23,11 +22,8 @@ github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754 h1:Qd6d github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754/go.mod h1:rTr8X4qZPRmQKsyAjhECPi+zPnmlcmv5W9s1F11oBSo= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= -github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -35,7 +31,6 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v0.1.1 h1:qXBXPDdNncunGs7XeEpsJt8wCjYBygluzfdLO0G5baE= github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= @@ -46,7 +41,6 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -56,7 +50,6 @@ github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= @@ -65,15 +58,11 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= -github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -82,6 +71,7 @@ github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +<<<<<<< HEAD github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -90,10 +80,10 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +======= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.2.2 h1:dxe5oCinTXiTIcfgmZecdCzPmAJKd46KsCWc35r0TV4= -github.com/mitchellh/mapstructure v1.2.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +>>>>>>> fix tests github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -107,10 +97,7 @@ github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwd github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -119,7 +106,6 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0 h1:miYCvYqFXtl/J9FIy8eNpBfYthAEFg+Ys0XyUVEcDsc= @@ -128,11 +114,9 @@ github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1: github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0 h1:ElTg5tNp4DqfV7UQjDqv2+RJlNzsDtvNAWccbItceIE= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= @@ -142,7 +126,6 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -155,17 +138,13 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -175,7 +154,6 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 h1:ulvT7fqt0yHWzpJwI57MezWnYDVpCAYBVuYst/L+fAY= @@ -186,10 +164,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -197,7 +173,6 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= @@ -208,7 +183,6 @@ golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -218,20 +192,14 @@ golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gomodules.xyz/jsonpatch/v2 v2.0.1 h1:xyiBuvkD2g5n7cYzx6u2sxQvsAy4QJsZFCzGVdzOXZ0= -gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -240,39 +208,26 @@ k8s.io/api v0.0.0-20190202010724-74b699b93c15 h1:AoUGjnJ3PJMFz+Rkp4lx3X+6mPUnY1M k8s.io/api v0.0.0-20190202010724-74b699b93c15/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.0.0-20190313235455-40a48860b5ab h1:DG9A67baNpoeweOy2spF1OWHhnVY5KR7/Ek/+U1lVZc= k8s.io/api v0.0.0-20190313235455-40a48860b5ab/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= -k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b h1:aBGgKJUM9Hk/3AE8WaZIApnTxG35kbuQba2w+SXqezo= -k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= -k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8 h1:q1Qvjzs/iEdXF6A1a8H3AKVFDzJNcJn3nXMs6R6qFtA= -k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c h1:02KEBFny6M5VWKj6Y8Ns27epjefTqLJXD4fvqP5tGFg= k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1 h1:IS7K02iBkQXpCeieSiyJjGoLSdVOv2DbPaWHJ+ZtgKg= k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= -k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d h1:Jmdtdt1ZnoGfWWIIik61Z7nKYgO3J+swQJtPYsP9wHA= -k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/client-go v11.0.0+incompatible h1:LBbX2+lOwY9flffWlJM7f1Ct8V2SRNiMRDFeiwnJo9o= k8s.io/client-go v11.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= -k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible h1:U5Bt+dab9K8qaUmXINrkXO135kA11/i5Kg1RUydgaMQ= -k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.2.0 h1:0ElL0OHzF3N+OhoJTL0uca20SxtYt4X4+bzHeqrB83c= k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kubernetes v1.14.0 h1:6T2iAEoOYQnzQb3WvPlUkcczEEXZ7+YPlAO8olwujRw= k8s.io/kubernetes v1.14.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 h1:p0Ai3qVtkbCG/Af26dBmU0E1W58NID3hSSh7cMyylpM= k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= sigs.k8s.io/controller-runtime v0.1.10 h1:amLOmcekVdnsD1uIpmgRqfTbQWJ2qxvQkcdeFhcotn4= sigs.k8s.io/controller-runtime v0.1.10/go.mod h1:HFAYoOh6XMV+jKF1UjFwrknPbowfyHEHHRdJMf2jMX8= -sigs.k8s.io/controller-runtime v0.2.2 h1:JT/vJJhUjjL9NZNwnm8AXmqCBUXSCFKmTaNjwDi28N0= -sigs.k8s.io/controller-runtime v0.2.2/go.mod h1:9dyohw3ZtoXQuV1e766PHUn+cmrRCIcBh6XIMFNMZ+I= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/testing_frameworks v0.1.1/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9qL6ht1zEr/U= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/pkg/config/config.go b/pkg/config/config.go index 754a2f2..84bc7c1 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -8,19 +8,21 @@ import ( "os" "path" "sync" + + "github.com/mitchellh/mapstructure" ) // Store holds config data type Store struct { // If you care about sanity, never write here, just read - data map[string]interface{} - dir string - hints map[string]string + Data map[string]interface{} + Dir string + Hints map[string]string sync.Mutex - listFiles func(string) ([]string, error) - parseFile func(string, interface{}) error - fileExists func(string) (bool, error) + ListFiles func(string) ([]string, error) + ParseFile func(string, interface{}) error + FileExists func(string) (bool, error) } func listFiles(dirname string) ([]string, error) { @@ -67,11 +69,11 @@ func NewStore(dir string, hints map[string]string) *Store { hints = map[string]string{} } return &Store{ - dir: dir, - hints: hints, - listFiles: listFiles, - parseFile: parseFile, - fileExists: fileExists, + Dir: dir, + Hints: hints, + ListFiles: listFiles, + ParseFile: parseFile, + FileExists: fileExists, } } @@ -79,7 +81,7 @@ func NewStore(dir string, hints map[string]string) *Store { // a new map, merge loaded data into the copy and swap `s.data` func (s *Store) loadPath(path string) error { value := map[string]interface{}{} - err := s.parseFile(path, value) + err := s.ParseFile(path, value) if err != nil { return err } @@ -87,7 +89,7 @@ func (s *Store) loadPath(path string) error { s.Lock() defer s.Unlock() for key, val := range value { - s.data[key] = val + s.Data[key] = val } return nil @@ -95,13 +97,13 @@ func (s *Store) loadPath(path string) error { // Walk `s.dir` and `s.loadPath` all the files func (s *Store) loadAll() error { - files, err := s.listFiles(s.dir) + files, err := s.ListFiles(s.Dir) if err != nil { return err } for _, file := range files { - err := s.loadPath(path.Join(s.dir, file)) + err := s.loadPath(path.Join(s.Dir, file)) if err != nil { return err } @@ -112,15 +114,15 @@ func (s *Store) loadAll() error { // Look for `domain`.json file, if not found try loading all files and // print a warning about hints func (s *Store) load(domain string) error { - path := path.Join(s.dir, fmt.Sprintf("%s.json", domain)) - exists, err := s.fileExists(path) + path := path.Join(s.Dir, fmt.Sprintf("%s.json", domain)) + exists, err := s.FileExists(path) if err != nil { return err } if !exists { log.Printf( "WARN: loading all configs, consider adding some hints" + - fmt.Sprintf("for %s in %s", domain, s.dir), + fmt.Sprintf("for %s in %s", domain, s.Dir), ) return s.loadAll() } @@ -129,19 +131,33 @@ func (s *Store) load(domain string) error { // Get returns value for given `key`. If not found in `s.data`, call // `s.load` function with `domain` from `s.hints` or `key` itself. -func (s *Store) Get(key string) (interface{}, bool) { - if val, ok := s.data[key]; ok { - return val, ok +func (s *Store) Get(key string) (interface{}, error) { + if val, ok := s.Data[key]; ok { + return val, nil } var domain string - if dom, ok := s.hints[key]; ok { + if dom, ok := s.Hints[key]; ok { domain = dom } else { domain = key } s.load(domain) - val, ok := s.data[key] - return val, ok + val, ok := s.Data[key] + if !ok { + return nil, fmt.Errorf("key not found: %s", key) + } + return val, nil +} + +// Load uses mapstructure.Decode to parse result of a Get into provided +// destination value +func (s *Store) Load(key string, dst interface{}) error { + val, err := s.Get(key) + if err != nil { + return err + } + mapstructure.Decode(val, dst) + return nil } diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 9f22766..39c2367 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -39,8 +39,8 @@ func unexpectedfileExists(test *testing.T) func(path string) (bool, error) { func TestStore_loadPath(test *testing.T) { key := "test key" s := &Store{ - data: map[string]interface{}{}, - parseFile: func(file string, val interface{}) error { + Data: map[string]interface{}{}, + ParseFile: func(file string, val interface{}) error { v, ok := val.(map[string]interface{}) if !ok { panic("assert failed") @@ -50,10 +50,10 @@ func TestStore_loadPath(test *testing.T) { }, } expected := "old value" - s.data[key] = expected + s.Data[key] = expected s.loadPath("new value") - if actual, ok := s.data[key]; ok { + if actual, ok := s.Data[key]; ok { if actual != "new value" { test.Fatalf("%+v was expected, got %+v", expected, actual) } @@ -64,9 +64,9 @@ func TestStore_loadPath(test *testing.T) { func TestStore_loadAll(test *testing.T) { s := &Store{ - dir: "zero", - data: map[string]interface{}{}, - parseFile: func(file string, val interface{}) error { + Dir: "zero", + Data: map[string]interface{}{}, + ParseFile: func(file string, val interface{}) error { fmt.Printf("parse file called: %s\n", file) v, ok := val.(map[string]interface{}) if !ok { @@ -75,14 +75,14 @@ func TestStore_loadAll(test *testing.T) { v[file] = "loaded" return nil }, - listFiles: func(dirname string) ([]string, error) { + ListFiles: func(dirname string) ([]string, error) { return []string{"one", "two"}, nil }, } s.loadAll() for _, key := range []string{"zero/one", "zero/two"} { - if actual, ok := s.data[key]; ok { + if actual, ok := s.Data[key]; ok { if actual != "loaded" { test.Fatalf("%s wasn't loaded correctly", key) } @@ -94,11 +94,11 @@ func TestStore_loadAll(test *testing.T) { func TestStore_load(test *testing.T) { s := &Store{ - dir: "zero", - data: map[string]interface{}{}, - parseFile: func(file string, val interface{}) error { return nil }, - listFiles: unexpectedListFiles(test), - fileExists: func(path string) (bool, error) { + Dir: "zero", + Data: map[string]interface{}{}, + ParseFile: func(file string, val interface{}) error { return nil }, + ListFiles: unexpectedListFiles(test), + FileExists: func(path string) (bool, error) { expected := "zero/one.json" if path != expected { test.Fatalf("expected path=%s, got path=%s", expected, path) @@ -108,64 +108,64 @@ func TestStore_load(test *testing.T) { } s.load("one") - s.fileExists = func(path string) (bool, error) { return false, nil } - s.parseFile = unexpectedParseFile(test) - s.listFiles = func(dirname string) ([]string, error) { return []string{}, nil } + s.FileExists = func(path string) (bool, error) { return false, nil } + s.ParseFile = unexpectedParseFile(test) + s.ListFiles = func(dirname string) ([]string, error) { return []string{}, nil } s.load("one") } func TestStore_Get(test *testing.T) { s := &Store{ - dir: "zero", - data: map[string]interface{}{}, - parseFile: unexpectedParseFile(test), - listFiles: unexpectedListFiles(test), - fileExists: func(path string) (bool, error) { + Dir: "zero", + Data: map[string]interface{}{}, + ParseFile: unexpectedParseFile(test), + ListFiles: unexpectedListFiles(test), + FileExists: func(path string) (bool, error) { test.Fatalf("unexpected call to fileExists(%s)", path) return true, nil }, } - s.data["one"] = "two" - val, ok := s.Get("one") - errorIf(test, !ok, "key not found") + s.Data["one"] = "two" + val, err := s.Get("one") + errorIf(test, err != nil, "key not found") errorUnexpected(test, "two", val) // key is missing, file with same name exists - s.fileExists = func(path string) (bool, error) { return true, nil } - s.parseFile = func(file string, val interface{}) error { + s.FileExists = func(path string) (bool, error) { return true, nil } + s.ParseFile = func(file string, val interface{}) error { v := val.(map[string]interface{}) v["two"] = "three" return nil } - val, ok = s.Get("two") - errorIf(test, !ok, "key not found") + val, err = s.Get("two") + errorIf(test, err != nil, "key not found") errorUnexpected(test, "three", val) // key is missing, file corresponding to a hint exists - s.hints = map[string]string{"three": "four"} - s.fileExists = func(path string) (bool, error) { + s.Hints = map[string]string{"three": "four"} + s.FileExists = func(path string) (bool, error) { errorUnexpected(test, "zero/four.json", path) return true, nil } - s.parseFile = func(file string, val interface{}) error { + s.ParseFile = func(file string, val interface{}) error { errorUnexpected(test, "zero/four.json", file) v := val.(map[string]interface{}) v["three"] = "four" return nil } - val, ok = s.Get("three") - errorIf(test, !ok, "key not found") + val, err = s.Get("three") + errorIf(test, err != nil, "key not found") errorUnexpected(test, "four", val) // key is missing, file is missing, hint is missing, loaded from all listFilesCalled := false - s.listFiles = func(string) ([]string, error) { + s.ListFiles = func(string) ([]string, error) { listFilesCalled = true return []string{}, nil } - s.fileExists = func(string) (bool, error) { + s.FileExists = func(string) (bool, error) { return false, nil } - val, ok = s.Get("four") + val, _ = s.Get("four") errorIf(test, !listFilesCalled, "listFiles wasn't called") } diff --git a/pkg/deployments/deployments.go b/pkg/deployments/deployments.go index e476b07..c2b9bb2 100644 --- a/pkg/deployments/deployments.go +++ b/pkg/deployments/deployments.go @@ -18,7 +18,7 @@ import ( "fmt" "path" - "github.com/Yelp/paasta-tools-go/pkg/configstore" + "github.com/Yelp/paasta-tools-go/pkg/config" ) // V2DeploymentGroup ... @@ -55,17 +55,17 @@ type ImageProvider interface { type DefaultImageProvider struct { Service string - ServiceConfig *configstore.Store - PaastaConfig *configstore.Store + ServiceConfig *config.Store + PaastaConfig *config.Store } // NewDefaultImageProviderForService ... func NewDefaultImageProviderForService(service string) *DefaultImageProvider { - serviceConfig := configstore.NewStore( + serviceConfig := config.NewStore( path.Join("/nail/etc/services", service), map[string]string{"v2": "deployments"}, ) - paastaConfig := configstore.NewStore( + paastaConfig := config.NewStore( "/etc/paasta", map[string]string{"registry": "docker_registry"}, ) @@ -96,7 +96,7 @@ func (provider *DefaultImageProvider) DockerImageURLForDeployGroup(deploymentGro func (provider *DefaultImageProvider) getDockerRegistry() (string, error) { dockerRegistry := &DockerRegistry{Registry: ""} - err := provider.PaastaConfig.Load("docker_registry", &dockerRegistry) + err := provider.PaastaConfig.Load("registry", &dockerRegistry.Registry) return dockerRegistry.Registry, err } @@ -122,7 +122,7 @@ func (provider *DefaultImageProvider) getImageForDeployGroup(deploymentGroup str func DeploymentAnnotations( service, cluster, instance, deploymentGroup string, ) (map[string]string, error) { - configStore := configstore.NewStore( + configStore := config.NewStore( fmt.Sprintf("/nail/etc/services/%s", service), map[string]string{"v2": "deployments"}, ) @@ -136,7 +136,7 @@ func DeploymentAnnotations( return deploymentAnnotationsForControlGroup(deployments, controlGroup) } -func deploymentsFromConfig(cr *configstore.Store) (*Deployments, error) { +func deploymentsFromConfig(cr *config.Store) (*Deployments, error) { deployments := &Deployments{} err := cr.Load("v2", deployments) return deployments, err diff --git a/pkg/deployments/deployments_test.go b/pkg/deployments/deployments_test.go index bbc4e49..5eb0623 100644 --- a/pkg/deployments/deployments_test.go +++ b/pkg/deployments/deployments_test.go @@ -2,10 +2,9 @@ package deployments import ( "fmt" - "sync" "testing" - "github.com/Yelp/paasta-tools-go/pkg/configstore" + "github.com/Yelp/paasta-tools-go/pkg/config" ) const ( @@ -13,28 +12,30 @@ const ( ) func TestDefaultProviderGetDeployment(test *testing.T) { - paastaConfigData := &sync.Map{} - paastaConfigData.Store("docker_registry", map[string]interface{}{ - "docker_registry": "fakeregistry.yelp.com", - }) - - serviceConfigData := &sync.Map{} - serviceConfigData.Store("v2", map[string]interface{}{ - "deployments": map[string]interface{}{ - "dev.every": map[string]interface{}{ - "docker_image": "busybox:latest", - "git_sha": "03d6f783c99695af0e716588abb9ba83ac957be2", + imageProvider := DefaultImageProvider{ + PaastaConfig: &config.Store{ + Data: map[string]interface{}{ + "docker_registry": map[string]interface{}{ + "registry": "fakeregistry.yelp.com", + }, }, - "test.every": map[string]interface{}{ - "docker_image": "ubuntu:latest", - "git_sha": "f3d6f783c99695af0e716588abb9ba83ac957be3", + }, + ServiceConfig: &config.Store{ + Data: map[string]interface{}{ + "v2": map[string]interface{}{ + "deployments": map[string]interface{}{ + "dev.every": map[string]interface{}{ + "docker_image": "busybox:latest", + "git_sha": "03d6f783c99695af0e716588abb9ba83ac957be2", + }, + "test.every": map[string]interface{}{ + "docker_image": "ubuntu:latest", + "git_sha": "f3d6f783c99695af0e716588abb9ba83ac957be3", + }, + }, + }, }, }, - }) - - imageProvider := DefaultImageProvider{ - PaastaConfig: &configstore.Store{Data: paastaConfigData}, - ServiceConfig: &configstore.Store{Data: serviceConfigData}, } testcases := map[string]string{ "dev.every": "busybox:latest", @@ -105,24 +106,22 @@ func TestDeploymentAnnotationsForControlGroup(test *testing.T) { } func TestDefaultGetRegistry(t *testing.T) { - paastaConfigData := &sync.Map{} - paastaConfigData.Store("docker_registry", map[string]interface{}{ - "docker_registry": "fakeregistry.yelp.com", - }) - - serviceConfigData := &sync.Map{} - serviceConfigData.Store("v2", map[string]interface{}{ - "deployments": map[string]interface{}{}, - }) - imageProvider := DefaultImageProvider{ - PaastaConfig: &configstore.Store{Data: paastaConfigData}, - ServiceConfig: &configstore.Store{Data: serviceConfigData}, + PaastaConfig: &config.Store{ + Data: map[string]interface{}{ + "registry": "fakeregistry.yelp.com", + }, + }, + ServiceConfig: &config.Store{ + Data: map[string]interface{}{ + "v2": map[string]interface{}{ + "deployments": map[string]interface{}{}, + }, + }, + }, } - url, err := imageProvider.getDockerRegistry() - if err != nil { - t.Errorf("expected %s actual: error %+v", "fakeregistry.yelp.com", err) - } else if url != "fakeregistry.yelp.com" { + url, _ := imageProvider.getDockerRegistry() + if url != "fakeregistry.yelp.com" { t.Errorf("expected %s actual %+v", "fakeregistry.yelp.com", url) } } diff --git a/pkg/volumes/converter.go b/pkg/volumes/converter.go index c8df411..8eab513 100644 --- a/pkg/volumes/converter.go +++ b/pkg/volumes/converter.go @@ -5,7 +5,7 @@ import ( "log" "strings" - "github.com/Yelp/paasta-tools-go/pkg/configstore" + "github.com/Yelp/paasta-tools-go/pkg/config" corev1 "k8s.io/api/core/v1" ) @@ -50,7 +50,7 @@ func formatMountName(hostPath string) string { } // GetDefaultPaastaKubernetesVolumes ... -func GetDefaultPaastaKubernetesVolumes(configStore *configstore.Store) ([]corev1.VolumeMount, []corev1.Volume, error) { +func GetDefaultPaastaKubernetesVolumes(configStore *config.Store) ([]corev1.VolumeMount, []corev1.Volume, error) { pvolumes, err := DefaultVolumesFromReader(configStore) if err != nil { err = fmt.Errorf("Error finding default volumes: %s", err) diff --git a/pkg/volumes/converter_test.go b/pkg/volumes/converter_test.go index f0fb20c..7b99607 100644 --- a/pkg/volumes/converter_test.go +++ b/pkg/volumes/converter_test.go @@ -2,10 +2,9 @@ package volumes import ( "reflect" - "sync" "testing" - "github.com/Yelp/paasta-tools-go/pkg/configstore" + "github.com/Yelp/paasta-tools-go/pkg/config" corev1 "k8s.io/api/core/v1" ) @@ -73,15 +72,16 @@ func TestFormatMountName(t *testing.T) { } func TestGetDefaultPaastaKubernetesVolumes(t *testing.T) { - fakeVolumeConfig := &sync.Map{} - fakeVolumeConfig.Store("volumes", []map[string]interface{}{ - map[string]interface{}{ - "hostPath": "/foo", - "containerPath": "/bar", - "mode": "RO", + fakeVolumeConfig := map[string]interface{}{ + "volumes": []map[string]interface{}{ + map[string]interface{}{ + "hostPath": "/foo", + "containerPath": "/bar", + "mode": "RO", + }, }, - }) - reader := &configstore.Store{Data: fakeVolumeConfig} + } + reader := &config.Store{Data: fakeVolumeConfig} volumeMounts, volumes, err := GetDefaultPaastaKubernetesVolumes(reader) if err != nil { t.Errorf("Error %s", err) diff --git a/pkg/volumes/volumes.go b/pkg/volumes/volumes.go index 166ce9d..0fafbae 100644 --- a/pkg/volumes/volumes.go +++ b/pkg/volumes/volumes.go @@ -1,7 +1,7 @@ package volumes import ( - "github.com/Yelp/paasta-tools-go/pkg/configstore" + "github.com/Yelp/paasta-tools-go/pkg/config" ) type VolumeConfig struct { @@ -14,9 +14,7 @@ type Volume struct { Mode string `json:"mode" mapstructure:"mode"` } -func DefaultVolumesFromReader( - configStore *configstore.Store, -) (volumes []Volume, err error) { +func DefaultVolumesFromReader(configStore *config.Store) (volumes []Volume, err error) { volumeConfig := &VolumeConfig{Volumes: []Volume{}} err = configStore.Load("volumes", &volumeConfig.Volumes) return volumeConfig.Volumes, err diff --git a/pkg/volumes/volumes_test.go b/pkg/volumes/volumes_test.go index 40149b9..213dd15 100644 --- a/pkg/volumes/volumes_test.go +++ b/pkg/volumes/volumes_test.go @@ -2,22 +2,22 @@ package volumes import ( "reflect" - "sync" "testing" - "github.com/Yelp/paasta-tools-go/pkg/configstore" + "github.com/Yelp/paasta-tools-go/pkg/config" ) func TestDefaultVolumesFromReader(test *testing.T) { - fakeVolumeConfig := &sync.Map{} - fakeVolumeConfig.Store("volumes", []map[string]interface{}{ - map[string]interface{}{ - "hostPath": "/foo", - "containerPath": "/bar", - "mode": "RO", + fakeVolumeConfig := map[string]interface{}{ + "volumes": []map[string]interface{}{ + map[string]interface{}{ + "hostPath": "/foo", + "containerPath": "/bar", + "mode": "RO", + }, }, - }) - reader := &configstore.Store{Data: fakeVolumeConfig} + } + reader := &config.Store{Data: fakeVolumeConfig} actual, err := DefaultVolumesFromReader(reader) if err != nil { test.Errorf("failed to read config") From 3af160f205ba1cd05914ced5903dcef3959acc44 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Fri, 29 Nov 2019 22:26:47 +0100 Subject: [PATCH 20/38] bring back old pkg/config, move new stuff to pkg/config_store --- pkg/config/config.go | 155 +++--------------------- pkg/config/config_test.go | 181 +++++----------------------- pkg/config_store/store.go | 167 +++++++++++++++++++++++++ pkg/config_store/store_test.go | 171 ++++++++++++++++++++++++++ pkg/deployments/deployments.go | 14 +-- pkg/deployments/deployments_test.go | 10 +- pkg/volumes/converter.go | 4 +- pkg/volumes/converter_test.go | 4 +- pkg/volumes/volumes.go | 6 +- pkg/volumes/volumes_test.go | 4 +- 10 files changed, 408 insertions(+), 308 deletions(-) create mode 100644 pkg/config_store/store.go create mode 100644 pkg/config_store/store_test.go diff --git a/pkg/config/config.go b/pkg/config/config.go index 84bc7c1..3dd0472 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -2,162 +2,39 @@ package config import ( "encoding/json" - "fmt" + "io" "io/ioutil" - "log" "os" "path" - "sync" - - "github.com/mitchellh/mapstructure" ) -// Store holds config data -type Store struct { - // If you care about sanity, never write here, just read - Data map[string]interface{} - Dir string - Hints map[string]string - sync.Mutex - - ListFiles func(string) ([]string, error) - ParseFile func(string, interface{}) error - FileExists func(string) (bool, error) -} - -func listFiles(dirname string) ([]string, error) { - files, err := ioutil.ReadDir(dirname) - if err != nil { - return nil, err - } - - ret := make([]string, len(files)) - for idx, file := range files { - ret[idx] = file.Name() - } - - return ret, nil -} - -func parseFile(path string, value interface{}) error { - reader, err := os.Open(path) - defer reader.Close() - if err != nil { - return err - } - - return json.NewDecoder(reader).Decode(value) -} - -func fileExists(path string) (bool, error) { - _, err := os.Stat(path) - if err != nil { - if os.IsNotExist(err) { - return false, nil - } - return false, err - } - return true, nil -} - -// NewStore creates a new config store -// `dir` is a directory from where data will be loaded -// `hints` is a dictionary to find which file to load for -// a given key -func NewStore(dir string, hints map[string]string) *Store { - if hints == nil { - hints = map[string]string{} - } - return &Store{ - Dir: dir, - Hints: hints, - ListFiles: listFiles, - ParseFile: parseFile, - FileExists: fileExists, - } +type ConfigReader interface { + Read(interface{}) error } -// Decode `path` contents using `json`, copy `s.data` into -// a new map, merge loaded data into the copy and swap `s.data` -func (s *Store) loadPath(path string) error { - value := map[string]interface{}{} - err := s.ParseFile(path, value) - if err != nil { - return err - } - - s.Lock() - defer s.Unlock() - for key, val := range value { - s.Data[key] = val - } - - return nil -} - -// Walk `s.dir` and `s.loadPath` all the files -func (s *Store) loadAll() error { - files, err := s.ListFiles(s.Dir) - if err != nil { - return err - } - - for _, file := range files { - err := s.loadPath(path.Join(s.Dir, file)) - if err != nil { - return err - } - } - return nil +type ConfigFileReader struct { + Basedir string + Filename string } -// Look for `domain`.json file, if not found try loading all files and -// print a warning about hints -func (s *Store) load(domain string) error { - path := path.Join(s.Dir, fmt.Sprintf("%s.json", domain)) - exists, err := s.FileExists(path) +func ParseContent(reader io.Reader, content interface{}) error { + buf, err := ioutil.ReadAll(reader) if err != nil { return err } - if !exists { - log.Printf( - "WARN: loading all configs, consider adding some hints" + - fmt.Sprintf("for %s in %s", domain, s.Dir), - ) - return s.loadAll() - } - return s.loadPath(path) + err = json.Unmarshal(buf, content) + return err } -// Get returns value for given `key`. If not found in `s.data`, call -// `s.load` function with `domain` from `s.hints` or `key` itself. -func (s *Store) Get(key string) (interface{}, error) { - if val, ok := s.Data[key]; ok { - return val, nil - } - - var domain string - if dom, ok := s.Hints[key]; ok { - domain = dom - } else { - domain = key - } - s.load(domain) - - val, ok := s.Data[key] - if !ok { - return nil, fmt.Errorf("key not found: %s", key) - } - return val, nil +func (configReader ConfigFileReader) FileNameForConfig() string { + return path.Join(configReader.Basedir, configReader.Filename) } -// Load uses mapstructure.Decode to parse result of a Get into provided -// destination value -func (s *Store) Load(key string, dst interface{}) error { - val, err := s.Get(key) +func (configReader ConfigFileReader) Read(content interface{}) error { + reader, err := os.Open(configReader.FileNameForConfig()) + defer reader.Close() if err != nil { return err } - mapstructure.Decode(val, dst) - return nil + return ParseContent(reader, content) } diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 39c2367..380bf6c 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -1,171 +1,54 @@ package config import ( - "fmt" + "bytes" + "encoding/json" + "io" + "reflect" "testing" ) -func errorIf(test *testing.T, pred bool, format string, args ...interface{}) { - if pred { - test.Fatalf(format, args...) - } -} - -func errorUnexpected(test *testing.T, expected, actual interface{}) { - errorIf(test, expected != actual, "expected %+v, actual %+v", expected, actual) +type FakeConfig struct { + Foo string } -func unexpectedParseFile(test *testing.T) func(string, interface{}) error { - return func(file string, val interface{}) error { - test.Fatalf("unexpected call to parseFile(%s, _)", file) - return nil - } +type fakereader struct { + reader io.Reader + data *FakeConfig } -func unexpectedListFiles(test *testing.T) func(string) ([]string, error) { - return func(dirname string) ([]string, error) { - test.Fatalf("unexpected call to listFiles(%s)", dirname) - return []string{}, nil - } +func (fakereader fakereader) Read(bytes []byte) (n int, err error) { + return fakereader.reader.Read(bytes) } -func unexpectedfileExists(test *testing.T) func(path string) (bool, error) { - return func(path string) (bool, error) { - test.Fatalf("unexpected call to fileExists(%s)", path) - return false, nil +func fakeDataReader(config *FakeConfig) fakereader { + content, _ := json.Marshal(*config) + return fakereader{ + data: config, + reader: bytes.NewReader(content), } } -func TestStore_loadPath(test *testing.T) { - key := "test key" - s := &Store{ - Data: map[string]interface{}{}, - ParseFile: func(file string, val interface{}) error { - v, ok := val.(map[string]interface{}) - if !ok { - panic("assert failed") - } - v[key] = file - return nil - }, - } - expected := "old value" - s.Data[key] = expected - s.loadPath("new value") - - if actual, ok := s.Data[key]; ok { - if actual != "new value" { - test.Fatalf("%+v was expected, got %+v", expected, actual) - } - } else { - test.Fatalf("key %+v not found", key) - } -} - -func TestStore_loadAll(test *testing.T) { - s := &Store{ - Dir: "zero", - Data: map[string]interface{}{}, - ParseFile: func(file string, val interface{}) error { - fmt.Printf("parse file called: %s\n", file) - v, ok := val.(map[string]interface{}) - if !ok { - panic("assert failed") - } - v[file] = "loaded" - return nil - }, - ListFiles: func(dirname string) ([]string, error) { - return []string{"one", "two"}, nil - }, - } - s.loadAll() - - for _, key := range []string{"zero/one", "zero/two"} { - if actual, ok := s.Data[key]; ok { - if actual != "loaded" { - test.Fatalf("%s wasn't loaded correctly", key) - } - } else { - test.Fatalf("key %+v wasn't loaded", key) - } +func TestParseContent(test *testing.T) { + fakeData := &FakeConfig{} + reader := fakeDataReader(fakeData) + err := ParseContent(reader, fakeData) + if err != nil { + test.Errorf("failed to decode content") } -} - -func TestStore_load(test *testing.T) { - s := &Store{ - Dir: "zero", - Data: map[string]interface{}{}, - ParseFile: func(file string, val interface{}) error { return nil }, - ListFiles: unexpectedListFiles(test), - FileExists: func(path string) (bool, error) { - expected := "zero/one.json" - if path != expected { - test.Fatalf("expected path=%s, got path=%s", expected, path) - } - return true, nil - }, + if !reflect.DeepEqual(reader.data, fakeData) { + test.Errorf("deserialized content was incorrect, got: %s, want: %s.", reader.data, fakeData) } - s.load("one") - - s.FileExists = func(path string) (bool, error) { return false, nil } - s.ParseFile = unexpectedParseFile(test) - s.ListFiles = func(dirname string) ([]string, error) { return []string{}, nil } - s.load("one") } -func TestStore_Get(test *testing.T) { - s := &Store{ - Dir: "zero", - Data: map[string]interface{}{}, - ParseFile: unexpectedParseFile(test), - ListFiles: unexpectedListFiles(test), - FileExists: func(path string) (bool, error) { - test.Fatalf("unexpected call to fileExists(%s)", path) - return true, nil - }, - } - s.Data["one"] = "two" - val, err := s.Get("one") - errorIf(test, err != nil, "key not found") - errorUnexpected(test, "two", val) - - // key is missing, file with same name exists - s.FileExists = func(path string) (bool, error) { return true, nil } - s.ParseFile = func(file string, val interface{}) error { - v := val.(map[string]interface{}) - v["two"] = "three" - return nil - } - val, err = s.Get("two") - errorIf(test, err != nil, "key not found") - errorUnexpected(test, "three", val) - - // key is missing, file corresponding to a hint exists - s.Hints = map[string]string{"three": "four"} - s.FileExists = func(path string) (bool, error) { - errorUnexpected(test, "zero/four.json", path) - return true, nil - } - s.ParseFile = func(file string, val interface{}) error { - errorUnexpected(test, "zero/four.json", file) - v := val.(map[string]interface{}) - v["three"] = "four" - return nil - } - val, err = s.Get("three") - errorIf(test, err != nil, "key not found") - errorUnexpected(test, "four", val) - - // key is missing, file is missing, hint is missing, loaded from all - listFilesCalled := false - s.ListFiles = func(string) ([]string, error) { - listFilesCalled = true - return []string{}, nil +func TestFileNameForConfig(test *testing.T) { + reader := ConfigFileReader{ + Basedir: "/etc/paasta", + Filename: "volumes.json", } - s.FileExists = func(string) (bool, error) { - return false, nil + expected := "/etc/paasta/volumes.json" + actual := reader.FileNameForConfig() + if actual != expected { + test.Errorf("filename incorrect incorrect, got: %s, want: %s.", actual, expected) } - val, _ = s.Get("four") - errorIf(test, !listFilesCalled, "listFiles wasn't called") } diff --git a/pkg/config_store/store.go b/pkg/config_store/store.go new file mode 100644 index 0000000..bdf5545 --- /dev/null +++ b/pkg/config_store/store.go @@ -0,0 +1,167 @@ +package config_store + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "log" + "os" + "path" + "sync" + + "github.com/mitchellh/mapstructure" +) + +// Store holds config data +type Store struct { + // If you care about sanity, never write here, just read + Data map[string]interface{} + Dir string + Hints map[string]string + sync.Mutex + + ListFiles func(string) ([]string, error) + ParseFile func(string, interface{}) error + FileExists func(string) (bool, error) +} + +func listFiles(dirname string) ([]string, error) { + files, err := ioutil.ReadDir(dirname) + if err != nil { + return nil, err + } + + ret := make([]string, len(files)) + for idx, file := range files { + ret[idx] = file.Name() + } + + return ret, nil +} + +func parseFile(path string, value interface{}) error { + reader, err := os.Open(path) + defer reader.Close() + if err != nil { + return err + } + + return json.NewDecoder(reader).Decode(value) +} + +func fileExists(path string) (bool, error) { + _, err := os.Stat(path) + if err != nil { + if os.IsNotExist(err) { + return false, nil + } + return false, err + } + return true, nil +} + +// NewStore creates a new config store +// `dir` is a directory from where data will be loaded +// `hints` is a dictionary to find which file to load for +// a given key +func NewStore(dir string, hints map[string]string) *Store { + if hints == nil { + hints = map[string]string{} + } + return &Store{ + Dir: dir, + Hints: hints, + ListFiles: listFiles, + ParseFile: parseFile, + FileExists: fileExists, + } +} + +// Decode `path` contents using `json`, copy `s.data` into +// a new map, merge loaded data into the copy and swap `s.data` +func (s *Store) loadPath(path string) error { + value := map[string]interface{}{} + err := s.ParseFile(path, value) + if err != nil { + return err + } + + s.Lock() + defer s.Unlock() + for key, val := range value { + s.Data[key] = val + } + + return nil +} + +// Walk `s.dir` and `s.loadPath` all the files +func (s *Store) loadAll() error { + files, err := s.ListFiles(s.Dir) + if err != nil { + return err + } + + for _, file := range files { + err := s.loadPath(path.Join(s.Dir, file)) + if err != nil { + return err + } + } + return nil +} + +// Look for `file`.json or `file`.yaml, if not found try loading all files and +// print a warning about hints +func (s *Store) load(file string) error { + extensions := []string{"json", "yaml"} + for _, ext := range extensions { + path := path.Join(s.Dir, fmt.Sprintf("%s.%s", file, ext)) + exists, err := s.FileExists(path) + if err != nil { + return err + } + if exists { + return s.loadPath(path) + } + } + + log.Printf( + "WARN: loading all configs, consider adding some hints" + + fmt.Sprintf("for %s in %s", file, s.Dir), + ) + return s.loadAll() +} + +// Get returns value for given `key`. If not found in `s.data`, call +// `s.load` function with `file` from `s.hints` or `key` itself. +func (s *Store) Get(key string) (interface{}, error) { + if val, ok := s.Data[key]; ok { + return val, nil + } + + var file string + if dom, ok := s.Hints[key]; ok { + file = dom + } else { + file = key + } + s.load(file) + + val, ok := s.Data[key] + if !ok { + return nil, fmt.Errorf("key not found: %s", key) + } + return val, nil +} + +// Load uses mapstructure.Decode to parse result of a Get into provided +// destination value +func (s *Store) Load(key string, dst interface{}) error { + val, err := s.Get(key) + if err != nil { + return err + } + mapstructure.Decode(val, dst) + return nil +} diff --git a/pkg/config_store/store_test.go b/pkg/config_store/store_test.go new file mode 100644 index 0000000..a93bf34 --- /dev/null +++ b/pkg/config_store/store_test.go @@ -0,0 +1,171 @@ +package config_store + +import ( + "fmt" + "testing" +) + +func errorIf(test *testing.T, pred bool, format string, args ...interface{}) { + if pred { + test.Fatalf(format, args...) + } +} + +func errorUnexpected(test *testing.T, expected, actual interface{}) { + errorIf(test, expected != actual, "expected %+v, actual %+v", expected, actual) +} + +func unexpectedParseFile(test *testing.T) func(string, interface{}) error { + return func(file string, val interface{}) error { + test.Fatalf("unexpected call to parseFile(%s, _)", file) + return nil + } +} + +func unexpectedListFiles(test *testing.T) func(string) ([]string, error) { + return func(dirname string) ([]string, error) { + test.Fatalf("unexpected call to listFiles(%s)", dirname) + return []string{}, nil + } +} + +func unexpectedfileExists(test *testing.T) func(path string) (bool, error) { + return func(path string) (bool, error) { + test.Fatalf("unexpected call to fileExists(%s)", path) + return false, nil + } +} + +func TestStore_loadPath(test *testing.T) { + key := "test key" + s := &Store{ + Data: map[string]interface{}{}, + ParseFile: func(file string, val interface{}) error { + v, ok := val.(map[string]interface{}) + if !ok { + panic("assert failed") + } + v[key] = file + return nil + }, + } + expected := "old value" + s.Data[key] = expected + s.loadPath("new value") + + if actual, ok := s.Data[key]; ok { + if actual != "new value" { + test.Fatalf("%+v was expected, got %+v", expected, actual) + } + } else { + test.Fatalf("key %+v not found", key) + } +} + +func TestStore_loadAll(test *testing.T) { + s := &Store{ + Dir: "zero", + Data: map[string]interface{}{}, + ParseFile: func(file string, val interface{}) error { + fmt.Printf("parse file called: %s\n", file) + v, ok := val.(map[string]interface{}) + if !ok { + panic("assert failed") + } + v[file] = "loaded" + return nil + }, + ListFiles: func(dirname string) ([]string, error) { + return []string{"one", "two"}, nil + }, + } + s.loadAll() + + for _, key := range []string{"zero/one", "zero/two"} { + if actual, ok := s.Data[key]; ok { + if actual != "loaded" { + test.Fatalf("%s wasn't loaded correctly", key) + } + } else { + test.Fatalf("key %+v wasn't loaded", key) + } + } +} + +func TestStore_load(test *testing.T) { + s := &Store{ + Dir: "zero", + Data: map[string]interface{}{}, + ParseFile: func(file string, val interface{}) error { return nil }, + ListFiles: unexpectedListFiles(test), + FileExists: func(path string) (bool, error) { + expected := "zero/one.json" + if path != expected { + test.Fatalf("expected path=%s, got path=%s", expected, path) + } + return true, nil + }, + } + s.load("one") + + s.FileExists = func(path string) (bool, error) { return false, nil } + s.ParseFile = unexpectedParseFile(test) + s.ListFiles = func(dirname string) ([]string, error) { return []string{}, nil } + s.load("one") +} + +func TestStore_Get(test *testing.T) { + s := &Store{ + Dir: "zero", + Data: map[string]interface{}{}, + ParseFile: unexpectedParseFile(test), + ListFiles: unexpectedListFiles(test), + FileExists: func(path string) (bool, error) { + test.Fatalf("unexpected call to fileExists(%s)", path) + return true, nil + }, + } + s.Data["one"] = "two" + val, err := s.Get("one") + errorIf(test, err != nil, "key not found") + errorUnexpected(test, "two", val) + + // key is missing, file with same name exists + s.FileExists = func(path string) (bool, error) { return true, nil } + s.ParseFile = func(file string, val interface{}) error { + v := val.(map[string]interface{}) + v["two"] = "three" + return nil + } + val, err = s.Get("two") + errorIf(test, err != nil, "key not found") + errorUnexpected(test, "three", val) + + // key is missing, file corresponding to a hint exists + s.Hints = map[string]string{"three": "four"} + s.FileExists = func(path string) (bool, error) { + errorUnexpected(test, "zero/four.json", path) + return true, nil + } + s.ParseFile = func(file string, val interface{}) error { + errorUnexpected(test, "zero/four.json", file) + v := val.(map[string]interface{}) + v["three"] = "four" + return nil + } + val, err = s.Get("three") + errorIf(test, err != nil, "key not found") + errorUnexpected(test, "four", val) + + // key is missing, file is missing, hint is missing, loaded from all + listFilesCalled := false + s.ListFiles = func(string) ([]string, error) { + listFilesCalled = true + return []string{}, nil + } + s.FileExists = func(string) (bool, error) { + return false, nil + } + val, _ = s.Get("four") + errorIf(test, !listFilesCalled, "listFiles wasn't called") +} diff --git a/pkg/deployments/deployments.go b/pkg/deployments/deployments.go index c2b9bb2..77b6e26 100644 --- a/pkg/deployments/deployments.go +++ b/pkg/deployments/deployments.go @@ -18,7 +18,7 @@ import ( "fmt" "path" - "github.com/Yelp/paasta-tools-go/pkg/config" + "github.com/Yelp/paasta-tools-go/pkg/config_store" ) // V2DeploymentGroup ... @@ -55,17 +55,17 @@ type ImageProvider interface { type DefaultImageProvider struct { Service string - ServiceConfig *config.Store - PaastaConfig *config.Store + ServiceConfig *config_store.Store + PaastaConfig *config_store.Store } // NewDefaultImageProviderForService ... func NewDefaultImageProviderForService(service string) *DefaultImageProvider { - serviceConfig := config.NewStore( + serviceConfig := config_store.NewStore( path.Join("/nail/etc/services", service), map[string]string{"v2": "deployments"}, ) - paastaConfig := config.NewStore( + paastaConfig := config_store.NewStore( "/etc/paasta", map[string]string{"registry": "docker_registry"}, ) @@ -122,7 +122,7 @@ func (provider *DefaultImageProvider) getImageForDeployGroup(deploymentGroup str func DeploymentAnnotations( service, cluster, instance, deploymentGroup string, ) (map[string]string, error) { - configStore := config.NewStore( + configStore := config_store.NewStore( fmt.Sprintf("/nail/etc/services/%s", service), map[string]string{"v2": "deployments"}, ) @@ -136,7 +136,7 @@ func DeploymentAnnotations( return deploymentAnnotationsForControlGroup(deployments, controlGroup) } -func deploymentsFromConfig(cr *config.Store) (*Deployments, error) { +func deploymentsFromConfig(cr *config_store.Store) (*Deployments, error) { deployments := &Deployments{} err := cr.Load("v2", deployments) return deployments, err diff --git a/pkg/deployments/deployments_test.go b/pkg/deployments/deployments_test.go index 5eb0623..62a38d2 100644 --- a/pkg/deployments/deployments_test.go +++ b/pkg/deployments/deployments_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/Yelp/paasta-tools-go/pkg/config" + "github.com/Yelp/paasta-tools-go/pkg/config_store" ) const ( @@ -13,14 +13,14 @@ const ( func TestDefaultProviderGetDeployment(test *testing.T) { imageProvider := DefaultImageProvider{ - PaastaConfig: &config.Store{ + PaastaConfig: &config_store.Store{ Data: map[string]interface{}{ "docker_registry": map[string]interface{}{ "registry": "fakeregistry.yelp.com", }, }, }, - ServiceConfig: &config.Store{ + ServiceConfig: &config_store.Store{ Data: map[string]interface{}{ "v2": map[string]interface{}{ "deployments": map[string]interface{}{ @@ -107,12 +107,12 @@ func TestDeploymentAnnotationsForControlGroup(test *testing.T) { func TestDefaultGetRegistry(t *testing.T) { imageProvider := DefaultImageProvider{ - PaastaConfig: &config.Store{ + PaastaConfig: &config_store.Store{ Data: map[string]interface{}{ "registry": "fakeregistry.yelp.com", }, }, - ServiceConfig: &config.Store{ + ServiceConfig: &config_store.Store{ Data: map[string]interface{}{ "v2": map[string]interface{}{ "deployments": map[string]interface{}{}, diff --git a/pkg/volumes/converter.go b/pkg/volumes/converter.go index 8eab513..02229d8 100644 --- a/pkg/volumes/converter.go +++ b/pkg/volumes/converter.go @@ -5,7 +5,7 @@ import ( "log" "strings" - "github.com/Yelp/paasta-tools-go/pkg/config" + "github.com/Yelp/paasta-tools-go/pkg/config_store" corev1 "k8s.io/api/core/v1" ) @@ -50,7 +50,7 @@ func formatMountName(hostPath string) string { } // GetDefaultPaastaKubernetesVolumes ... -func GetDefaultPaastaKubernetesVolumes(configStore *config.Store) ([]corev1.VolumeMount, []corev1.Volume, error) { +func GetDefaultPaastaKubernetesVolumes(configStore *config_store.Store) ([]corev1.VolumeMount, []corev1.Volume, error) { pvolumes, err := DefaultVolumesFromReader(configStore) if err != nil { err = fmt.Errorf("Error finding default volumes: %s", err) diff --git a/pkg/volumes/converter_test.go b/pkg/volumes/converter_test.go index 7b99607..9c0b8f6 100644 --- a/pkg/volumes/converter_test.go +++ b/pkg/volumes/converter_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/Yelp/paasta-tools-go/pkg/config" + "github.com/Yelp/paasta-tools-go/pkg/config_store" corev1 "k8s.io/api/core/v1" ) @@ -81,7 +81,7 @@ func TestGetDefaultPaastaKubernetesVolumes(t *testing.T) { }, }, } - reader := &config.Store{Data: fakeVolumeConfig} + reader := &config_store.Store{Data: fakeVolumeConfig} volumeMounts, volumes, err := GetDefaultPaastaKubernetesVolumes(reader) if err != nil { t.Errorf("Error %s", err) diff --git a/pkg/volumes/volumes.go b/pkg/volumes/volumes.go index 0fafbae..99675fe 100644 --- a/pkg/volumes/volumes.go +++ b/pkg/volumes/volumes.go @@ -1,7 +1,7 @@ package volumes import ( - "github.com/Yelp/paasta-tools-go/pkg/config" + "github.com/Yelp/paasta-tools-go/pkg/config_store" ) type VolumeConfig struct { @@ -14,7 +14,9 @@ type Volume struct { Mode string `json:"mode" mapstructure:"mode"` } -func DefaultVolumesFromReader(configStore *config.Store) (volumes []Volume, err error) { +func DefaultVolumesFromReader( + configStore *config_store.Store, +) (volumes []Volume, err error) { volumeConfig := &VolumeConfig{Volumes: []Volume{}} err = configStore.Load("volumes", &volumeConfig.Volumes) return volumeConfig.Volumes, err diff --git a/pkg/volumes/volumes_test.go b/pkg/volumes/volumes_test.go index 213dd15..1a84c7b 100644 --- a/pkg/volumes/volumes_test.go +++ b/pkg/volumes/volumes_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/Yelp/paasta-tools-go/pkg/config" + "github.com/Yelp/paasta-tools-go/pkg/config_store" ) func TestDefaultVolumesFromReader(test *testing.T) { @@ -17,7 +17,7 @@ func TestDefaultVolumesFromReader(test *testing.T) { }, }, } - reader := &config.Store{Data: fakeVolumeConfig} + reader := &config_store.Store{Data: fakeVolumeConfig} actual, err := DefaultVolumesFromReader(reader) if err != nil { test.Errorf("failed to read config") From 4a4f17bc2b633fd1d5a2e0cdcdc28e2ccaab4e12 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Wed, 4 Dec 2019 13:55:24 +0100 Subject: [PATCH 21/38] add paasta api client --- cmd/paasta-metastatus/main.go | 78 ++++ go.mod | 32 +- go.sum | 363 +++++++++++++++++- pkg/cli/options.go | 31 ++ pkg/config_store/store.go | 9 +- .../client/autoscaler/autoscaler_client.go | 18 +- .../get_autoscaler_count_parameters.go | 3 +- .../get_autoscaler_count_responses.go | 3 +- .../update_autoscaler_count_parameters.go | 3 +- .../update_autoscaler_count_responses.go | 3 +- .../marathon_dashboard_client.go | 14 +- .../marathon_dashboard_parameters.go | 3 +- .../marathon_dashboard_responses.go | 5 +- ...ete_service_autoscaler_pause_parameters.go | 3 +- ...lete_service_autoscaler_pause_responses.go | 3 +- ...get_service_autoscaler_pause_parameters.go | 3 +- .../get_service_autoscaler_pause_responses.go | 3 +- .../operations/metastatus_parameters.go | 3 +- .../client/operations/metastatus_responses.go | 5 +- .../client/operations/operations_client.go | 66 +--- .../operations/show_version_parameters.go | 3 +- .../operations/show_version_responses.go | 3 +- ...ate_service_autoscaler_pause_parameters.go | 3 +- ...date_service_autoscaler_pause_responses.go | 3 +- pkg/paasta_api/client/paasta_client.go | 25 +- .../client/resources/resources_client.go | 14 +- .../client/resources/resources_parameters.go | 3 +- .../client/resources/resources_responses.go | 5 +- .../service/delay_instance_parameters.go | 3 +- .../service/delay_instance_responses.go | 5 +- .../service/instance_set_state_parameters.go | 3 +- .../service/instance_set_state_responses.go | 3 +- .../service/list_instances_parameters.go | 3 +- .../service/list_instances_responses.go | 3 +- .../list_services_for_cluster_parameters.go | 3 +- .../list_services_for_cluster_responses.go | 3 +- .../client/service/service_client.go | 38 +- .../service/status_instance_parameters.go | 35 +- .../service/status_instance_responses.go | 5 +- .../service/task_instance_parameters.go | 3 +- .../client/service/task_instance_responses.go | 5 +- .../service/tasks_instance_parameters.go | 3 +- .../service/tasks_instance_responses.go | 5 +- pkg/paasta_api/models/adhoc_launch_history.go | 4 +- pkg/paasta_api/models/float_and_error.go | 4 +- pkg/paasta_api/models/instance_delay.go | 1 - .../models/instance_metadata_flink.go | 1 - pkg/paasta_api/models/instance_status.go | 65 +--- .../models/instance_status_adhoc.go | 4 +- .../models/instance_status_flink.go | 3 +- .../models/instance_status_kubernetes.go | 110 +----- .../models/instance_status_marathon.go | 29 +- pkg/paasta_api/models/instance_status_tron.go | 4 +- pkg/paasta_api/models/instance_task.go | 1 - pkg/paasta_api/models/instance_tasks.go | 3 +- pkg/paasta_api/models/integer_and_error.go | 4 +- pkg/paasta_api/models/kubernetes_pod.go | 43 +-- .../models/kubernetes_replica_set.go | 4 +- pkg/paasta_api/models/marathon_app_status.go | 4 +- .../models/marathon_autoscaling_info.go | 4 +- pkg/paasta_api/models/marathon_dashboard.go | 4 +- .../models/marathon_dashboard_cluster.go | 4 +- .../models/marathon_dashboard_item.go | 4 +- .../models/marathon_mesos_nonrunning_task.go | 4 +- .../models/marathon_mesos_running_task.go | 4 +- .../models/marathon_mesos_status.go | 4 +- pkg/paasta_api/models/marathon_task.go | 4 +- pkg/paasta_api/models/meta_status.go | 4 +- pkg/paasta_api/models/resource.go | 4 +- pkg/paasta_api/models/resource_item.go | 4 +- pkg/paasta_api/models/resource_value.go | 4 +- pkg/paasta_api/models/smartstack_backend.go | 4 +- pkg/paasta_api/models/smartstack_location.go | 4 +- pkg/paasta_api/models/smartstack_status.go | 4 +- pkg/paasta_api/models/task_tail_lines.go | 4 +- swagger.json | 284 +------------- 76 files changed, 685 insertions(+), 777 deletions(-) create mode 100644 cmd/paasta-metastatus/main.go create mode 100644 pkg/cli/options.go diff --git a/cmd/paasta-metastatus/main.go b/cmd/paasta-metastatus/main.go new file mode 100644 index 0000000..6063b01 --- /dev/null +++ b/cmd/paasta-metastatus/main.go @@ -0,0 +1,78 @@ +package main + +import ( + "fmt" + "os" + + flag "github.com/spf13/pflag" + + "github.com/Yelp/paasta-tools-go/pkg/cli" + "github.com/Yelp/paasta-tools-go/pkg/config_store" +) + +// PaastaMetastatusOptions ... +type PaastaMetastatusOptions struct { + cli.PaastaOptions + cli.CSIOptions + AutoscalingInfo bool + Groupings string +} + +// Setup ... +func (o *PaastaMetastatusOptions) Setup() { + (&o.PaastaOptions).Setup() + (&o.CSIOptions).Setup() + flag.BoolVar(&o.AutoscalingInfo, "autoscaling-info", false, "") + flag.StringVarP(&o.Groupings, "groupings", "g", "", "") +} + +func parseFlags(opts *PaastaMetastatusOptions) error { + opts.Setup() + flag.CommandLine.SortFlags = false + flag.Parse() + return nil +} + +func metastatus(opts *PaastaMetastatusOptions) error { + if opts.AutoscalingInfo { + if opts.Verbosity < 2 { + opts.Verbosity = 2 + } + } + sysStore := config_store.NewStore(opts.SysDir, nil) + apiEndpoints, err := sysStore.Get("api_endpoints") + if err != nil { + return err + } + + var clusters []interface{} + if opts.Cluster != "" { + clusters = []interface{}{opts.Cluster} + } else { + clusters, err := sysStore.Get("clusters") + if err != nil { + return err + } + } + + return nil +} + +func main() { + options := &PaastaMetastatusOptions{} + err := parseFlags(options) + if err != nil { + fmt.Println(err) + flag.PrintDefaults() + os.Exit(1) + } + if options.Help { + flag.PrintDefaults() + os.Exit(0) + } + err = metastatus(options) + if err != nil { + fmt.Println(err) + os.Exit(1) + } +} diff --git a/go.mod b/go.mod index d766678..0ef4476 100644 --- a/go.mod +++ b/go.mod @@ -1,23 +1,29 @@ module github.com/Yelp/paasta-tools-go require ( + cloud.google.com/go v0.38.0 // indirect + github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754 github.com/fatih/structs v1.1.0 // indirect - github.com/gogo/protobuf v1.2.1 // indirect - github.com/json-iterator/go v1.1.7 // indirect + github.com/go-logfmt/logfmt v0.4.0 // indirect + github.com/go-openapi/errors v0.19.2 + github.com/go-openapi/runtime v0.19.5 + github.com/go-openapi/strfmt v0.19.3 + github.com/go-openapi/swag v0.19.5 + github.com/go-openapi/validate v0.19.5 + github.com/go-swagger/go-swagger v0.21.0 // indirect github.com/mitchellh/mapstructure v1.1.2 - github.com/modern-go/reflect2 v1.0.1 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect - github.com/spf13/pflag v1.0.3 // indirect - github.com/stretchr/testify v1.3.0 - golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 // indirect - golang.org/x/text v0.3.0 // indirect - gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/yaml.v2 v2.2.2 // indirect - k8s.io/api v0.0.0-20190202010724-74b699b93c15 - k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c - k8s.io/klog v0.2.0 // indirect + github.com/pmezard/go-difflib v1.0.0 + github.com/prometheus/tsdb v0.7.1 // indirect + github.com/spf13/pflag v1.0.5 + github.com/stretchr/testify v1.4.0 + github.com/subosito/gotenv v1.2.0 + gopkg.in/yaml.v2 v2.2.7 + k8s.io/api v0.17.2 + k8s.io/apimachinery v0.17.2 + k8s.io/client-go v11.0.0+incompatible k8s.io/kubernetes v1.14.0 // indirect - sigs.k8s.io/yaml v1.1.0 // indirect + sigs.k8s.io/controller-runtime v0.5.2 ) go 1.13 diff --git a/go.sum b/go.sum index 7831081..5ff0e76 100644 --- a/go.sum +++ b/go.sum @@ -1,89 +1,259 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/appscode/jsonpatch v2.0.1+incompatible h1:Ksl+gGquV3TeYmiZPBsDNauiyloE7sg9OMUWKr5Ctmg= +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 h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/corbym/gocrest v1.0.3/go.mod h1:maVFL5lbdS2PgfOQgGRWDYTeunSWQeiEgoNdTABShCs= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754 h1:Qd6djMDE2KFeLwuKQ4B316XYt101DFoymbgoxFHeKCY= github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754/go.mod h1:rTr8X4qZPRmQKsyAjhECPi+zPnmlcmv5W9s1F11oBSo= +github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= +github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v0.1.1 h1:qXBXPDdNncunGs7XeEpsJt8wCjYBygluzfdLO0G5baE= github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= +github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= +github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= +github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= +github.com/go-openapi/analysis v0.19.5 h1:8b2ZgKfKIUTVQpTb77MoRDIMEIwvDVw40o3aOXdfYzI= +github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= +github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.19.2 h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY= +github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= +github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= +github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= +github.com/go-openapi/loads v0.19.3 h1:jwIoahqCmaA5OBoc/B+1+Mu2L0Gr8xYQnbeyQEo/7b0= +github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= +github.com/go-openapi/loads v0.19.4 h1:5I4CCSqoWzT+82bBkNIvmLc0UOsoKKQ4Fz+3VxOB7SY= +github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= +github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= +github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= +github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= +github.com/go-openapi/runtime v0.19.5 h1:h4Zk7oTfB3ZYM2oMNliQvL+3BrDstTIX8lqP7yaYCuI= +github.com/go-openapi/runtime v0.19.5/go.mod h1:WIH6IYPXOrtgTClTV8xzdrD20jBlrK25D0aQbdSlqp8= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= +github.com/go-openapi/spec v0.19.3 h1:0XRyw8kguri6Yw4SxhsQA/atC88yqrk0+G4YhI2wabc= +github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= +github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/strfmt v0.19.3 h1:eRfyY5SkaNJCAwmmMcADjY31ow9+N7MCLW7oRkbsINA= +github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= +github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= +github.com/go-openapi/validate v0.19.3 h1:PAH/2DylwWcIU1s0Y7k3yNmeAgWOcKrNE2Q7Ww/kCg4= +github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= +github.com/go-openapi/validate v0.19.5 h1:QhCBKRYqZR+SKo4gl1lPhPahope8/RLt6EVgY8X80w0= +github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-swagger/go-swagger v0.21.0/go.mod h1:tDb8PdDVFcaE8EPXkMOsuxpL3UEPiwu1UDZar9Z/1RY= +github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013/go.mod h1:b65mBPzqzZWxOZGxSWrqs4GInLIn+u99Q9q7p+GKni0= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= +github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= +github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= +github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -<<<<<<< HEAD github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= +github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -======= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= ->>>>>>> fix tests github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -95,18 +265,33 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= +github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0 h1:miYCvYqFXtl/J9FIy8eNpBfYthAEFg+Ys0XyUVEcDsc= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= @@ -114,22 +299,45 @@ github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1: github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0 h1:ElTg5tNp4DqfV7UQjDqv2+RJlNzsDtvNAWccbItceIE= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.4.0 h1:yXHLWeravcrgGyFSyCgdYpXQ9dR9c/WED3pg1RhxqEU= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= @@ -138,96 +346,245 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/toqueteos/webbrowser v1.2.0/go.mod h1:XWoZq4cyp9WeUeak7w7LXRUQf1F1ATJMir8RTqb4ayM= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.1 h1:Sq1fR+0c58RME5EoqKdjkiQAmPjmfHlZOoRI6fTUOcs= +go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.2 h1:jxcFYjlkl8xaERsgLo+RNquI0epW6zuy/ZRQs6jnrFA= +go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190907121410-71b5226ff739/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 h1:ulvT7fqt0yHWzpJwI57MezWnYDVpCAYBVuYst/L+fAY= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 h1:rjwSpXsdiK0dV8/Naq3kAw9ymfAeJIyd0upUIElB+lI= +golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190907184412-d223b2b6db03/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69 h1:rOhMmluY6kLMhdnrivzec6lLgaVbMHMn2ISQXJeJ5EM= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f h1:68K/z8GLUxV76xGSqwTWw2gyk/jwn79LUL43rES2g8o= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= +gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= +gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= k8s.io/api v0.0.0-20190202010724-74b699b93c15 h1:AoUGjnJ3PJMFz+Rkp4lx3X+6mPUnY1MESJhbUSGX+pc= k8s.io/api v0.0.0-20190202010724-74b699b93c15/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.0.0-20190313235455-40a48860b5ab h1:DG9A67baNpoeweOy2spF1OWHhnVY5KR7/Ek/+U1lVZc= k8s.io/api v0.0.0-20190313235455-40a48860b5ab/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= +k8s.io/api v0.17.2 h1:NF1UFXcKN7/OOv1uxdRz3qfra8AHsPav5M93hlV9+Dc= +k8s.io/api v0.17.2/go.mod h1:BS9fjjLc4CMuqfSO8vgbHPKMt5+SF0ET6u/RVDihTo4= +k8s.io/apiextensions-apiserver v0.17.2/go.mod h1:4KdMpjkEjjDI2pPfBA15OscyNldHWdBCfsWMDWAmSTs= k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c h1:02KEBFny6M5VWKj6Y8Ns27epjefTqLJXD4fvqP5tGFg= k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1 h1:IS7K02iBkQXpCeieSiyJjGoLSdVOv2DbPaWHJ+ZtgKg= k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= +k8s.io/apimachinery v0.17.2 h1:hwDQQFbdRlpnnsR64Asdi55GyCaIP/3WQpMmbNBeWr4= +k8s.io/apimachinery v0.17.2/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= +k8s.io/apiserver v0.17.2/go.mod h1:lBmw/TtQdtxvrTk0e2cgtOxHizXI+d0mmGQURIHQZlo= +k8s.io/client-go v0.17.2/go.mod h1:QAzRgsa0C2xl4/eVpeVAZMvikCn8Nm81yqVx3Kk9XYI= k8s.io/client-go v11.0.0+incompatible h1:LBbX2+lOwY9flffWlJM7f1Ct8V2SRNiMRDFeiwnJo9o= k8s.io/client-go v11.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= +k8s.io/code-generator v0.17.2/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s= +k8s.io/component-base v0.17.2/go.mod h1:zMPW3g5aH7cHJpKYQ/ZsGMcgbsA/VyhEugF3QT1awLs= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.2.0 h1:0ElL0OHzF3N+OhoJTL0uca20SxtYt4X4+bzHeqrB83c= k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= +k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kubernetes v1.14.0 h1:6T2iAEoOYQnzQb3WvPlUkcczEEXZ7+YPlAO8olwujRw= k8s.io/kubernetes v1.14.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= +k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= +k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 h1:p0Ai3qVtkbCG/Af26dBmU0E1W58NID3hSSh7cMyylpM= k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +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= +modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= +modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= sigs.k8s.io/controller-runtime v0.1.10 h1:amLOmcekVdnsD1uIpmgRqfTbQWJ2qxvQkcdeFhcotn4= sigs.k8s.io/controller-runtime v0.1.10/go.mod h1:HFAYoOh6XMV+jKF1UjFwrknPbowfyHEHHRdJMf2jMX8= +sigs.k8s.io/controller-runtime v0.5.2 h1:pyXbUfoTo+HA3jeIfr0vgi+1WtmNh0CwlcnQGLXwsSw= +sigs.k8s.io/controller-runtime v0.5.2/go.mod h1:JZUwSMVbxDupo0lTJSSFP5pimEyxGynROImSsqIOx1A= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06/go.mod h1:/ULNhyfzRopfcjskuui0cTITekDduZ7ycKN3oUT9R18= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/pkg/cli/options.go b/pkg/cli/options.go new file mode 100644 index 0000000..aeac416 --- /dev/null +++ b/pkg/cli/options.go @@ -0,0 +1,31 @@ +package cli + +import flag "github.com/spf13/pflag" + +type PaastaOptions struct { + Help bool + Verbosity int + SoaDir string + SysDir string + UseMesosCache bool +} + +func (o *PaastaOptions) Setup() { + flag.BoolVarP(&o.Help, "help", "h", false, "") + flag.CountVarP(&o.Verbosity, "verbose", "v", "") + flag.StringVarP(&o.SoaDir, "soa-dir", "d", "/nail/etc/services", "") + flag.StringVarP(&o.SysDir, "sys-dir", "C", "/etc/paasta", "") + flag.BoolVarP(&o.UseMesosCache, "use-mesos-cache", "", false, "") +} + +type CSIOptions struct { + Cluster string + Service string + Instance string +} + +func (o *CSIOptions) Setup() { + flag.StringVarP(&o.Cluster, "cluster", "c", "", "") + flag.StringVarP(&o.Service, "service", "s", "", "") + flag.StringVarP(&o.Instance, "instance", "i", "", "") +} diff --git a/pkg/config_store/store.go b/pkg/config_store/store.go index bdf5545..1a10313 100644 --- a/pkg/config_store/store.go +++ b/pkg/config_store/store.go @@ -70,6 +70,7 @@ func NewStore(dir string, hints map[string]string) *Store { } return &Store{ Dir: dir, + Data: map[string]interface{}{}, Hints: hints, ListFiles: listFiles, ParseFile: parseFile, @@ -81,7 +82,7 @@ func NewStore(dir string, hints map[string]string) *Store { // a new map, merge loaded data into the copy and swap `s.data` func (s *Store) loadPath(path string) error { value := map[string]interface{}{} - err := s.ParseFile(path, value) + err := s.ParseFile(path, &value) if err != nil { return err } @@ -146,7 +147,11 @@ func (s *Store) Get(key string) (interface{}, error) { } else { file = key } - s.load(file) + + err := s.load(file) + if err != nil { + return nil, err + } val, ok := s.Data[key] if !ok { diff --git a/pkg/paasta_api/client/autoscaler/autoscaler_client.go b/pkg/paasta_api/client/autoscaler/autoscaler_client.go index 723b895..3acf8c5 100644 --- a/pkg/paasta_api/client/autoscaler/autoscaler_client.go +++ b/pkg/paasta_api/client/autoscaler/autoscaler_client.go @@ -9,11 +9,12 @@ import ( "fmt" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // New creates a new autoscaler API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { return &Client{transport: transport, formats: formats} } @@ -25,17 +26,8 @@ type Client struct { formats strfmt.Registry } -// ClientService is the interface for Client methods -type ClientService interface { - GetAutoscalerCount(params *GetAutoscalerCountParams) (*GetAutoscalerCountOK, error) - - UpdateAutoscalerCount(params *UpdateAutoscalerCountParams) (*UpdateAutoscalerCountAccepted, error) - - SetTransport(transport runtime.ClientTransport) -} - /* - GetAutoscalerCount gets status of service name instance name +GetAutoscalerCount gets status of service name instance name */ func (a *Client) GetAutoscalerCount(params *GetAutoscalerCountParams) (*GetAutoscalerCountOK, error) { // TODO: Validate the params before sending @@ -69,7 +61,7 @@ func (a *Client) GetAutoscalerCount(params *GetAutoscalerCountParams) (*GetAutos } /* - UpdateAutoscalerCount gets status of service name instance name +UpdateAutoscalerCount gets status of service name instance name */ func (a *Client) UpdateAutoscalerCount(params *UpdateAutoscalerCountParams) (*UpdateAutoscalerCountAccepted, error) { // TODO: Validate the params before sending diff --git a/pkg/paasta_api/client/autoscaler/get_autoscaler_count_parameters.go b/pkg/paasta_api/client/autoscaler/get_autoscaler_count_parameters.go index df8c045..b4a3ff3 100644 --- a/pkg/paasta_api/client/autoscaler/get_autoscaler_count_parameters.go +++ b/pkg/paasta_api/client/autoscaler/get_autoscaler_count_parameters.go @@ -13,7 +13,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // NewGetAutoscalerCountParams creates a new GetAutoscalerCountParams object diff --git a/pkg/paasta_api/client/autoscaler/get_autoscaler_count_responses.go b/pkg/paasta_api/client/autoscaler/get_autoscaler_count_responses.go index 3530321..878d32d 100644 --- a/pkg/paasta_api/client/autoscaler/get_autoscaler_count_responses.go +++ b/pkg/paasta_api/client/autoscaler/get_autoscaler_count_responses.go @@ -10,8 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" ) // GetAutoscalerCountReader is a Reader for the GetAutoscalerCount structure. diff --git a/pkg/paasta_api/client/autoscaler/update_autoscaler_count_parameters.go b/pkg/paasta_api/client/autoscaler/update_autoscaler_count_parameters.go index 4e4e1dc..a6154d9 100644 --- a/pkg/paasta_api/client/autoscaler/update_autoscaler_count_parameters.go +++ b/pkg/paasta_api/client/autoscaler/update_autoscaler_count_parameters.go @@ -13,7 +13,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // NewUpdateAutoscalerCountParams creates a new UpdateAutoscalerCountParams object diff --git a/pkg/paasta_api/client/autoscaler/update_autoscaler_count_responses.go b/pkg/paasta_api/client/autoscaler/update_autoscaler_count_responses.go index fc7be49..6b56bc7 100644 --- a/pkg/paasta_api/client/autoscaler/update_autoscaler_count_responses.go +++ b/pkg/paasta_api/client/autoscaler/update_autoscaler_count_responses.go @@ -10,8 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" ) // UpdateAutoscalerCountReader is a Reader for the UpdateAutoscalerCount structure. diff --git a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_client.go b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_client.go index 986e590..0308f24 100644 --- a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_client.go +++ b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_client.go @@ -9,11 +9,12 @@ import ( "fmt" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // New creates a new marathon dashboard API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { return &Client{transport: transport, formats: formats} } @@ -25,15 +26,8 @@ type Client struct { formats strfmt.Registry } -// ClientService is the interface for Client methods -type ClientService interface { - MarathonDashboard(params *MarathonDashboardParams) (*MarathonDashboardOK, error) - - SetTransport(transport runtime.ClientTransport) -} - /* - MarathonDashboard gets marathon service instances and their shards +MarathonDashboard gets marathon service instances and their shards */ func (a *Client) MarathonDashboard(params *MarathonDashboardParams) (*MarathonDashboardOK, error) { // TODO: Validate the params before sending diff --git a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_parameters.go b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_parameters.go index 67d5f61..3d70025 100644 --- a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_parameters.go +++ b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_parameters.go @@ -13,7 +13,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // NewMarathonDashboardParams creates a new MarathonDashboardParams object diff --git a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_responses.go b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_responses.go index b474020..3266038 100644 --- a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_responses.go +++ b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_responses.go @@ -10,9 +10,10 @@ import ( "io" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" + strfmt "github.com/go-openapi/strfmt" + + models "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" ) // MarathonDashboardReader is a Reader for the MarathonDashboard structure. diff --git a/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_parameters.go b/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_parameters.go index 999782b..f10c0e3 100644 --- a/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_parameters.go +++ b/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_parameters.go @@ -13,7 +13,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // NewDeleteServiceAutoscalerPauseParams creates a new DeleteServiceAutoscalerPauseParams object diff --git a/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_responses.go b/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_responses.go index d41f68f..a8aae1b 100644 --- a/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_responses.go +++ b/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_responses.go @@ -9,7 +9,8 @@ import ( "fmt" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // DeleteServiceAutoscalerPauseReader is a Reader for the DeleteServiceAutoscalerPause structure. diff --git a/pkg/paasta_api/client/operations/get_service_autoscaler_pause_parameters.go b/pkg/paasta_api/client/operations/get_service_autoscaler_pause_parameters.go index e00dd1b..9a34603 100644 --- a/pkg/paasta_api/client/operations/get_service_autoscaler_pause_parameters.go +++ b/pkg/paasta_api/client/operations/get_service_autoscaler_pause_parameters.go @@ -13,7 +13,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // NewGetServiceAutoscalerPauseParams creates a new GetServiceAutoscalerPauseParams object diff --git a/pkg/paasta_api/client/operations/get_service_autoscaler_pause_responses.go b/pkg/paasta_api/client/operations/get_service_autoscaler_pause_responses.go index 5e0eda9..e44c15c 100644 --- a/pkg/paasta_api/client/operations/get_service_autoscaler_pause_responses.go +++ b/pkg/paasta_api/client/operations/get_service_autoscaler_pause_responses.go @@ -10,7 +10,8 @@ import ( "io" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // GetServiceAutoscalerPauseReader is a Reader for the GetServiceAutoscalerPause structure. diff --git a/pkg/paasta_api/client/operations/metastatus_parameters.go b/pkg/paasta_api/client/operations/metastatus_parameters.go index 3448fcd..a1da149 100644 --- a/pkg/paasta_api/client/operations/metastatus_parameters.go +++ b/pkg/paasta_api/client/operations/metastatus_parameters.go @@ -13,8 +13,9 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" ) // NewMetastatusParams creates a new MetastatusParams object diff --git a/pkg/paasta_api/client/operations/metastatus_responses.go b/pkg/paasta_api/client/operations/metastatus_responses.go index 60f309a..9b13b95 100644 --- a/pkg/paasta_api/client/operations/metastatus_responses.go +++ b/pkg/paasta_api/client/operations/metastatus_responses.go @@ -10,9 +10,10 @@ import ( "io" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" + strfmt "github.com/go-openapi/strfmt" + + models "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" ) // MetastatusReader is a Reader for the Metastatus structure. diff --git a/pkg/paasta_api/client/operations/operations_client.go b/pkg/paasta_api/client/operations/operations_client.go index 825d239..280a503 100644 --- a/pkg/paasta_api/client/operations/operations_client.go +++ b/pkg/paasta_api/client/operations/operations_client.go @@ -9,11 +9,12 @@ import ( "fmt" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // New creates a new operations API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { return &Client{transport: transport, formats: formats} } @@ -25,25 +26,8 @@ type Client struct { formats strfmt.Registry } -// ClientService is the interface for Client methods -type ClientService interface { - DeleteServiceAutoscalerPause(params *DeleteServiceAutoscalerPauseParams) (*DeleteServiceAutoscalerPauseOK, error) - - DeployQueue(params *DeployQueueParams) (*DeployQueueOK, error) - - GetServiceAutoscalerPause(params *GetServiceAutoscalerPauseParams) (*GetServiceAutoscalerPauseOK, error) - - Metastatus(params *MetastatusParams) (*MetastatusOK, error) - - ShowVersion(params *ShowVersionParams) (*ShowVersionOK, error) - - UpdateServiceAutoscalerPause(params *UpdateServiceAutoscalerPauseParams) (*UpdateServiceAutoscalerPauseOK, error) - - SetTransport(transport runtime.ClientTransport) -} - /* - DeleteServiceAutoscalerPause unpauses the autoscaler +DeleteServiceAutoscalerPause unpauses the autoscaler */ func (a *Client) DeleteServiceAutoscalerPause(params *DeleteServiceAutoscalerPauseParams) (*DeleteServiceAutoscalerPauseOK, error) { // TODO: Validate the params before sending @@ -77,41 +61,7 @@ func (a *Client) DeleteServiceAutoscalerPause(params *DeleteServiceAutoscalerPau } /* - DeployQueue gets deploy queue contents -*/ -func (a *Client) DeployQueue(params *DeployQueueParams) (*DeployQueueOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeployQueueParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "deploy_queue", - Method: "GET", - PathPattern: "/deploy_queue", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &DeployQueueReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*DeployQueueOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deploy_queue: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetServiceAutoscalerPause gets autoscaling pause time +GetServiceAutoscalerPause gets autoscaling pause time */ func (a *Client) GetServiceAutoscalerPause(params *GetServiceAutoscalerPauseParams) (*GetServiceAutoscalerPauseOK, error) { // TODO: Validate the params before sending @@ -145,7 +95,7 @@ func (a *Client) GetServiceAutoscalerPause(params *GetServiceAutoscalerPausePara } /* - Metastatus gets metastatus +Metastatus gets metastatus */ func (a *Client) Metastatus(params *MetastatusParams) (*MetastatusOK, error) { // TODO: Validate the params before sending @@ -179,7 +129,7 @@ func (a *Client) Metastatus(params *MetastatusParams) (*MetastatusOK, error) { } /* - ShowVersion versions of paasta tools package +ShowVersion versions of paasta tools package */ func (a *Client) ShowVersion(params *ShowVersionParams) (*ShowVersionOK, error) { // TODO: Validate the params before sending @@ -213,7 +163,7 @@ func (a *Client) ShowVersion(params *ShowVersionParams) (*ShowVersionOK, error) } /* - UpdateServiceAutoscalerPause update service autoscaler pause API +UpdateServiceAutoscalerPause update service autoscaler pause API */ func (a *Client) UpdateServiceAutoscalerPause(params *UpdateServiceAutoscalerPauseParams) (*UpdateServiceAutoscalerPauseOK, error) { // TODO: Validate the params before sending diff --git a/pkg/paasta_api/client/operations/show_version_parameters.go b/pkg/paasta_api/client/operations/show_version_parameters.go index a8b181a..869ff46 100644 --- a/pkg/paasta_api/client/operations/show_version_parameters.go +++ b/pkg/paasta_api/client/operations/show_version_parameters.go @@ -13,7 +13,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // NewShowVersionParams creates a new ShowVersionParams object diff --git a/pkg/paasta_api/client/operations/show_version_responses.go b/pkg/paasta_api/client/operations/show_version_responses.go index bd7c8f7..e141f44 100644 --- a/pkg/paasta_api/client/operations/show_version_responses.go +++ b/pkg/paasta_api/client/operations/show_version_responses.go @@ -10,7 +10,8 @@ import ( "io" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // ShowVersionReader is a Reader for the ShowVersion structure. diff --git a/pkg/paasta_api/client/operations/update_service_autoscaler_pause_parameters.go b/pkg/paasta_api/client/operations/update_service_autoscaler_pause_parameters.go index 5fb998d..bcf91dd 100644 --- a/pkg/paasta_api/client/operations/update_service_autoscaler_pause_parameters.go +++ b/pkg/paasta_api/client/operations/update_service_autoscaler_pause_parameters.go @@ -13,7 +13,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // NewUpdateServiceAutoscalerPauseParams creates a new UpdateServiceAutoscalerPauseParams object diff --git a/pkg/paasta_api/client/operations/update_service_autoscaler_pause_responses.go b/pkg/paasta_api/client/operations/update_service_autoscaler_pause_responses.go index 4496259..24036f4 100644 --- a/pkg/paasta_api/client/operations/update_service_autoscaler_pause_responses.go +++ b/pkg/paasta_api/client/operations/update_service_autoscaler_pause_responses.go @@ -9,8 +9,9 @@ import ( "fmt" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" ) // UpdateServiceAutoscalerPauseReader is a Reader for the UpdateServiceAutoscalerPause structure. diff --git a/pkg/paasta_api/client/paasta_client.go b/pkg/paasta_api/client/paasta_client.go index 4668e19..cbb8be8 100644 --- a/pkg/paasta_api/client/paasta_client.go +++ b/pkg/paasta_api/client/paasta_client.go @@ -8,7 +8,8 @@ package client import ( "github.com/go-openapi/runtime" httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/autoscaler" "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/marathon_dashboard" @@ -59,11 +60,17 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Paasta { cli := new(Paasta) cli.Transport = transport + cli.Autoscaler = autoscaler.New(transport, formats) + cli.MarathonDashboard = marathon_dashboard.New(transport, formats) + cli.Operations = operations.New(transport, formats) + cli.Resources = resources.New(transport, formats) + cli.Service = service.New(transport, formats) + return cli } @@ -108,15 +115,15 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { // Paasta is a client for paasta type Paasta struct { - Autoscaler autoscaler.ClientService + Autoscaler *autoscaler.Client - MarathonDashboard marathon_dashboard.ClientService + MarathonDashboard *marathon_dashboard.Client - Operations operations.ClientService + Operations *operations.Client - Resources resources.ClientService + Resources *resources.Client - Service service.ClientService + Service *service.Client Transport runtime.ClientTransport } @@ -124,9 +131,15 @@ type Paasta struct { // SetTransport changes the transport on the client and all its subresources func (c *Paasta) SetTransport(transport runtime.ClientTransport) { c.Transport = transport + c.Autoscaler.SetTransport(transport) + c.MarathonDashboard.SetTransport(transport) + c.Operations.SetTransport(transport) + c.Resources.SetTransport(transport) + c.Service.SetTransport(transport) + } diff --git a/pkg/paasta_api/client/resources/resources_client.go b/pkg/paasta_api/client/resources/resources_client.go index 94639f3..d882f67 100644 --- a/pkg/paasta_api/client/resources/resources_client.go +++ b/pkg/paasta_api/client/resources/resources_client.go @@ -9,11 +9,12 @@ import ( "fmt" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // New creates a new resources API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { return &Client{transport: transport, formats: formats} } @@ -25,15 +26,8 @@ type Client struct { formats strfmt.Registry } -// ClientService is the interface for Client methods -type ClientService interface { - Resources(params *ResourcesParams) (*ResourcesOK, error) - - SetTransport(transport runtime.ClientTransport) -} - /* - Resources gets resources in the cluster +Resources gets resources in the cluster */ func (a *Client) Resources(params *ResourcesParams) (*ResourcesOK, error) { // TODO: Validate the params before sending diff --git a/pkg/paasta_api/client/resources/resources_parameters.go b/pkg/paasta_api/client/resources/resources_parameters.go index 48a697f..b4a7779 100644 --- a/pkg/paasta_api/client/resources/resources_parameters.go +++ b/pkg/paasta_api/client/resources/resources_parameters.go @@ -13,8 +13,9 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" ) // NewResourcesParams creates a new ResourcesParams object diff --git a/pkg/paasta_api/client/resources/resources_responses.go b/pkg/paasta_api/client/resources/resources_responses.go index e82b82e..10ccea3 100644 --- a/pkg/paasta_api/client/resources/resources_responses.go +++ b/pkg/paasta_api/client/resources/resources_responses.go @@ -10,9 +10,10 @@ import ( "io" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" + strfmt "github.com/go-openapi/strfmt" + + models "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" ) // ResourcesReader is a Reader for the Resources structure. diff --git a/pkg/paasta_api/client/service/delay_instance_parameters.go b/pkg/paasta_api/client/service/delay_instance_parameters.go index 3b90c31..20e0fe6 100644 --- a/pkg/paasta_api/client/service/delay_instance_parameters.go +++ b/pkg/paasta_api/client/service/delay_instance_parameters.go @@ -13,7 +13,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // NewDelayInstanceParams creates a new DelayInstanceParams object diff --git a/pkg/paasta_api/client/service/delay_instance_responses.go b/pkg/paasta_api/client/service/delay_instance_responses.go index eb5d10a..e13aa33 100644 --- a/pkg/paasta_api/client/service/delay_instance_responses.go +++ b/pkg/paasta_api/client/service/delay_instance_responses.go @@ -10,9 +10,10 @@ import ( "io" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" + strfmt "github.com/go-openapi/strfmt" + + models "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" ) // DelayInstanceReader is a Reader for the DelayInstance structure. diff --git a/pkg/paasta_api/client/service/instance_set_state_parameters.go b/pkg/paasta_api/client/service/instance_set_state_parameters.go index 3359d4e..5621478 100644 --- a/pkg/paasta_api/client/service/instance_set_state_parameters.go +++ b/pkg/paasta_api/client/service/instance_set_state_parameters.go @@ -13,7 +13,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // NewInstanceSetStateParams creates a new InstanceSetStateParams object diff --git a/pkg/paasta_api/client/service/instance_set_state_responses.go b/pkg/paasta_api/client/service/instance_set_state_responses.go index d5a8496..791f88d 100644 --- a/pkg/paasta_api/client/service/instance_set_state_responses.go +++ b/pkg/paasta_api/client/service/instance_set_state_responses.go @@ -9,7 +9,8 @@ import ( "fmt" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // InstanceSetStateReader is a Reader for the InstanceSetState structure. diff --git a/pkg/paasta_api/client/service/list_instances_parameters.go b/pkg/paasta_api/client/service/list_instances_parameters.go index e36e755..a852ceb 100644 --- a/pkg/paasta_api/client/service/list_instances_parameters.go +++ b/pkg/paasta_api/client/service/list_instances_parameters.go @@ -13,7 +13,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // NewListInstancesParams creates a new ListInstancesParams object diff --git a/pkg/paasta_api/client/service/list_instances_responses.go b/pkg/paasta_api/client/service/list_instances_responses.go index 0ca8f18..80a9298 100644 --- a/pkg/paasta_api/client/service/list_instances_responses.go +++ b/pkg/paasta_api/client/service/list_instances_responses.go @@ -10,8 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" ) // ListInstancesReader is a Reader for the ListInstances structure. diff --git a/pkg/paasta_api/client/service/list_services_for_cluster_parameters.go b/pkg/paasta_api/client/service/list_services_for_cluster_parameters.go index d2c6416..e1153d1 100644 --- a/pkg/paasta_api/client/service/list_services_for_cluster_parameters.go +++ b/pkg/paasta_api/client/service/list_services_for_cluster_parameters.go @@ -13,7 +13,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // NewListServicesForClusterParams creates a new ListServicesForClusterParams object diff --git a/pkg/paasta_api/client/service/list_services_for_cluster_responses.go b/pkg/paasta_api/client/service/list_services_for_cluster_responses.go index d17c09b..4e037e8 100644 --- a/pkg/paasta_api/client/service/list_services_for_cluster_responses.go +++ b/pkg/paasta_api/client/service/list_services_for_cluster_responses.go @@ -10,8 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" ) // ListServicesForClusterReader is a Reader for the ListServicesForCluster structure. diff --git a/pkg/paasta_api/client/service/service_client.go b/pkg/paasta_api/client/service/service_client.go index 0edf5a3..3f103cb 100644 --- a/pkg/paasta_api/client/service/service_client.go +++ b/pkg/paasta_api/client/service/service_client.go @@ -9,11 +9,12 @@ import ( "fmt" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" + + strfmt "github.com/go-openapi/strfmt" ) // New creates a new service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { return &Client{transport: transport, formats: formats} } @@ -25,27 +26,8 @@ type Client struct { formats strfmt.Registry } -// ClientService is the interface for Client methods -type ClientService interface { - DelayInstance(params *DelayInstanceParams) (*DelayInstanceOK, *DelayInstanceNoContent, error) - - InstanceSetState(params *InstanceSetStateParams) (*InstanceSetStateOK, error) - - ListInstances(params *ListInstancesParams) (*ListInstancesOK, error) - - ListServicesForCluster(params *ListServicesForClusterParams) (*ListServicesForClusterOK, error) - - StatusInstance(params *StatusInstanceParams) (*StatusInstanceOK, error) - - TaskInstance(params *TaskInstanceParams) (*TaskInstanceOK, error) - - TasksInstance(params *TasksInstanceParams) (*TasksInstanceOK, error) - - SetTransport(transport runtime.ClientTransport) -} - /* - DelayInstance gets the possible reasons for a deployment delay for a marathon service instance +DelayInstance gets the possible reasons for a deployment delay for a marathon service instance */ func (a *Client) DelayInstance(params *DelayInstanceParams) (*DelayInstanceOK, *DelayInstanceNoContent, error) { // TODO: Validate the params before sending @@ -80,7 +62,7 @@ func (a *Client) DelayInstance(params *DelayInstanceParams) (*DelayInstanceOK, * } /* - InstanceSetState changes state of service name instance name +InstanceSetState changes state of service name instance name */ func (a *Client) InstanceSetState(params *InstanceSetStateParams) (*InstanceSetStateOK, error) { // TODO: Validate the params before sending @@ -114,7 +96,7 @@ func (a *Client) InstanceSetState(params *InstanceSetStateParams) (*InstanceSetS } /* - ListInstances lists instances of service name +ListInstances lists instances of service name */ func (a *Client) ListInstances(params *ListInstancesParams) (*ListInstancesOK, error) { // TODO: Validate the params before sending @@ -148,7 +130,7 @@ func (a *Client) ListInstances(params *ListInstancesParams) (*ListInstancesOK, e } /* - ListServicesForCluster lists service names and service instance names on the current cluster +ListServicesForCluster lists service names and service instance names on the current cluster */ func (a *Client) ListServicesForCluster(params *ListServicesForClusterParams) (*ListServicesForClusterOK, error) { // TODO: Validate the params before sending @@ -182,7 +164,7 @@ func (a *Client) ListServicesForCluster(params *ListServicesForClusterParams) (* } /* - StatusInstance gets status of service name instance name +StatusInstance gets status of service name instance name */ func (a *Client) StatusInstance(params *StatusInstanceParams) (*StatusInstanceOK, error) { // TODO: Validate the params before sending @@ -216,7 +198,7 @@ func (a *Client) StatusInstance(params *StatusInstanceParams) (*StatusInstanceOK } /* - TaskInstance gets mesos task of service name instance name by task id +TaskInstance gets mesos task of service name instance name by task id */ func (a *Client) TaskInstance(params *TaskInstanceParams) (*TaskInstanceOK, error) { // TODO: Validate the params before sending @@ -250,7 +232,7 @@ func (a *Client) TaskInstance(params *TaskInstanceParams) (*TaskInstanceOK, erro } /* - TasksInstance gets mesos tasks of service name instance name +TasksInstance gets mesos tasks of service name instance name */ func (a *Client) TasksInstance(params *TasksInstanceParams) (*TasksInstanceOK, error) { // TODO: Validate the params before sending diff --git a/pkg/paasta_api/client/service/status_instance_parameters.go b/pkg/paasta_api/client/service/status_instance_parameters.go index c20547d..76c2a8d 100644 --- a/pkg/paasta_api/client/service/status_instance_parameters.go +++ b/pkg/paasta_api/client/service/status_instance_parameters.go @@ -13,8 +13,9 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" ) // NewStatusInstanceParams creates a new StatusInstanceParams object @@ -61,11 +62,6 @@ for the status instance operation typically these are written to a http.Request */ type StatusInstanceParams struct { - /*IncludeEnvoy - Include Envoy information - - */ - IncludeEnvoy *bool /*IncludeMesos Include Mesos information @@ -130,17 +126,6 @@ func (o *StatusInstanceParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } -// WithIncludeEnvoy adds the includeEnvoy to the status instance params -func (o *StatusInstanceParams) WithIncludeEnvoy(includeEnvoy *bool) *StatusInstanceParams { - o.SetIncludeEnvoy(includeEnvoy) - return o -} - -// SetIncludeEnvoy adds the includeEnvoy to the status instance params -func (o *StatusInstanceParams) SetIncludeEnvoy(includeEnvoy *bool) { - o.IncludeEnvoy = includeEnvoy -} - // WithIncludeMesos adds the includeMesos to the status instance params func (o *StatusInstanceParams) WithIncludeMesos(includeMesos *bool) *StatusInstanceParams { o.SetIncludeMesos(includeMesos) @@ -204,22 +189,6 @@ func (o *StatusInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfm } var res []error - if o.IncludeEnvoy != nil { - - // query param include_envoy - var qrIncludeEnvoy bool - if o.IncludeEnvoy != nil { - qrIncludeEnvoy = *o.IncludeEnvoy - } - qIncludeEnvoy := swag.FormatBool(qrIncludeEnvoy) - if qIncludeEnvoy != "" { - if err := r.SetQueryParam("include_envoy", qIncludeEnvoy); err != nil { - return err - } - } - - } - if o.IncludeMesos != nil { // query param include_mesos diff --git a/pkg/paasta_api/client/service/status_instance_responses.go b/pkg/paasta_api/client/service/status_instance_responses.go index bd4acb7..6be222d 100644 --- a/pkg/paasta_api/client/service/status_instance_responses.go +++ b/pkg/paasta_api/client/service/status_instance_responses.go @@ -10,9 +10,10 @@ import ( "io" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" + strfmt "github.com/go-openapi/strfmt" + + models "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" ) // StatusInstanceReader is a Reader for the StatusInstance structure. diff --git a/pkg/paasta_api/client/service/task_instance_parameters.go b/pkg/paasta_api/client/service/task_instance_parameters.go index 9cada39..89f18d4 100644 --- a/pkg/paasta_api/client/service/task_instance_parameters.go +++ b/pkg/paasta_api/client/service/task_instance_parameters.go @@ -13,8 +13,9 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" ) // NewTaskInstanceParams creates a new TaskInstanceParams object diff --git a/pkg/paasta_api/client/service/task_instance_responses.go b/pkg/paasta_api/client/service/task_instance_responses.go index 7c98023..64d412e 100644 --- a/pkg/paasta_api/client/service/task_instance_responses.go +++ b/pkg/paasta_api/client/service/task_instance_responses.go @@ -10,9 +10,10 @@ import ( "io" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" + strfmt "github.com/go-openapi/strfmt" + + models "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" ) // TaskInstanceReader is a Reader for the TaskInstance structure. diff --git a/pkg/paasta_api/client/service/tasks_instance_parameters.go b/pkg/paasta_api/client/service/tasks_instance_parameters.go index fbb920f..46efd9b 100644 --- a/pkg/paasta_api/client/service/tasks_instance_parameters.go +++ b/pkg/paasta_api/client/service/tasks_instance_parameters.go @@ -13,8 +13,9 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" ) // NewTasksInstanceParams creates a new TasksInstanceParams object diff --git a/pkg/paasta_api/client/service/tasks_instance_responses.go b/pkg/paasta_api/client/service/tasks_instance_responses.go index aaacc5a..a245248 100644 --- a/pkg/paasta_api/client/service/tasks_instance_responses.go +++ b/pkg/paasta_api/client/service/tasks_instance_responses.go @@ -10,9 +10,10 @@ import ( "io" "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" + strfmt "github.com/go-openapi/strfmt" + + models "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" ) // TasksInstanceReader is a Reader for the TasksInstance structure. diff --git a/pkg/paasta_api/models/adhoc_launch_history.go b/pkg/paasta_api/models/adhoc_launch_history.go index eb964a3..1b92032 100644 --- a/pkg/paasta_api/models/adhoc_launch_history.go +++ b/pkg/paasta_api/models/adhoc_launch_history.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/strfmt" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) // AdhocLaunchHistory A single run -// // swagger:model AdhocLaunchHistory type AdhocLaunchHistory struct { diff --git a/pkg/paasta_api/models/float_and_error.go b/pkg/paasta_api/models/float_and_error.go index 659a1d6..585a323 100644 --- a/pkg/paasta_api/models/float_and_error.go +++ b/pkg/paasta_api/models/float_and_error.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/strfmt" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) // FloatAndError float and error -// // swagger:model FloatAndError type FloatAndError struct { diff --git a/pkg/paasta_api/models/instance_delay.go b/pkg/paasta_api/models/instance_delay.go index d30b602..314b170 100644 --- a/pkg/paasta_api/models/instance_delay.go +++ b/pkg/paasta_api/models/instance_delay.go @@ -6,6 +6,5 @@ package models // Editing this file might prove futile when you re-run the swagger generate command // InstanceDelay instance delay -// // swagger:model InstanceDelay type InstanceDelay interface{} diff --git a/pkg/paasta_api/models/instance_metadata_flink.go b/pkg/paasta_api/models/instance_metadata_flink.go index bbebb83..9cc5ec2 100644 --- a/pkg/paasta_api/models/instance_metadata_flink.go +++ b/pkg/paasta_api/models/instance_metadata_flink.go @@ -6,6 +6,5 @@ package models // Editing this file might prove futile when you re-run the swagger generate command // InstanceMetadataFlink Flink instance metadata -// // swagger:model InstanceMetadataFlink type InstanceMetadataFlink interface{} diff --git a/pkg/paasta_api/models/instance_status.go b/pkg/paasta_api/models/instance_status.go index e3ebe33..4c193eb 100644 --- a/pkg/paasta_api/models/instance_status.go +++ b/pkg/paasta_api/models/instance_status.go @@ -6,13 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // InstanceStatus instance status -// // swagger:model InstanceStatus type InstanceStatus struct { @@ -28,9 +28,6 @@ type InstanceStatus struct { // Instance name Instance string `json:"instance,omitempty"` - // kafkacluster - Kafkacluster *InstanceStatusKafkacluster `json:"kafkacluster,omitempty"` - // Kubernetes instance status Kubernetes *InstanceStatusKubernetes `json:"kubernetes,omitempty"` @@ -56,10 +53,6 @@ func (m *InstanceStatus) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateKafkacluster(formats); err != nil { - res = append(res, err) - } - if err := m.validateKubernetes(formats); err != nil { res = append(res, err) } @@ -112,24 +105,6 @@ func (m *InstanceStatus) validateFlink(formats strfmt.Registry) error { return nil } -func (m *InstanceStatus) validateKafkacluster(formats strfmt.Registry) error { - - if swag.IsZero(m.Kafkacluster) { // not required - return nil - } - - if m.Kafkacluster != nil { - if err := m.Kafkacluster.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("kafkacluster") - } - return err - } - } - - return nil -} - func (m *InstanceStatus) validateKubernetes(formats strfmt.Registry) error { if swag.IsZero(m.Kubernetes) { // not required @@ -203,7 +178,6 @@ func (m *InstanceStatus) UnmarshalBinary(b []byte) error { } // InstanceStatusFlink Nullable Flink instance status and metadata -// // swagger:model InstanceStatusFlink type InstanceStatusFlink struct { @@ -263,38 +237,3 @@ func (m *InstanceStatusFlink) UnmarshalBinary(b []byte) error { *m = res return nil } - -// InstanceStatusKafkacluster Nullable KafkaCluster instance status and metadata -// -// swagger:model InstanceStatusKafkacluster -type InstanceStatusKafkacluster struct { - - // metadata - Metadata InstanceMetadataKafkaCluster `json:"metadata,omitempty"` - - // status - Status InstanceStatusKafkaCluster `json:"status,omitempty"` -} - -// Validate validates this instance status kafkacluster -func (m *InstanceStatusKafkacluster) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *InstanceStatusKafkacluster) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InstanceStatusKafkacluster) UnmarshalBinary(b []byte) error { - var res InstanceStatusKafkacluster - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/instance_status_adhoc.go b/pkg/paasta_api/models/instance_status_adhoc.go index 4dd30a9..ecfbc1d 100644 --- a/pkg/paasta_api/models/instance_status_adhoc.go +++ b/pkg/paasta_api/models/instance_status_adhoc.go @@ -8,13 +8,13 @@ package models import ( "strconv" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // InstanceStatusAdhoc List of runs associated with job -// // swagger:model InstanceStatusAdhoc type InstanceStatusAdhoc []*AdhocLaunchHistory diff --git a/pkg/paasta_api/models/instance_status_flink.go b/pkg/paasta_api/models/instance_status_flink.go index 08b7608..37cf1e8 100644 --- a/pkg/paasta_api/models/instance_status_flink.go +++ b/pkg/paasta_api/models/instance_status_flink.go @@ -6,6 +6,5 @@ package models // Editing this file might prove futile when you re-run the swagger generate command // InstanceStatusFlink Flink instance status -// // swagger:model InstanceStatusFlink -type _InstanceStatusFlink interface{} +type InstanceStatusFlink interface{} diff --git a/pkg/paasta_api/models/instance_status_kubernetes.go b/pkg/paasta_api/models/instance_status_kubernetes.go index 8984d28..db6220e 100644 --- a/pkg/paasta_api/models/instance_status_kubernetes.go +++ b/pkg/paasta_api/models/instance_status_kubernetes.go @@ -9,14 +9,14 @@ import ( "encoding/json" "strconv" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // InstanceStatusKubernetes instance status kubernetes -// // swagger:model InstanceStatusKubernetes type InstanceStatusKubernetes struct { @@ -27,9 +27,6 @@ type InstanceStatusKubernetes struct { // ID of the desired version of a service instance AppID string `json:"app_id,omitempty"` - // autoscaling status - AutoscalingStatus *InstanceStatusKubernetesAutoscalingStatus `json:"autoscaling_status,omitempty"` - // backoff in seconds before launching the next task BackoffSeconds int32 `json:"backoff_seconds,omitempty"` @@ -45,9 +42,6 @@ type InstanceStatusKubernetes struct { // Enum: [Running Deploying Stopped Delayed Waiting NotRunning] DeployStatus string `json:"deploy_status,omitempty"` - // Reason for the deploy status - DeployStatusMessage string `json:"deploy_status_message,omitempty"` - // Desired state of a service, for Kubernetes // Required: true // Enum: [start stop] @@ -83,10 +77,6 @@ func (m *InstanceStatusKubernetes) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateAutoscalingStatus(formats); err != nil { - res = append(res, err) - } - if err := m.validateBounceMethod(formats); err != nil { res = append(res, err) } @@ -126,24 +116,6 @@ func (m *InstanceStatusKubernetes) validateAppCount(formats strfmt.Registry) err return nil } -func (m *InstanceStatusKubernetes) validateAutoscalingStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.AutoscalingStatus) { // not required - return nil - } - - if m.AutoscalingStatus != nil { - if err := m.AutoscalingStatus.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("autoscaling_status") - } - return err - } - } - - return nil -} - var instanceStatusKubernetesTypeBounceMethodPropEnum []interface{} func init() { @@ -376,81 +348,3 @@ func (m *InstanceStatusKubernetes) UnmarshalBinary(b []byte) error { *m = res return nil } - -// InstanceStatusKubernetesAutoscalingStatus HPA associated to this app -// -// swagger:model InstanceStatusKubernetesAutoscalingStatus -type InstanceStatusKubernetesAutoscalingStatus struct { - - // desired number of _instances as calculated by HPA - DesiredReplicas int64 `json:"desired_replicas,omitempty"` - - // timestamp of last autoscale - LastScaleTime string `json:"last_scale_time,omitempty"` - - // min_instances as specified in yelpsoa_configs - MaxInstances int64 `json:"max_instances,omitempty"` - - // Current metrics - Metrics []*HPAMetric `json:"metrics"` - - // min_instances as specified in yelpsoa_configs - MinInstances int64 `json:"min_instances,omitempty"` -} - -// Validate validates this instance status kubernetes autoscaling status -func (m *InstanceStatusKubernetesAutoscalingStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMetrics(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InstanceStatusKubernetesAutoscalingStatus) validateMetrics(formats strfmt.Registry) error { - - if swag.IsZero(m.Metrics) { // not required - return nil - } - - for i := 0; i < len(m.Metrics); i++ { - if swag.IsZero(m.Metrics[i]) { // not required - continue - } - - if m.Metrics[i] != nil { - if err := m.Metrics[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("autoscaling_status" + "." + "metrics" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InstanceStatusKubernetesAutoscalingStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InstanceStatusKubernetesAutoscalingStatus) UnmarshalBinary(b []byte) error { - var res InstanceStatusKubernetesAutoscalingStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/instance_status_marathon.go b/pkg/paasta_api/models/instance_status_marathon.go index 6ce4f42..06d2750 100644 --- a/pkg/paasta_api/models/instance_status_marathon.go +++ b/pkg/paasta_api/models/instance_status_marathon.go @@ -9,14 +9,14 @@ import ( "encoding/json" "strconv" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // InstanceStatusMarathon instance status marathon -// // swagger:model InstanceStatusMarathon type InstanceStatusMarathon struct { @@ -50,9 +50,6 @@ type InstanceStatusMarathon struct { // Enum: [start stop] DesiredState *string `json:"desired_state"` - // Status of the service in Envoy - Envoy *EnvoyStatus `json:"envoy,omitempty"` - // Error message when a marathon job ID cannot be found ErrorMessage string `json:"error_message,omitempty"` @@ -97,10 +94,6 @@ func (m *InstanceStatusMarathon) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateEnvoy(formats); err != nil { - res = append(res, err) - } - if err := m.validateMesos(formats); err != nil { res = append(res, err) } @@ -317,24 +310,6 @@ func (m *InstanceStatusMarathon) validateDesiredState(formats strfmt.Registry) e return nil } -func (m *InstanceStatusMarathon) validateEnvoy(formats strfmt.Registry) error { - - if swag.IsZero(m.Envoy) { // not required - return nil - } - - if m.Envoy != nil { - if err := m.Envoy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("envoy") - } - return err - } - } - - return nil -} - func (m *InstanceStatusMarathon) validateMesos(formats strfmt.Registry) error { if swag.IsZero(m.Mesos) { // not required diff --git a/pkg/paasta_api/models/instance_status_tron.go b/pkg/paasta_api/models/instance_status_tron.go index dda087b..cad5f40 100644 --- a/pkg/paasta_api/models/instance_status_tron.go +++ b/pkg/paasta_api/models/instance_status_tron.go @@ -6,14 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // InstanceStatusTron instance status tron -// // swagger:model InstanceStatusTron type InstanceStatusTron struct { diff --git a/pkg/paasta_api/models/instance_task.go b/pkg/paasta_api/models/instance_task.go index b7cfd25..b4c1ff5 100644 --- a/pkg/paasta_api/models/instance_task.go +++ b/pkg/paasta_api/models/instance_task.go @@ -6,6 +6,5 @@ package models // Editing this file might prove futile when you re-run the swagger generate command // InstanceTask instance task -// // swagger:model InstanceTask type InstanceTask interface{} diff --git a/pkg/paasta_api/models/instance_tasks.go b/pkg/paasta_api/models/instance_tasks.go index 3f29281..14f5f8a 100644 --- a/pkg/paasta_api/models/instance_tasks.go +++ b/pkg/paasta_api/models/instance_tasks.go @@ -6,11 +6,10 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/strfmt" + strfmt "github.com/go-openapi/strfmt" ) // InstanceTasks List of tasks associated with instance -// // swagger:model InstanceTasks type InstanceTasks []InstanceTask diff --git a/pkg/paasta_api/models/integer_and_error.go b/pkg/paasta_api/models/integer_and_error.go index 61636f3..69b157a 100644 --- a/pkg/paasta_api/models/integer_and_error.go +++ b/pkg/paasta_api/models/integer_and_error.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/strfmt" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) // IntegerAndError integer and error -// // swagger:model IntegerAndError type IntegerAndError struct { diff --git a/pkg/paasta_api/models/kubernetes_pod.go b/pkg/paasta_api/models/kubernetes_pod.go index 648f35d..a17722e 100644 --- a/pkg/paasta_api/models/kubernetes_pod.go +++ b/pkg/paasta_api/models/kubernetes_pod.go @@ -6,48 +6,34 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // KubernetesPod kubernetes pod -// // swagger:model KubernetesPod type KubernetesPod struct { - // containers - Containers []*KubernetesContainer `json:"containers"` - // Time at which the pod was deployed DeployedTimestamp float32 `json:"deployed_timestamp,omitempty"` - // name of the pod's host - Host string `json:"host,omitempty"` - - // long message explaining the pod's state - Message *string `json:"message,omitempty"` - // name of the pod in Kubernetes Name string `json:"name,omitempty"` // The status of the pod Phase string `json:"phase,omitempty"` - // Whether or not the pod is ready (i.e. all containers up) - Ready bool `json:"ready,omitempty"` - - // short message explaining the pod's state - Reason *string `json:"reason,omitempty"` + // Stdout and stderr tail of the task + TailLines *TaskTailLines `json:"tail_lines,omitempty"` } // Validate validates this kubernetes pod func (m *KubernetesPod) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateContainers(formats); err != nil { + if err := m.validateTailLines(formats); err != nil { res = append(res, err) } @@ -57,26 +43,19 @@ func (m *KubernetesPod) Validate(formats strfmt.Registry) error { return nil } -func (m *KubernetesPod) validateContainers(formats strfmt.Registry) error { +func (m *KubernetesPod) validateTailLines(formats strfmt.Registry) error { - if swag.IsZero(m.Containers) { // not required + if swag.IsZero(m.TailLines) { // not required return nil } - for i := 0; i < len(m.Containers); i++ { - if swag.IsZero(m.Containers[i]) { // not required - continue - } - - if m.Containers[i] != nil { - if err := m.Containers[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("containers" + "." + strconv.Itoa(i)) - } - return err + if m.TailLines != nil { + if err := m.TailLines.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tail_lines") } + return err } - } return nil diff --git a/pkg/paasta_api/models/kubernetes_replica_set.go b/pkg/paasta_api/models/kubernetes_replica_set.go index 015b9e4..51ee59d 100644 --- a/pkg/paasta_api/models/kubernetes_replica_set.go +++ b/pkg/paasta_api/models/kubernetes_replica_set.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/strfmt" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) // KubernetesReplicaSet kubernetes replica set -// // swagger:model KubernetesReplicaSet type KubernetesReplicaSet struct { diff --git a/pkg/paasta_api/models/marathon_app_status.go b/pkg/paasta_api/models/marathon_app_status.go index e04b0bc..8b23044 100644 --- a/pkg/paasta_api/models/marathon_app_status.go +++ b/pkg/paasta_api/models/marathon_app_status.go @@ -8,13 +8,13 @@ package models import ( "strconv" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // MarathonAppStatus marathon app status -// // swagger:model MarathonAppStatus type MarathonAppStatus struct { diff --git a/pkg/paasta_api/models/marathon_autoscaling_info.go b/pkg/paasta_api/models/marathon_autoscaling_info.go index cfe69c0..0a7dc2f 100644 --- a/pkg/paasta_api/models/marathon_autoscaling_info.go +++ b/pkg/paasta_api/models/marathon_autoscaling_info.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/strfmt" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) // MarathonAutoscalingInfo marathon autoscaling info -// // swagger:model MarathonAutoscalingInfo type MarathonAutoscalingInfo struct { diff --git a/pkg/paasta_api/models/marathon_dashboard.go b/pkg/paasta_api/models/marathon_dashboard.go index 090d427..412a07f 100644 --- a/pkg/paasta_api/models/marathon_dashboard.go +++ b/pkg/paasta_api/models/marathon_dashboard.go @@ -6,13 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" ) // MarathonDashboard A list of Marathon service, instance, and shard url for one or more clusters -// // swagger:model MarathonDashboard type MarathonDashboard map[string]MarathonDashboardCluster diff --git a/pkg/paasta_api/models/marathon_dashboard_cluster.go b/pkg/paasta_api/models/marathon_dashboard_cluster.go index c72ca00..189a2b6 100644 --- a/pkg/paasta_api/models/marathon_dashboard_cluster.go +++ b/pkg/paasta_api/models/marathon_dashboard_cluster.go @@ -8,13 +8,13 @@ package models import ( "strconv" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // MarathonDashboardCluster List of all the MarathonDashboardItems for a cluster -// // swagger:model MarathonDashboardCluster type MarathonDashboardCluster []*MarathonDashboardItem diff --git a/pkg/paasta_api/models/marathon_dashboard_item.go b/pkg/paasta_api/models/marathon_dashboard_item.go index 7a3d453..eb971e3 100644 --- a/pkg/paasta_api/models/marathon_dashboard_item.go +++ b/pkg/paasta_api/models/marathon_dashboard_item.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/strfmt" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) // MarathonDashboardItem Marathon service, instance, and shard url -// // swagger:model MarathonDashboardItem type MarathonDashboardItem struct { diff --git a/pkg/paasta_api/models/marathon_mesos_nonrunning_task.go b/pkg/paasta_api/models/marathon_mesos_nonrunning_task.go index 79f6711..25c830c 100644 --- a/pkg/paasta_api/models/marathon_mesos_nonrunning_task.go +++ b/pkg/paasta_api/models/marathon_mesos_nonrunning_task.go @@ -6,13 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // MarathonMesosNonrunningTask marathon mesos nonrunning task -// // swagger:model MarathonMesosNonrunningTask type MarathonMesosNonrunningTask struct { diff --git a/pkg/paasta_api/models/marathon_mesos_running_task.go b/pkg/paasta_api/models/marathon_mesos_running_task.go index 0f0f2b1..3e309ed 100644 --- a/pkg/paasta_api/models/marathon_mesos_running_task.go +++ b/pkg/paasta_api/models/marathon_mesos_running_task.go @@ -6,13 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // MarathonMesosRunningTask marathon mesos running task -// // swagger:model MarathonMesosRunningTask type MarathonMesosRunningTask struct { diff --git a/pkg/paasta_api/models/marathon_mesos_status.go b/pkg/paasta_api/models/marathon_mesos_status.go index 2fcffac..789987f 100644 --- a/pkg/paasta_api/models/marathon_mesos_status.go +++ b/pkg/paasta_api/models/marathon_mesos_status.go @@ -8,13 +8,13 @@ package models import ( "strconv" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // MarathonMesosStatus marathon mesos status -// // swagger:model MarathonMesosStatus type MarathonMesosStatus struct { diff --git a/pkg/paasta_api/models/marathon_task.go b/pkg/paasta_api/models/marathon_task.go index 903c1f0..cf05c3a 100644 --- a/pkg/paasta_api/models/marathon_task.go +++ b/pkg/paasta_api/models/marathon_task.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/strfmt" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) // MarathonTask marathon task -// // swagger:model MarathonTask type MarathonTask struct { diff --git a/pkg/paasta_api/models/meta_status.go b/pkg/paasta_api/models/meta_status.go index 3257987..c841ee1 100644 --- a/pkg/paasta_api/models/meta_status.go +++ b/pkg/paasta_api/models/meta_status.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/strfmt" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) // MetaStatus Result of `paasta metastatus` command -// // swagger:model MetaStatus type MetaStatus struct { diff --git a/pkg/paasta_api/models/resource.go b/pkg/paasta_api/models/resource.go index aa529c6..0aa7fd2 100644 --- a/pkg/paasta_api/models/resource.go +++ b/pkg/paasta_api/models/resource.go @@ -8,13 +8,13 @@ package models import ( "strconv" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // Resource resource -// // swagger:model Resource type Resource []*ResourceItem diff --git a/pkg/paasta_api/models/resource_item.go b/pkg/paasta_api/models/resource_item.go index b63b20b..eb2b4ac 100644 --- a/pkg/paasta_api/models/resource_item.go +++ b/pkg/paasta_api/models/resource_item.go @@ -6,13 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // ResourceItem resource item -// // swagger:model ResourceItem type ResourceItem struct { diff --git a/pkg/paasta_api/models/resource_value.go b/pkg/paasta_api/models/resource_value.go index 4569060..8caf8d9 100644 --- a/pkg/paasta_api/models/resource_value.go +++ b/pkg/paasta_api/models/resource_value.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/strfmt" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) // ResourceValue resource value -// // swagger:model ResourceValue type ResourceValue struct { diff --git a/pkg/paasta_api/models/smartstack_backend.go b/pkg/paasta_api/models/smartstack_backend.go index 74301d4..6a23c4f 100644 --- a/pkg/paasta_api/models/smartstack_backend.go +++ b/pkg/paasta_api/models/smartstack_backend.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/strfmt" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) // SmartstackBackend smartstack backend -// // swagger:model SmartstackBackend type SmartstackBackend struct { diff --git a/pkg/paasta_api/models/smartstack_location.go b/pkg/paasta_api/models/smartstack_location.go index fdc8b13..dd6b923 100644 --- a/pkg/paasta_api/models/smartstack_location.go +++ b/pkg/paasta_api/models/smartstack_location.go @@ -8,13 +8,13 @@ package models import ( "strconv" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // SmartstackLocation smartstack location -// // swagger:model SmartstackLocation type SmartstackLocation struct { diff --git a/pkg/paasta_api/models/smartstack_status.go b/pkg/paasta_api/models/smartstack_status.go index 15f963e..843f61a 100644 --- a/pkg/paasta_api/models/smartstack_status.go +++ b/pkg/paasta_api/models/smartstack_status.go @@ -8,13 +8,13 @@ package models import ( "strconv" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // SmartstackStatus smartstack status -// // swagger:model SmartstackStatus type SmartstackStatus struct { diff --git a/pkg/paasta_api/models/task_tail_lines.go b/pkg/paasta_api/models/task_tail_lines.go index 1166d9d..df41463 100644 --- a/pkg/paasta_api/models/task_tail_lines.go +++ b/pkg/paasta_api/models/task_tail_lines.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/strfmt" + strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) // TaskTailLines task tail lines -// // swagger:model TaskTailLines type TaskTailLines struct { diff --git a/swagger.json b/swagger.json index 286ca37..69758a7 100644 --- a/swagger.json +++ b/swagger.json @@ -65,20 +65,6 @@ "operationId": "metastatus" } }, - "/deploy_queue": { - "get": { - "responses": { - "200": { - "description": "Contents of deploy queue", - "schema": { - "$ref": "#/definitions/DeployQueue" - } - } - }, - "summary": "Get deploy queue contents", - "operationId": "deploy_queue" - } - }, "/service_autoscaler/pause": { "get": { "responses": { @@ -208,7 +194,9 @@ "type": "array", "items": { "type": "array", - "items": {} + "items": { + "type": "object" + } } } } @@ -350,13 +338,6 @@ "required": false, "type": "boolean" }, - { - "in": "query", - "description": "Include Envoy information", - "name": "include_envoy", - "required": false, - "type": "boolean" - }, { "in": "query", "description": "Include Mesos information", @@ -670,18 +651,6 @@ } }, "description": "Nullable Flink instance status and metadata" - }, - "kafkacluster": { - "type": "object", - "properties": { - "status": { - "$ref": "#/definitions/InstanceStatusKafkaCluster" - }, - "metadata": { - "$ref": "#/definitions/InstanceMetadataKafkaCluster" - } - }, - "description": "Nullable KafkaCluster instance status and metadata" } } }, @@ -765,10 +734,6 @@ "$ref": "#/definitions/SmartstackStatus", "description": "Status of the service in smartstack" }, - "envoy": { - "$ref": "#/definitions/EnvoyStatus", - "description": "Status of the service in Envoy" - }, "error_message": { "type": "string", "description": "Error message when a marathon job ID cannot be found" @@ -1093,83 +1058,6 @@ } } }, - "EnvoyStatus": { - "type": "object", - "properties": { - "registration": { - "type": "string", - "description": "Registration name of the service in Smartstack" - }, - "expected_backends_per_location": { - "type": "integer", - "format": "int32", - "description": "Number of backends expected to be present in each location" - }, - "locations": { - "type": "array", - "description": "Locations the service is deployed", - "items": { - "$ref": "#/definitions/EnvoyLocation" - } - } - } - }, - "EnvoyLocation": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the location" - }, - "running_backends_count": { - "type": "integer", - "format": "int32", - "description": "Number of running backends for the service in this location" - }, - "backends": { - "type": "array", - "description": "Envoy backends running in this location", - "items": { - "$ref": "#/definitions/EnvoyBackend" - } - }, - "is_proxied_through_casper": { - "type": "boolean", - "description": "Whether this backend is proxied through Casper" - } - } - }, - "EnvoyBackend": { - "type": "object", - "properties": { - "address": { - "type": "string", - "description": "Address of the host on which the backend is running" - }, - "port_value": { - "type": "integer", - "format": "int32", - "description": "Port number on which the backend responds" - }, - "hostname": { - "type": "string", - "description": "Name of the host on which the backend is running" - }, - "eds_health_status": { - "type": "string", - "description": "Status of the backend in Envoy as reported by the EDS" - }, - "weight": { - "type": "integer", - "format": "int32", - "description": "The weight of this backend in the cluster" - }, - "has_associated_task": { - "type": "boolean", - "description": "Whether this backend has an associated task running" - } - } - }, "InstanceStatusKubernetes": { "type": "object", "properties": { @@ -1212,10 +1100,6 @@ "NotRunning" ] }, - "deploy_status_message": { - "type": "string", - "description": "Reason for the deploy status" - }, "backoff_seconds": { "type": "integer", "format": "int32", @@ -1258,35 +1142,6 @@ "$ref": "#/definitions/KubernetesPod" } }, - "autoscaling_status": { - "type": "object", - "description": "HPA associated to this app", - "properties": { - "min_instances": { - "type": "integer", - "description": "min_instances as specified in yelpsoa_configs" - }, - "max_instances": { - "type": "integer", - "description": "min_instances as specified in yelpsoa_configs" - }, - "desired_replicas": { - "type": "integer", - "description": "desired number of _instances as calculated by HPA" - }, - "last_scale_time": { - "type": "string", - "description": "timestamp of last autoscale" - }, - "metrics": { - "type": "array", - "description": "Current metrics", - "items": { - "$ref": "#/definitions/HPAMetric" - } - } - } - }, "error_message": { "type": "string", "description": "Error message when a kubernetes object (Deployment/Statefulset) cannot be found" @@ -1298,23 +1153,6 @@ "bounce_method" ] }, - "HPAMetric": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "name of the metric" - }, - "target_value": { - "type": "string", - "description": "setpoint/target_value as specified in yelpsoa_configs" - }, - "current_value": { - "type": "string", - "description": "setpoint/target_value as specified in yelpsoa_configs" - } - } - }, "KubernetesReplicaSet": { "type": "object", "properties": { @@ -1346,10 +1184,6 @@ "type": "string", "description": "name of the pod in Kubernetes" }, - "host": { - "type": "string", - "description": "name of the pod's host" - }, "deployed_timestamp": { "type": "number", "format": "float", @@ -1359,39 +1193,9 @@ "type": "string", "description": "The status of the pod" }, - "ready": { - "type": "boolean", - "description": "Whether or not the pod is ready (i.e. all containers up)" - }, - "containers": { - "type": "array", - "items": { - "$ref": "#/definitions/KubernetesContainer", - "description": "List of containers in the pod" - } - }, - "reason": { - "type": "string", - "x-nullable": true, - "description": "short message explaining the pod's state" - }, - "message": { - "type": "string", - "x-nullable": true, - "description": "long message explaining the pod's state" - } - } - }, - "KubernetesContainer": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the container" - }, "tail_lines": { "$ref": "#/definitions/TaskTailLines", - "description": "Stdout and stderr tail of the container" + "description": "Stdout and stderr tail of the task" } } }, @@ -1456,18 +1260,6 @@ "type": "object", "description": "Flink instance metadata" }, - "InstanceStatusKafkaCluster": { - "type": "object", - "description": "Kafka instance status" - }, - "InstanceMetadataKafkaCluster": { - "type": "object", - "description": "Kafka instance metadata" - }, - "InstanceSpecKafkaCluster": { - "type": "object", - "description": "Kafka instance spec" - }, "InstanceTasks": { "type": "array", "description": "List of tasks associated with instance", @@ -1549,74 +1341,6 @@ } } }, - "DeployQueue": { - "type": "object", - "description": "Current state of the deployd queue", - "properties": { - "available_service_instances": { - "type": "array", - "description": "Service instances that are ready to be acted on by deployd", - "items": { - "$ref": "#/definitions/DeployQueueServiceInstance" - } - }, - "unavailable_service_instances": { - "type": "array", - "description": "Service instances that deployd is waiting to act on", - "items": { - "$ref": "#/definitions/DeployQueueServiceInstance" - } - } - } - }, - "DeployQueueServiceInstance": { - "type": "object", - "description": "An instance of a service in the deploy queue", - "properties": { - "service": { - "type": "string", - "description": "Name of the service" - }, - "instance": { - "type": "string", - "description": "Name of the instance of the service" - }, - "bounce_by": { - "type": "number", - "format": "float", - "description": "Desired timestamp by which the service instance should be bounced" - }, - "wait_until": { - "type": "number", - "format": "float", - "description": "Timestamp before which no action should be taken on this service instance" - }, - "enqueue_time": { - "type": "number", - "format": "float", - "description": "Timestamp at which the service instance was last added to the queue" - }, - "bounce_start_time": { - "type": "number", - "format": "float", - "description": "Timestamp at which service instance was first added to the queue" - }, - "watcher": { - "type": "string", - "description": "The process that enqueued the task" - }, - "failures": { - "type": "integer", - "format": "int32", - "description": "Number of times deployment actions have failed on this service instance" - }, - "processed_count": { - "type": "integer", - "format": "int32", - "description": "Number of times any deployment action has been taken on this service instance" - } - } - }, "Resource": { "type": "array", "items": { From 9efa7f5470b1bd6f79195f2ffde93fda71e873e1 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Thu, 23 Apr 2020 16:05:09 -0700 Subject: [PATCH 22/38] add make gen-paasta-api target, regenerate paasta-api --- Makefile | 9 ++--- .../client/autoscaler/autoscaler_client.go | 18 ++++++--- .../get_autoscaler_count_parameters.go | 3 +- .../get_autoscaler_count_responses.go | 3 +- .../update_autoscaler_count_parameters.go | 3 +- .../update_autoscaler_count_responses.go | 3 +- .../marathon_dashboard_client.go | 14 +++++-- .../marathon_dashboard_parameters.go | 3 +- .../marathon_dashboard_responses.go | 5 +-- ...ete_service_autoscaler_pause_parameters.go | 3 +- ...lete_service_autoscaler_pause_responses.go | 3 +- ...get_service_autoscaler_pause_parameters.go | 3 +- .../get_service_autoscaler_pause_responses.go | 3 +- .../operations/metastatus_parameters.go | 3 +- .../client/operations/metastatus_responses.go | 5 +-- .../client/operations/operations_client.go | 30 +++++++++++---- .../operations/show_version_parameters.go | 3 +- .../operations/show_version_responses.go | 3 +- ...ate_service_autoscaler_pause_parameters.go | 3 +- ...date_service_autoscaler_pause_responses.go | 3 +- pkg/paasta_api/client/paasta_client.go | 25 +++--------- .../client/resources/resources_client.go | 14 +++++-- .../client/resources/resources_parameters.go | 3 +- .../client/resources/resources_responses.go | 5 +-- .../service/delay_instance_parameters.go | 3 +- .../service/delay_instance_responses.go | 5 +-- .../service/instance_set_state_parameters.go | 3 +- .../service/instance_set_state_responses.go | 3 +- .../service/list_instances_parameters.go | 3 +- .../service/list_instances_responses.go | 3 +- .../list_services_for_cluster_parameters.go | 3 +- .../list_services_for_cluster_responses.go | 3 +- .../client/service/service_client.go | 38 ++++++++++++++----- .../service/status_instance_parameters.go | 3 +- .../service/status_instance_responses.go | 5 +-- .../service/task_instance_parameters.go | 3 +- .../client/service/task_instance_responses.go | 5 +-- .../service/tasks_instance_parameters.go | 3 +- .../service/tasks_instance_responses.go | 5 +-- pkg/paasta_api/models/adhoc_launch_history.go | 4 +- pkg/paasta_api/models/float_and_error.go | 4 +- pkg/paasta_api/models/instance_delay.go | 1 + .../models/instance_metadata_flink.go | 1 + pkg/paasta_api/models/instance_status.go | 5 ++- .../models/instance_status_adhoc.go | 4 +- .../models/instance_status_flink.go | 1 + .../models/instance_status_kubernetes.go | 4 +- .../models/instance_status_marathon.go | 4 +- pkg/paasta_api/models/instance_status_tron.go | 4 +- pkg/paasta_api/models/instance_task.go | 1 + pkg/paasta_api/models/instance_tasks.go | 3 +- pkg/paasta_api/models/integer_and_error.go | 4 +- pkg/paasta_api/models/kubernetes_pod.go | 4 +- .../models/kubernetes_replica_set.go | 4 +- pkg/paasta_api/models/marathon_app_status.go | 4 +- .../models/marathon_autoscaling_info.go | 4 +- pkg/paasta_api/models/marathon_dashboard.go | 4 +- .../models/marathon_dashboard_cluster.go | 4 +- .../models/marathon_dashboard_item.go | 4 +- .../models/marathon_mesos_nonrunning_task.go | 4 +- .../models/marathon_mesos_running_task.go | 4 +- .../models/marathon_mesos_status.go | 4 +- pkg/paasta_api/models/marathon_task.go | 4 +- pkg/paasta_api/models/meta_status.go | 4 +- pkg/paasta_api/models/resource.go | 4 +- pkg/paasta_api/models/resource_item.go | 4 +- pkg/paasta_api/models/resource_value.go | 4 +- pkg/paasta_api/models/smartstack_backend.go | 4 +- pkg/paasta_api/models/smartstack_location.go | 4 +- pkg/paasta_api/models/smartstack_status.go | 4 +- pkg/paasta_api/models/task_tail_lines.go | 4 +- 71 files changed, 192 insertions(+), 182 deletions(-) diff --git a/Makefile b/Makefile index 1f3642c..a2e2efb 100644 --- a/Makefile +++ b/Makefile @@ -47,13 +47,10 @@ itest_%: deb_% @echo "Built package for $*" gen-paasta-api: - rm -rf pkg/paasta_api/* - curl -o swagger.json https://raw.githubusercontent.com/Yelp/paasta/master/paasta_tools/api/api_docs/swagger.json docker run \ - --rm -it \ - --user "$$(id -u):$$(id -g)" \ + --rm \ + -it \ -e GOPATH=$$HOME/go:/go \ -v $$HOME:$$HOME \ -w $$(pwd) quay.io/goswagger/swagger \ - generate client -f ./swagger.json -t pkg/paasta_api - @echo "Do not forget to `git add` and `git commit` updated swagger.json and paasta-api" + generate client -f ./swagger.json -t pkg/paasta_api \ No newline at end of file diff --git a/pkg/paasta_api/client/autoscaler/autoscaler_client.go b/pkg/paasta_api/client/autoscaler/autoscaler_client.go index 3acf8c5..723b895 100644 --- a/pkg/paasta_api/client/autoscaler/autoscaler_client.go +++ b/pkg/paasta_api/client/autoscaler/autoscaler_client.go @@ -9,12 +9,11 @@ import ( "fmt" "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // New creates a new autoscaler API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -26,8 +25,17 @@ type Client struct { formats strfmt.Registry } +// ClientService is the interface for Client methods +type ClientService interface { + GetAutoscalerCount(params *GetAutoscalerCountParams) (*GetAutoscalerCountOK, error) + + UpdateAutoscalerCount(params *UpdateAutoscalerCountParams) (*UpdateAutoscalerCountAccepted, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -GetAutoscalerCount gets status of service name instance name + GetAutoscalerCount gets status of service name instance name */ func (a *Client) GetAutoscalerCount(params *GetAutoscalerCountParams) (*GetAutoscalerCountOK, error) { // TODO: Validate the params before sending @@ -61,7 +69,7 @@ func (a *Client) GetAutoscalerCount(params *GetAutoscalerCountParams) (*GetAutos } /* -UpdateAutoscalerCount gets status of service name instance name + UpdateAutoscalerCount gets status of service name instance name */ func (a *Client) UpdateAutoscalerCount(params *UpdateAutoscalerCountParams) (*UpdateAutoscalerCountAccepted, error) { // TODO: Validate the params before sending diff --git a/pkg/paasta_api/client/autoscaler/get_autoscaler_count_parameters.go b/pkg/paasta_api/client/autoscaler/get_autoscaler_count_parameters.go index b4a3ff3..df8c045 100644 --- a/pkg/paasta_api/client/autoscaler/get_autoscaler_count_parameters.go +++ b/pkg/paasta_api/client/autoscaler/get_autoscaler_count_parameters.go @@ -13,8 +13,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // NewGetAutoscalerCountParams creates a new GetAutoscalerCountParams object diff --git a/pkg/paasta_api/client/autoscaler/get_autoscaler_count_responses.go b/pkg/paasta_api/client/autoscaler/get_autoscaler_count_responses.go index 878d32d..3530321 100644 --- a/pkg/paasta_api/client/autoscaler/get_autoscaler_count_responses.go +++ b/pkg/paasta_api/client/autoscaler/get_autoscaler_count_responses.go @@ -10,9 +10,8 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" ) // GetAutoscalerCountReader is a Reader for the GetAutoscalerCount structure. diff --git a/pkg/paasta_api/client/autoscaler/update_autoscaler_count_parameters.go b/pkg/paasta_api/client/autoscaler/update_autoscaler_count_parameters.go index a6154d9..4e4e1dc 100644 --- a/pkg/paasta_api/client/autoscaler/update_autoscaler_count_parameters.go +++ b/pkg/paasta_api/client/autoscaler/update_autoscaler_count_parameters.go @@ -13,8 +13,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // NewUpdateAutoscalerCountParams creates a new UpdateAutoscalerCountParams object diff --git a/pkg/paasta_api/client/autoscaler/update_autoscaler_count_responses.go b/pkg/paasta_api/client/autoscaler/update_autoscaler_count_responses.go index 6b56bc7..fc7be49 100644 --- a/pkg/paasta_api/client/autoscaler/update_autoscaler_count_responses.go +++ b/pkg/paasta_api/client/autoscaler/update_autoscaler_count_responses.go @@ -10,9 +10,8 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" ) // UpdateAutoscalerCountReader is a Reader for the UpdateAutoscalerCount structure. diff --git a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_client.go b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_client.go index 0308f24..986e590 100644 --- a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_client.go +++ b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_client.go @@ -9,12 +9,11 @@ import ( "fmt" "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // New creates a new marathon dashboard API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -26,8 +25,15 @@ type Client struct { formats strfmt.Registry } +// ClientService is the interface for Client methods +type ClientService interface { + MarathonDashboard(params *MarathonDashboardParams) (*MarathonDashboardOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -MarathonDashboard gets marathon service instances and their shards + MarathonDashboard gets marathon service instances and their shards */ func (a *Client) MarathonDashboard(params *MarathonDashboardParams) (*MarathonDashboardOK, error) { // TODO: Validate the params before sending diff --git a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_parameters.go b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_parameters.go index 3d70025..67d5f61 100644 --- a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_parameters.go +++ b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_parameters.go @@ -13,8 +13,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // NewMarathonDashboardParams creates a new MarathonDashboardParams object diff --git a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_responses.go b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_responses.go index 3266038..b474020 100644 --- a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_responses.go +++ b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" ) // MarathonDashboardReader is a Reader for the MarathonDashboard structure. diff --git a/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_parameters.go b/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_parameters.go index f10c0e3..999782b 100644 --- a/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_parameters.go +++ b/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_parameters.go @@ -13,8 +13,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // NewDeleteServiceAutoscalerPauseParams creates a new DeleteServiceAutoscalerPauseParams object diff --git a/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_responses.go b/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_responses.go index a8aae1b..d41f68f 100644 --- a/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_responses.go +++ b/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_responses.go @@ -9,8 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // DeleteServiceAutoscalerPauseReader is a Reader for the DeleteServiceAutoscalerPause structure. diff --git a/pkg/paasta_api/client/operations/get_service_autoscaler_pause_parameters.go b/pkg/paasta_api/client/operations/get_service_autoscaler_pause_parameters.go index 9a34603..e00dd1b 100644 --- a/pkg/paasta_api/client/operations/get_service_autoscaler_pause_parameters.go +++ b/pkg/paasta_api/client/operations/get_service_autoscaler_pause_parameters.go @@ -13,8 +13,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // NewGetServiceAutoscalerPauseParams creates a new GetServiceAutoscalerPauseParams object diff --git a/pkg/paasta_api/client/operations/get_service_autoscaler_pause_responses.go b/pkg/paasta_api/client/operations/get_service_autoscaler_pause_responses.go index e44c15c..5e0eda9 100644 --- a/pkg/paasta_api/client/operations/get_service_autoscaler_pause_responses.go +++ b/pkg/paasta_api/client/operations/get_service_autoscaler_pause_responses.go @@ -10,8 +10,7 @@ import ( "io" "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // GetServiceAutoscalerPauseReader is a Reader for the GetServiceAutoscalerPause structure. diff --git a/pkg/paasta_api/client/operations/metastatus_parameters.go b/pkg/paasta_api/client/operations/metastatus_parameters.go index a1da149..3448fcd 100644 --- a/pkg/paasta_api/client/operations/metastatus_parameters.go +++ b/pkg/paasta_api/client/operations/metastatus_parameters.go @@ -13,9 +13,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" ) // NewMetastatusParams creates a new MetastatusParams object diff --git a/pkg/paasta_api/client/operations/metastatus_responses.go b/pkg/paasta_api/client/operations/metastatus_responses.go index 9b13b95..60f309a 100644 --- a/pkg/paasta_api/client/operations/metastatus_responses.go +++ b/pkg/paasta_api/client/operations/metastatus_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" ) // MetastatusReader is a Reader for the Metastatus structure. diff --git a/pkg/paasta_api/client/operations/operations_client.go b/pkg/paasta_api/client/operations/operations_client.go index 280a503..d2dbe48 100644 --- a/pkg/paasta_api/client/operations/operations_client.go +++ b/pkg/paasta_api/client/operations/operations_client.go @@ -9,12 +9,11 @@ import ( "fmt" "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // New creates a new operations API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -26,8 +25,23 @@ type Client struct { formats strfmt.Registry } +// ClientService is the interface for Client methods +type ClientService interface { + DeleteServiceAutoscalerPause(params *DeleteServiceAutoscalerPauseParams) (*DeleteServiceAutoscalerPauseOK, error) + + GetServiceAutoscalerPause(params *GetServiceAutoscalerPauseParams) (*GetServiceAutoscalerPauseOK, error) + + Metastatus(params *MetastatusParams) (*MetastatusOK, error) + + ShowVersion(params *ShowVersionParams) (*ShowVersionOK, error) + + UpdateServiceAutoscalerPause(params *UpdateServiceAutoscalerPauseParams) (*UpdateServiceAutoscalerPauseOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -DeleteServiceAutoscalerPause unpauses the autoscaler + DeleteServiceAutoscalerPause unpauses the autoscaler */ func (a *Client) DeleteServiceAutoscalerPause(params *DeleteServiceAutoscalerPauseParams) (*DeleteServiceAutoscalerPauseOK, error) { // TODO: Validate the params before sending @@ -61,7 +75,7 @@ func (a *Client) DeleteServiceAutoscalerPause(params *DeleteServiceAutoscalerPau } /* -GetServiceAutoscalerPause gets autoscaling pause time + GetServiceAutoscalerPause gets autoscaling pause time */ func (a *Client) GetServiceAutoscalerPause(params *GetServiceAutoscalerPauseParams) (*GetServiceAutoscalerPauseOK, error) { // TODO: Validate the params before sending @@ -95,7 +109,7 @@ func (a *Client) GetServiceAutoscalerPause(params *GetServiceAutoscalerPausePara } /* -Metastatus gets metastatus + Metastatus gets metastatus */ func (a *Client) Metastatus(params *MetastatusParams) (*MetastatusOK, error) { // TODO: Validate the params before sending @@ -129,7 +143,7 @@ func (a *Client) Metastatus(params *MetastatusParams) (*MetastatusOK, error) { } /* -ShowVersion versions of paasta tools package + ShowVersion versions of paasta tools package */ func (a *Client) ShowVersion(params *ShowVersionParams) (*ShowVersionOK, error) { // TODO: Validate the params before sending @@ -163,7 +177,7 @@ func (a *Client) ShowVersion(params *ShowVersionParams) (*ShowVersionOK, error) } /* -UpdateServiceAutoscalerPause update service autoscaler pause API + UpdateServiceAutoscalerPause update service autoscaler pause API */ func (a *Client) UpdateServiceAutoscalerPause(params *UpdateServiceAutoscalerPauseParams) (*UpdateServiceAutoscalerPauseOK, error) { // TODO: Validate the params before sending diff --git a/pkg/paasta_api/client/operations/show_version_parameters.go b/pkg/paasta_api/client/operations/show_version_parameters.go index 869ff46..a8b181a 100644 --- a/pkg/paasta_api/client/operations/show_version_parameters.go +++ b/pkg/paasta_api/client/operations/show_version_parameters.go @@ -13,8 +13,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // NewShowVersionParams creates a new ShowVersionParams object diff --git a/pkg/paasta_api/client/operations/show_version_responses.go b/pkg/paasta_api/client/operations/show_version_responses.go index e141f44..bd7c8f7 100644 --- a/pkg/paasta_api/client/operations/show_version_responses.go +++ b/pkg/paasta_api/client/operations/show_version_responses.go @@ -10,8 +10,7 @@ import ( "io" "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // ShowVersionReader is a Reader for the ShowVersion structure. diff --git a/pkg/paasta_api/client/operations/update_service_autoscaler_pause_parameters.go b/pkg/paasta_api/client/operations/update_service_autoscaler_pause_parameters.go index bcf91dd..5fb998d 100644 --- a/pkg/paasta_api/client/operations/update_service_autoscaler_pause_parameters.go +++ b/pkg/paasta_api/client/operations/update_service_autoscaler_pause_parameters.go @@ -13,8 +13,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // NewUpdateServiceAutoscalerPauseParams creates a new UpdateServiceAutoscalerPauseParams object diff --git a/pkg/paasta_api/client/operations/update_service_autoscaler_pause_responses.go b/pkg/paasta_api/client/operations/update_service_autoscaler_pause_responses.go index 24036f4..4496259 100644 --- a/pkg/paasta_api/client/operations/update_service_autoscaler_pause_responses.go +++ b/pkg/paasta_api/client/operations/update_service_autoscaler_pause_responses.go @@ -9,9 +9,8 @@ import ( "fmt" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" ) // UpdateServiceAutoscalerPauseReader is a Reader for the UpdateServiceAutoscalerPause structure. diff --git a/pkg/paasta_api/client/paasta_client.go b/pkg/paasta_api/client/paasta_client.go index cbb8be8..4668e19 100644 --- a/pkg/paasta_api/client/paasta_client.go +++ b/pkg/paasta_api/client/paasta_client.go @@ -8,8 +8,7 @@ package client import ( "github.com/go-openapi/runtime" httptransport "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/autoscaler" "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/marathon_dashboard" @@ -60,17 +59,11 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Paasta { cli := new(Paasta) cli.Transport = transport - cli.Autoscaler = autoscaler.New(transport, formats) - cli.MarathonDashboard = marathon_dashboard.New(transport, formats) - cli.Operations = operations.New(transport, formats) - cli.Resources = resources.New(transport, formats) - cli.Service = service.New(transport, formats) - return cli } @@ -115,15 +108,15 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { // Paasta is a client for paasta type Paasta struct { - Autoscaler *autoscaler.Client + Autoscaler autoscaler.ClientService - MarathonDashboard *marathon_dashboard.Client + MarathonDashboard marathon_dashboard.ClientService - Operations *operations.Client + Operations operations.ClientService - Resources *resources.Client + Resources resources.ClientService - Service *service.Client + Service service.ClientService Transport runtime.ClientTransport } @@ -131,15 +124,9 @@ type Paasta struct { // SetTransport changes the transport on the client and all its subresources func (c *Paasta) SetTransport(transport runtime.ClientTransport) { c.Transport = transport - c.Autoscaler.SetTransport(transport) - c.MarathonDashboard.SetTransport(transport) - c.Operations.SetTransport(transport) - c.Resources.SetTransport(transport) - c.Service.SetTransport(transport) - } diff --git a/pkg/paasta_api/client/resources/resources_client.go b/pkg/paasta_api/client/resources/resources_client.go index d882f67..94639f3 100644 --- a/pkg/paasta_api/client/resources/resources_client.go +++ b/pkg/paasta_api/client/resources/resources_client.go @@ -9,12 +9,11 @@ import ( "fmt" "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // New creates a new resources API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -26,8 +25,15 @@ type Client struct { formats strfmt.Registry } +// ClientService is the interface for Client methods +type ClientService interface { + Resources(params *ResourcesParams) (*ResourcesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -Resources gets resources in the cluster + Resources gets resources in the cluster */ func (a *Client) Resources(params *ResourcesParams) (*ResourcesOK, error) { // TODO: Validate the params before sending diff --git a/pkg/paasta_api/client/resources/resources_parameters.go b/pkg/paasta_api/client/resources/resources_parameters.go index b4a7779..48a697f 100644 --- a/pkg/paasta_api/client/resources/resources_parameters.go +++ b/pkg/paasta_api/client/resources/resources_parameters.go @@ -13,9 +13,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" ) // NewResourcesParams creates a new ResourcesParams object diff --git a/pkg/paasta_api/client/resources/resources_responses.go b/pkg/paasta_api/client/resources/resources_responses.go index 10ccea3..e82b82e 100644 --- a/pkg/paasta_api/client/resources/resources_responses.go +++ b/pkg/paasta_api/client/resources/resources_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" ) // ResourcesReader is a Reader for the Resources structure. diff --git a/pkg/paasta_api/client/service/delay_instance_parameters.go b/pkg/paasta_api/client/service/delay_instance_parameters.go index 20e0fe6..3b90c31 100644 --- a/pkg/paasta_api/client/service/delay_instance_parameters.go +++ b/pkg/paasta_api/client/service/delay_instance_parameters.go @@ -13,8 +13,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // NewDelayInstanceParams creates a new DelayInstanceParams object diff --git a/pkg/paasta_api/client/service/delay_instance_responses.go b/pkg/paasta_api/client/service/delay_instance_responses.go index e13aa33..eb5d10a 100644 --- a/pkg/paasta_api/client/service/delay_instance_responses.go +++ b/pkg/paasta_api/client/service/delay_instance_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" ) // DelayInstanceReader is a Reader for the DelayInstance structure. diff --git a/pkg/paasta_api/client/service/instance_set_state_parameters.go b/pkg/paasta_api/client/service/instance_set_state_parameters.go index 5621478..3359d4e 100644 --- a/pkg/paasta_api/client/service/instance_set_state_parameters.go +++ b/pkg/paasta_api/client/service/instance_set_state_parameters.go @@ -13,8 +13,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // NewInstanceSetStateParams creates a new InstanceSetStateParams object diff --git a/pkg/paasta_api/client/service/instance_set_state_responses.go b/pkg/paasta_api/client/service/instance_set_state_responses.go index 791f88d..d5a8496 100644 --- a/pkg/paasta_api/client/service/instance_set_state_responses.go +++ b/pkg/paasta_api/client/service/instance_set_state_responses.go @@ -9,8 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // InstanceSetStateReader is a Reader for the InstanceSetState structure. diff --git a/pkg/paasta_api/client/service/list_instances_parameters.go b/pkg/paasta_api/client/service/list_instances_parameters.go index a852ceb..e36e755 100644 --- a/pkg/paasta_api/client/service/list_instances_parameters.go +++ b/pkg/paasta_api/client/service/list_instances_parameters.go @@ -13,8 +13,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // NewListInstancesParams creates a new ListInstancesParams object diff --git a/pkg/paasta_api/client/service/list_instances_responses.go b/pkg/paasta_api/client/service/list_instances_responses.go index 80a9298..0ca8f18 100644 --- a/pkg/paasta_api/client/service/list_instances_responses.go +++ b/pkg/paasta_api/client/service/list_instances_responses.go @@ -10,9 +10,8 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" ) // ListInstancesReader is a Reader for the ListInstances structure. diff --git a/pkg/paasta_api/client/service/list_services_for_cluster_parameters.go b/pkg/paasta_api/client/service/list_services_for_cluster_parameters.go index e1153d1..d2c6416 100644 --- a/pkg/paasta_api/client/service/list_services_for_cluster_parameters.go +++ b/pkg/paasta_api/client/service/list_services_for_cluster_parameters.go @@ -13,8 +13,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // NewListServicesForClusterParams creates a new ListServicesForClusterParams object diff --git a/pkg/paasta_api/client/service/list_services_for_cluster_responses.go b/pkg/paasta_api/client/service/list_services_for_cluster_responses.go index 4e037e8..d17c09b 100644 --- a/pkg/paasta_api/client/service/list_services_for_cluster_responses.go +++ b/pkg/paasta_api/client/service/list_services_for_cluster_responses.go @@ -10,9 +10,8 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" ) // ListServicesForClusterReader is a Reader for the ListServicesForCluster structure. diff --git a/pkg/paasta_api/client/service/service_client.go b/pkg/paasta_api/client/service/service_client.go index 3f103cb..0edf5a3 100644 --- a/pkg/paasta_api/client/service/service_client.go +++ b/pkg/paasta_api/client/service/service_client.go @@ -9,12 +9,11 @@ import ( "fmt" "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // New creates a new service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -26,8 +25,27 @@ type Client struct { formats strfmt.Registry } +// ClientService is the interface for Client methods +type ClientService interface { + DelayInstance(params *DelayInstanceParams) (*DelayInstanceOK, *DelayInstanceNoContent, error) + + InstanceSetState(params *InstanceSetStateParams) (*InstanceSetStateOK, error) + + ListInstances(params *ListInstancesParams) (*ListInstancesOK, error) + + ListServicesForCluster(params *ListServicesForClusterParams) (*ListServicesForClusterOK, error) + + StatusInstance(params *StatusInstanceParams) (*StatusInstanceOK, error) + + TaskInstance(params *TaskInstanceParams) (*TaskInstanceOK, error) + + TasksInstance(params *TasksInstanceParams) (*TasksInstanceOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -DelayInstance gets the possible reasons for a deployment delay for a marathon service instance + DelayInstance gets the possible reasons for a deployment delay for a marathon service instance */ func (a *Client) DelayInstance(params *DelayInstanceParams) (*DelayInstanceOK, *DelayInstanceNoContent, error) { // TODO: Validate the params before sending @@ -62,7 +80,7 @@ func (a *Client) DelayInstance(params *DelayInstanceParams) (*DelayInstanceOK, * } /* -InstanceSetState changes state of service name instance name + InstanceSetState changes state of service name instance name */ func (a *Client) InstanceSetState(params *InstanceSetStateParams) (*InstanceSetStateOK, error) { // TODO: Validate the params before sending @@ -96,7 +114,7 @@ func (a *Client) InstanceSetState(params *InstanceSetStateParams) (*InstanceSetS } /* -ListInstances lists instances of service name + ListInstances lists instances of service name */ func (a *Client) ListInstances(params *ListInstancesParams) (*ListInstancesOK, error) { // TODO: Validate the params before sending @@ -130,7 +148,7 @@ func (a *Client) ListInstances(params *ListInstancesParams) (*ListInstancesOK, e } /* -ListServicesForCluster lists service names and service instance names on the current cluster + ListServicesForCluster lists service names and service instance names on the current cluster */ func (a *Client) ListServicesForCluster(params *ListServicesForClusterParams) (*ListServicesForClusterOK, error) { // TODO: Validate the params before sending @@ -164,7 +182,7 @@ func (a *Client) ListServicesForCluster(params *ListServicesForClusterParams) (* } /* -StatusInstance gets status of service name instance name + StatusInstance gets status of service name instance name */ func (a *Client) StatusInstance(params *StatusInstanceParams) (*StatusInstanceOK, error) { // TODO: Validate the params before sending @@ -198,7 +216,7 @@ func (a *Client) StatusInstance(params *StatusInstanceParams) (*StatusInstanceOK } /* -TaskInstance gets mesos task of service name instance name by task id + TaskInstance gets mesos task of service name instance name by task id */ func (a *Client) TaskInstance(params *TaskInstanceParams) (*TaskInstanceOK, error) { // TODO: Validate the params before sending @@ -232,7 +250,7 @@ func (a *Client) TaskInstance(params *TaskInstanceParams) (*TaskInstanceOK, erro } /* -TasksInstance gets mesos tasks of service name instance name + TasksInstance gets mesos tasks of service name instance name */ func (a *Client) TasksInstance(params *TasksInstanceParams) (*TasksInstanceOK, error) { // TODO: Validate the params before sending diff --git a/pkg/paasta_api/client/service/status_instance_parameters.go b/pkg/paasta_api/client/service/status_instance_parameters.go index 76c2a8d..6b4bae3 100644 --- a/pkg/paasta_api/client/service/status_instance_parameters.go +++ b/pkg/paasta_api/client/service/status_instance_parameters.go @@ -13,9 +13,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" ) // NewStatusInstanceParams creates a new StatusInstanceParams object diff --git a/pkg/paasta_api/client/service/status_instance_responses.go b/pkg/paasta_api/client/service/status_instance_responses.go index 6be222d..bd4acb7 100644 --- a/pkg/paasta_api/client/service/status_instance_responses.go +++ b/pkg/paasta_api/client/service/status_instance_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" ) // StatusInstanceReader is a Reader for the StatusInstance structure. diff --git a/pkg/paasta_api/client/service/task_instance_parameters.go b/pkg/paasta_api/client/service/task_instance_parameters.go index 89f18d4..9cada39 100644 --- a/pkg/paasta_api/client/service/task_instance_parameters.go +++ b/pkg/paasta_api/client/service/task_instance_parameters.go @@ -13,9 +13,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" ) // NewTaskInstanceParams creates a new TaskInstanceParams object diff --git a/pkg/paasta_api/client/service/task_instance_responses.go b/pkg/paasta_api/client/service/task_instance_responses.go index 64d412e..7c98023 100644 --- a/pkg/paasta_api/client/service/task_instance_responses.go +++ b/pkg/paasta_api/client/service/task_instance_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" ) // TaskInstanceReader is a Reader for the TaskInstance structure. diff --git a/pkg/paasta_api/client/service/tasks_instance_parameters.go b/pkg/paasta_api/client/service/tasks_instance_parameters.go index 46efd9b..fbb920f 100644 --- a/pkg/paasta_api/client/service/tasks_instance_parameters.go +++ b/pkg/paasta_api/client/service/tasks_instance_parameters.go @@ -13,9 +13,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" ) // NewTasksInstanceParams creates a new TasksInstanceParams object diff --git a/pkg/paasta_api/client/service/tasks_instance_responses.go b/pkg/paasta_api/client/service/tasks_instance_responses.go index a245248..aaacc5a 100644 --- a/pkg/paasta_api/client/service/tasks_instance_responses.go +++ b/pkg/paasta_api/client/service/tasks_instance_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" ) // TasksInstanceReader is a Reader for the TasksInstance structure. diff --git a/pkg/paasta_api/models/adhoc_launch_history.go b/pkg/paasta_api/models/adhoc_launch_history.go index 1b92032..eb964a3 100644 --- a/pkg/paasta_api/models/adhoc_launch_history.go +++ b/pkg/paasta_api/models/adhoc_launch_history.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // AdhocLaunchHistory A single run +// // swagger:model AdhocLaunchHistory type AdhocLaunchHistory struct { diff --git a/pkg/paasta_api/models/float_and_error.go b/pkg/paasta_api/models/float_and_error.go index 585a323..659a1d6 100644 --- a/pkg/paasta_api/models/float_and_error.go +++ b/pkg/paasta_api/models/float_and_error.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // FloatAndError float and error +// // swagger:model FloatAndError type FloatAndError struct { diff --git a/pkg/paasta_api/models/instance_delay.go b/pkg/paasta_api/models/instance_delay.go index 314b170..d30b602 100644 --- a/pkg/paasta_api/models/instance_delay.go +++ b/pkg/paasta_api/models/instance_delay.go @@ -6,5 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command // InstanceDelay instance delay +// // swagger:model InstanceDelay type InstanceDelay interface{} diff --git a/pkg/paasta_api/models/instance_metadata_flink.go b/pkg/paasta_api/models/instance_metadata_flink.go index 9cc5ec2..bbebb83 100644 --- a/pkg/paasta_api/models/instance_metadata_flink.go +++ b/pkg/paasta_api/models/instance_metadata_flink.go @@ -6,5 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command // InstanceMetadataFlink Flink instance metadata +// // swagger:model InstanceMetadataFlink type InstanceMetadataFlink interface{} diff --git a/pkg/paasta_api/models/instance_status.go b/pkg/paasta_api/models/instance_status.go index 4c193eb..12854d1 100644 --- a/pkg/paasta_api/models/instance_status.go +++ b/pkg/paasta_api/models/instance_status.go @@ -6,13 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // InstanceStatus instance status +// // swagger:model InstanceStatus type InstanceStatus struct { @@ -178,6 +178,7 @@ func (m *InstanceStatus) UnmarshalBinary(b []byte) error { } // InstanceStatusFlink Nullable Flink instance status and metadata +// // swagger:model InstanceStatusFlink type InstanceStatusFlink struct { diff --git a/pkg/paasta_api/models/instance_status_adhoc.go b/pkg/paasta_api/models/instance_status_adhoc.go index ecfbc1d..4dd30a9 100644 --- a/pkg/paasta_api/models/instance_status_adhoc.go +++ b/pkg/paasta_api/models/instance_status_adhoc.go @@ -8,13 +8,13 @@ package models import ( "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // InstanceStatusAdhoc List of runs associated with job +// // swagger:model InstanceStatusAdhoc type InstanceStatusAdhoc []*AdhocLaunchHistory diff --git a/pkg/paasta_api/models/instance_status_flink.go b/pkg/paasta_api/models/instance_status_flink.go index 37cf1e8..02bcfce 100644 --- a/pkg/paasta_api/models/instance_status_flink.go +++ b/pkg/paasta_api/models/instance_status_flink.go @@ -6,5 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command // InstanceStatusFlink Flink instance status +// // swagger:model InstanceStatusFlink type InstanceStatusFlink interface{} diff --git a/pkg/paasta_api/models/instance_status_kubernetes.go b/pkg/paasta_api/models/instance_status_kubernetes.go index db6220e..45d972c 100644 --- a/pkg/paasta_api/models/instance_status_kubernetes.go +++ b/pkg/paasta_api/models/instance_status_kubernetes.go @@ -9,14 +9,14 @@ import ( "encoding/json" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // InstanceStatusKubernetes instance status kubernetes +// // swagger:model InstanceStatusKubernetes type InstanceStatusKubernetes struct { diff --git a/pkg/paasta_api/models/instance_status_marathon.go b/pkg/paasta_api/models/instance_status_marathon.go index 06d2750..a8142c2 100644 --- a/pkg/paasta_api/models/instance_status_marathon.go +++ b/pkg/paasta_api/models/instance_status_marathon.go @@ -9,14 +9,14 @@ import ( "encoding/json" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // InstanceStatusMarathon instance status marathon +// // swagger:model InstanceStatusMarathon type InstanceStatusMarathon struct { diff --git a/pkg/paasta_api/models/instance_status_tron.go b/pkg/paasta_api/models/instance_status_tron.go index cad5f40..dda087b 100644 --- a/pkg/paasta_api/models/instance_status_tron.go +++ b/pkg/paasta_api/models/instance_status_tron.go @@ -6,14 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // InstanceStatusTron instance status tron +// // swagger:model InstanceStatusTron type InstanceStatusTron struct { diff --git a/pkg/paasta_api/models/instance_task.go b/pkg/paasta_api/models/instance_task.go index b4c1ff5..b7cfd25 100644 --- a/pkg/paasta_api/models/instance_task.go +++ b/pkg/paasta_api/models/instance_task.go @@ -6,5 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command // InstanceTask instance task +// // swagger:model InstanceTask type InstanceTask interface{} diff --git a/pkg/paasta_api/models/instance_tasks.go b/pkg/paasta_api/models/instance_tasks.go index 14f5f8a..3f29281 100644 --- a/pkg/paasta_api/models/instance_tasks.go +++ b/pkg/paasta_api/models/instance_tasks.go @@ -6,10 +6,11 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // InstanceTasks List of tasks associated with instance +// // swagger:model InstanceTasks type InstanceTasks []InstanceTask diff --git a/pkg/paasta_api/models/integer_and_error.go b/pkg/paasta_api/models/integer_and_error.go index 69b157a..61636f3 100644 --- a/pkg/paasta_api/models/integer_and_error.go +++ b/pkg/paasta_api/models/integer_and_error.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // IntegerAndError integer and error +// // swagger:model IntegerAndError type IntegerAndError struct { diff --git a/pkg/paasta_api/models/kubernetes_pod.go b/pkg/paasta_api/models/kubernetes_pod.go index a17722e..0df1b37 100644 --- a/pkg/paasta_api/models/kubernetes_pod.go +++ b/pkg/paasta_api/models/kubernetes_pod.go @@ -6,13 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // KubernetesPod kubernetes pod +// // swagger:model KubernetesPod type KubernetesPod struct { diff --git a/pkg/paasta_api/models/kubernetes_replica_set.go b/pkg/paasta_api/models/kubernetes_replica_set.go index 51ee59d..015b9e4 100644 --- a/pkg/paasta_api/models/kubernetes_replica_set.go +++ b/pkg/paasta_api/models/kubernetes_replica_set.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // KubernetesReplicaSet kubernetes replica set +// // swagger:model KubernetesReplicaSet type KubernetesReplicaSet struct { diff --git a/pkg/paasta_api/models/marathon_app_status.go b/pkg/paasta_api/models/marathon_app_status.go index 8b23044..e04b0bc 100644 --- a/pkg/paasta_api/models/marathon_app_status.go +++ b/pkg/paasta_api/models/marathon_app_status.go @@ -8,13 +8,13 @@ package models import ( "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // MarathonAppStatus marathon app status +// // swagger:model MarathonAppStatus type MarathonAppStatus struct { diff --git a/pkg/paasta_api/models/marathon_autoscaling_info.go b/pkg/paasta_api/models/marathon_autoscaling_info.go index 0a7dc2f..cfe69c0 100644 --- a/pkg/paasta_api/models/marathon_autoscaling_info.go +++ b/pkg/paasta_api/models/marathon_autoscaling_info.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // MarathonAutoscalingInfo marathon autoscaling info +// // swagger:model MarathonAutoscalingInfo type MarathonAutoscalingInfo struct { diff --git a/pkg/paasta_api/models/marathon_dashboard.go b/pkg/paasta_api/models/marathon_dashboard.go index 412a07f..090d427 100644 --- a/pkg/paasta_api/models/marathon_dashboard.go +++ b/pkg/paasta_api/models/marathon_dashboard.go @@ -6,13 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" ) // MarathonDashboard A list of Marathon service, instance, and shard url for one or more clusters +// // swagger:model MarathonDashboard type MarathonDashboard map[string]MarathonDashboardCluster diff --git a/pkg/paasta_api/models/marathon_dashboard_cluster.go b/pkg/paasta_api/models/marathon_dashboard_cluster.go index 189a2b6..c72ca00 100644 --- a/pkg/paasta_api/models/marathon_dashboard_cluster.go +++ b/pkg/paasta_api/models/marathon_dashboard_cluster.go @@ -8,13 +8,13 @@ package models import ( "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // MarathonDashboardCluster List of all the MarathonDashboardItems for a cluster +// // swagger:model MarathonDashboardCluster type MarathonDashboardCluster []*MarathonDashboardItem diff --git a/pkg/paasta_api/models/marathon_dashboard_item.go b/pkg/paasta_api/models/marathon_dashboard_item.go index eb971e3..7a3d453 100644 --- a/pkg/paasta_api/models/marathon_dashboard_item.go +++ b/pkg/paasta_api/models/marathon_dashboard_item.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // MarathonDashboardItem Marathon service, instance, and shard url +// // swagger:model MarathonDashboardItem type MarathonDashboardItem struct { diff --git a/pkg/paasta_api/models/marathon_mesos_nonrunning_task.go b/pkg/paasta_api/models/marathon_mesos_nonrunning_task.go index 25c830c..79f6711 100644 --- a/pkg/paasta_api/models/marathon_mesos_nonrunning_task.go +++ b/pkg/paasta_api/models/marathon_mesos_nonrunning_task.go @@ -6,13 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // MarathonMesosNonrunningTask marathon mesos nonrunning task +// // swagger:model MarathonMesosNonrunningTask type MarathonMesosNonrunningTask struct { diff --git a/pkg/paasta_api/models/marathon_mesos_running_task.go b/pkg/paasta_api/models/marathon_mesos_running_task.go index 3e309ed..0f0f2b1 100644 --- a/pkg/paasta_api/models/marathon_mesos_running_task.go +++ b/pkg/paasta_api/models/marathon_mesos_running_task.go @@ -6,13 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // MarathonMesosRunningTask marathon mesos running task +// // swagger:model MarathonMesosRunningTask type MarathonMesosRunningTask struct { diff --git a/pkg/paasta_api/models/marathon_mesos_status.go b/pkg/paasta_api/models/marathon_mesos_status.go index 789987f..2fcffac 100644 --- a/pkg/paasta_api/models/marathon_mesos_status.go +++ b/pkg/paasta_api/models/marathon_mesos_status.go @@ -8,13 +8,13 @@ package models import ( "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // MarathonMesosStatus marathon mesos status +// // swagger:model MarathonMesosStatus type MarathonMesosStatus struct { diff --git a/pkg/paasta_api/models/marathon_task.go b/pkg/paasta_api/models/marathon_task.go index cf05c3a..903c1f0 100644 --- a/pkg/paasta_api/models/marathon_task.go +++ b/pkg/paasta_api/models/marathon_task.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // MarathonTask marathon task +// // swagger:model MarathonTask type MarathonTask struct { diff --git a/pkg/paasta_api/models/meta_status.go b/pkg/paasta_api/models/meta_status.go index c841ee1..3257987 100644 --- a/pkg/paasta_api/models/meta_status.go +++ b/pkg/paasta_api/models/meta_status.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // MetaStatus Result of `paasta metastatus` command +// // swagger:model MetaStatus type MetaStatus struct { diff --git a/pkg/paasta_api/models/resource.go b/pkg/paasta_api/models/resource.go index 0aa7fd2..aa529c6 100644 --- a/pkg/paasta_api/models/resource.go +++ b/pkg/paasta_api/models/resource.go @@ -8,13 +8,13 @@ package models import ( "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // Resource resource +// // swagger:model Resource type Resource []*ResourceItem diff --git a/pkg/paasta_api/models/resource_item.go b/pkg/paasta_api/models/resource_item.go index eb2b4ac..b63b20b 100644 --- a/pkg/paasta_api/models/resource_item.go +++ b/pkg/paasta_api/models/resource_item.go @@ -6,13 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // ResourceItem resource item +// // swagger:model ResourceItem type ResourceItem struct { diff --git a/pkg/paasta_api/models/resource_value.go b/pkg/paasta_api/models/resource_value.go index 8caf8d9..4569060 100644 --- a/pkg/paasta_api/models/resource_value.go +++ b/pkg/paasta_api/models/resource_value.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // ResourceValue resource value +// // swagger:model ResourceValue type ResourceValue struct { diff --git a/pkg/paasta_api/models/smartstack_backend.go b/pkg/paasta_api/models/smartstack_backend.go index 6a23c4f..74301d4 100644 --- a/pkg/paasta_api/models/smartstack_backend.go +++ b/pkg/paasta_api/models/smartstack_backend.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // SmartstackBackend smartstack backend +// // swagger:model SmartstackBackend type SmartstackBackend struct { diff --git a/pkg/paasta_api/models/smartstack_location.go b/pkg/paasta_api/models/smartstack_location.go index dd6b923..fdc8b13 100644 --- a/pkg/paasta_api/models/smartstack_location.go +++ b/pkg/paasta_api/models/smartstack_location.go @@ -8,13 +8,13 @@ package models import ( "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // SmartstackLocation smartstack location +// // swagger:model SmartstackLocation type SmartstackLocation struct { diff --git a/pkg/paasta_api/models/smartstack_status.go b/pkg/paasta_api/models/smartstack_status.go index 843f61a..15f963e 100644 --- a/pkg/paasta_api/models/smartstack_status.go +++ b/pkg/paasta_api/models/smartstack_status.go @@ -8,13 +8,13 @@ package models import ( "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // SmartstackStatus smartstack status +// // swagger:model SmartstackStatus type SmartstackStatus struct { diff --git a/pkg/paasta_api/models/task_tail_lines.go b/pkg/paasta_api/models/task_tail_lines.go index df41463..1166d9d 100644 --- a/pkg/paasta_api/models/task_tail_lines.go +++ b/pkg/paasta_api/models/task_tail_lines.go @@ -6,12 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // TaskTailLines task tail lines +// // swagger:model TaskTailLines type TaskTailLines struct { From bc04f19b80beb206d25163568e0f2d020bfec71f Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Thu, 23 Apr 2020 16:19:33 -0700 Subject: [PATCH 23/38] update gen-paasta-api target to delete old files and to use current user in docker --- Makefile | 9 +- .../client/operations/operations_client.go | 36 +++ pkg/paasta_api/client/paasta_client.go | 1 - .../service/status_instance_parameters.go | 32 ++ pkg/paasta_api/models/instance_status.go | 60 ++++ .../models/instance_status_kubernetes.go | 106 +++++++ .../models/instance_status_marathon.go | 25 ++ pkg/paasta_api/models/kubernetes_pod.go | 41 ++- swagger.json | 284 +++++++++++++++++- 9 files changed, 576 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index a2e2efb..1f3642c 100644 --- a/Makefile +++ b/Makefile @@ -47,10 +47,13 @@ itest_%: deb_% @echo "Built package for $*" gen-paasta-api: + rm -rf pkg/paasta_api/* + curl -o swagger.json https://raw.githubusercontent.com/Yelp/paasta/master/paasta_tools/api/api_docs/swagger.json docker run \ - --rm \ - -it \ + --rm -it \ + --user "$$(id -u):$$(id -g)" \ -e GOPATH=$$HOME/go:/go \ -v $$HOME:$$HOME \ -w $$(pwd) quay.io/goswagger/swagger \ - generate client -f ./swagger.json -t pkg/paasta_api \ No newline at end of file + generate client -f ./swagger.json -t pkg/paasta_api + @echo "Do not forget to `git add` and `git commit` updated swagger.json and paasta-api" diff --git a/pkg/paasta_api/client/operations/operations_client.go b/pkg/paasta_api/client/operations/operations_client.go index d2dbe48..825d239 100644 --- a/pkg/paasta_api/client/operations/operations_client.go +++ b/pkg/paasta_api/client/operations/operations_client.go @@ -29,6 +29,8 @@ type Client struct { type ClientService interface { DeleteServiceAutoscalerPause(params *DeleteServiceAutoscalerPauseParams) (*DeleteServiceAutoscalerPauseOK, error) + DeployQueue(params *DeployQueueParams) (*DeployQueueOK, error) + GetServiceAutoscalerPause(params *GetServiceAutoscalerPauseParams) (*GetServiceAutoscalerPauseOK, error) Metastatus(params *MetastatusParams) (*MetastatusOK, error) @@ -74,6 +76,40 @@ func (a *Client) DeleteServiceAutoscalerPause(params *DeleteServiceAutoscalerPau panic(msg) } +/* + DeployQueue gets deploy queue contents +*/ +func (a *Client) DeployQueue(params *DeployQueueParams) (*DeployQueueOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeployQueueParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deploy_queue", + Method: "GET", + PathPattern: "/deploy_queue", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeployQueueReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeployQueueOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deploy_queue: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetServiceAutoscalerPause gets autoscaling pause time */ diff --git a/pkg/paasta_api/client/paasta_client.go b/pkg/paasta_api/client/paasta_client.go index 4668e19..d0be7ab 100644 --- a/pkg/paasta_api/client/paasta_client.go +++ b/pkg/paasta_api/client/paasta_client.go @@ -12,7 +12,6 @@ import ( "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/autoscaler" "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/marathon_dashboard" - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/operations" "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/resources" "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/service" ) diff --git a/pkg/paasta_api/client/service/status_instance_parameters.go b/pkg/paasta_api/client/service/status_instance_parameters.go index 6b4bae3..c20547d 100644 --- a/pkg/paasta_api/client/service/status_instance_parameters.go +++ b/pkg/paasta_api/client/service/status_instance_parameters.go @@ -61,6 +61,11 @@ for the status instance operation typically these are written to a http.Request */ type StatusInstanceParams struct { + /*IncludeEnvoy + Include Envoy information + + */ + IncludeEnvoy *bool /*IncludeMesos Include Mesos information @@ -125,6 +130,17 @@ func (o *StatusInstanceParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithIncludeEnvoy adds the includeEnvoy to the status instance params +func (o *StatusInstanceParams) WithIncludeEnvoy(includeEnvoy *bool) *StatusInstanceParams { + o.SetIncludeEnvoy(includeEnvoy) + return o +} + +// SetIncludeEnvoy adds the includeEnvoy to the status instance params +func (o *StatusInstanceParams) SetIncludeEnvoy(includeEnvoy *bool) { + o.IncludeEnvoy = includeEnvoy +} + // WithIncludeMesos adds the includeMesos to the status instance params func (o *StatusInstanceParams) WithIncludeMesos(includeMesos *bool) *StatusInstanceParams { o.SetIncludeMesos(includeMesos) @@ -188,6 +204,22 @@ func (o *StatusInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfm } var res []error + if o.IncludeEnvoy != nil { + + // query param include_envoy + var qrIncludeEnvoy bool + if o.IncludeEnvoy != nil { + qrIncludeEnvoy = *o.IncludeEnvoy + } + qIncludeEnvoy := swag.FormatBool(qrIncludeEnvoy) + if qIncludeEnvoy != "" { + if err := r.SetQueryParam("include_envoy", qIncludeEnvoy); err != nil { + return err + } + } + + } + if o.IncludeMesos != nil { // query param include_mesos diff --git a/pkg/paasta_api/models/instance_status.go b/pkg/paasta_api/models/instance_status.go index 12854d1..e3ebe33 100644 --- a/pkg/paasta_api/models/instance_status.go +++ b/pkg/paasta_api/models/instance_status.go @@ -28,6 +28,9 @@ type InstanceStatus struct { // Instance name Instance string `json:"instance,omitempty"` + // kafkacluster + Kafkacluster *InstanceStatusKafkacluster `json:"kafkacluster,omitempty"` + // Kubernetes instance status Kubernetes *InstanceStatusKubernetes `json:"kubernetes,omitempty"` @@ -53,6 +56,10 @@ func (m *InstanceStatus) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateKafkacluster(formats); err != nil { + res = append(res, err) + } + if err := m.validateKubernetes(formats); err != nil { res = append(res, err) } @@ -105,6 +112,24 @@ func (m *InstanceStatus) validateFlink(formats strfmt.Registry) error { return nil } +func (m *InstanceStatus) validateKafkacluster(formats strfmt.Registry) error { + + if swag.IsZero(m.Kafkacluster) { // not required + return nil + } + + if m.Kafkacluster != nil { + if err := m.Kafkacluster.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("kafkacluster") + } + return err + } + } + + return nil +} + func (m *InstanceStatus) validateKubernetes(formats strfmt.Registry) error { if swag.IsZero(m.Kubernetes) { // not required @@ -238,3 +263,38 @@ func (m *InstanceStatusFlink) UnmarshalBinary(b []byte) error { *m = res return nil } + +// InstanceStatusKafkacluster Nullable KafkaCluster instance status and metadata +// +// swagger:model InstanceStatusKafkacluster +type InstanceStatusKafkacluster struct { + + // metadata + Metadata InstanceMetadataKafkaCluster `json:"metadata,omitempty"` + + // status + Status InstanceStatusKafkaCluster `json:"status,omitempty"` +} + +// Validate validates this instance status kafkacluster +func (m *InstanceStatusKafkacluster) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InstanceStatusKafkacluster) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InstanceStatusKafkacluster) UnmarshalBinary(b []byte) error { + var res InstanceStatusKafkacluster + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/instance_status_kubernetes.go b/pkg/paasta_api/models/instance_status_kubernetes.go index 45d972c..8984d28 100644 --- a/pkg/paasta_api/models/instance_status_kubernetes.go +++ b/pkg/paasta_api/models/instance_status_kubernetes.go @@ -27,6 +27,9 @@ type InstanceStatusKubernetes struct { // ID of the desired version of a service instance AppID string `json:"app_id,omitempty"` + // autoscaling status + AutoscalingStatus *InstanceStatusKubernetesAutoscalingStatus `json:"autoscaling_status,omitempty"` + // backoff in seconds before launching the next task BackoffSeconds int32 `json:"backoff_seconds,omitempty"` @@ -42,6 +45,9 @@ type InstanceStatusKubernetes struct { // Enum: [Running Deploying Stopped Delayed Waiting NotRunning] DeployStatus string `json:"deploy_status,omitempty"` + // Reason for the deploy status + DeployStatusMessage string `json:"deploy_status_message,omitempty"` + // Desired state of a service, for Kubernetes // Required: true // Enum: [start stop] @@ -77,6 +83,10 @@ func (m *InstanceStatusKubernetes) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateAutoscalingStatus(formats); err != nil { + res = append(res, err) + } + if err := m.validateBounceMethod(formats); err != nil { res = append(res, err) } @@ -116,6 +126,24 @@ func (m *InstanceStatusKubernetes) validateAppCount(formats strfmt.Registry) err return nil } +func (m *InstanceStatusKubernetes) validateAutoscalingStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.AutoscalingStatus) { // not required + return nil + } + + if m.AutoscalingStatus != nil { + if err := m.AutoscalingStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("autoscaling_status") + } + return err + } + } + + return nil +} + var instanceStatusKubernetesTypeBounceMethodPropEnum []interface{} func init() { @@ -348,3 +376,81 @@ func (m *InstanceStatusKubernetes) UnmarshalBinary(b []byte) error { *m = res return nil } + +// InstanceStatusKubernetesAutoscalingStatus HPA associated to this app +// +// swagger:model InstanceStatusKubernetesAutoscalingStatus +type InstanceStatusKubernetesAutoscalingStatus struct { + + // desired number of _instances as calculated by HPA + DesiredReplicas int64 `json:"desired_replicas,omitempty"` + + // timestamp of last autoscale + LastScaleTime string `json:"last_scale_time,omitempty"` + + // min_instances as specified in yelpsoa_configs + MaxInstances int64 `json:"max_instances,omitempty"` + + // Current metrics + Metrics []*HPAMetric `json:"metrics"` + + // min_instances as specified in yelpsoa_configs + MinInstances int64 `json:"min_instances,omitempty"` +} + +// Validate validates this instance status kubernetes autoscaling status +func (m *InstanceStatusKubernetesAutoscalingStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMetrics(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InstanceStatusKubernetesAutoscalingStatus) validateMetrics(formats strfmt.Registry) error { + + if swag.IsZero(m.Metrics) { // not required + return nil + } + + for i := 0; i < len(m.Metrics); i++ { + if swag.IsZero(m.Metrics[i]) { // not required + continue + } + + if m.Metrics[i] != nil { + if err := m.Metrics[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("autoscaling_status" + "." + "metrics" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InstanceStatusKubernetesAutoscalingStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InstanceStatusKubernetesAutoscalingStatus) UnmarshalBinary(b []byte) error { + var res InstanceStatusKubernetesAutoscalingStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/paasta_api/models/instance_status_marathon.go b/pkg/paasta_api/models/instance_status_marathon.go index a8142c2..6ce4f42 100644 --- a/pkg/paasta_api/models/instance_status_marathon.go +++ b/pkg/paasta_api/models/instance_status_marathon.go @@ -50,6 +50,9 @@ type InstanceStatusMarathon struct { // Enum: [start stop] DesiredState *string `json:"desired_state"` + // Status of the service in Envoy + Envoy *EnvoyStatus `json:"envoy,omitempty"` + // Error message when a marathon job ID cannot be found ErrorMessage string `json:"error_message,omitempty"` @@ -94,6 +97,10 @@ func (m *InstanceStatusMarathon) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateEnvoy(formats); err != nil { + res = append(res, err) + } + if err := m.validateMesos(formats); err != nil { res = append(res, err) } @@ -310,6 +317,24 @@ func (m *InstanceStatusMarathon) validateDesiredState(formats strfmt.Registry) e return nil } +func (m *InstanceStatusMarathon) validateEnvoy(formats strfmt.Registry) error { + + if swag.IsZero(m.Envoy) { // not required + return nil + } + + if m.Envoy != nil { + if err := m.Envoy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("envoy") + } + return err + } + } + + return nil +} + func (m *InstanceStatusMarathon) validateMesos(formats strfmt.Registry) error { if swag.IsZero(m.Mesos) { // not required diff --git a/pkg/paasta_api/models/kubernetes_pod.go b/pkg/paasta_api/models/kubernetes_pod.go index 0df1b37..648f35d 100644 --- a/pkg/paasta_api/models/kubernetes_pod.go +++ b/pkg/paasta_api/models/kubernetes_pod.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -16,24 +18,36 @@ import ( // swagger:model KubernetesPod type KubernetesPod struct { + // containers + Containers []*KubernetesContainer `json:"containers"` + // Time at which the pod was deployed DeployedTimestamp float32 `json:"deployed_timestamp,omitempty"` + // name of the pod's host + Host string `json:"host,omitempty"` + + // long message explaining the pod's state + Message *string `json:"message,omitempty"` + // name of the pod in Kubernetes Name string `json:"name,omitempty"` // The status of the pod Phase string `json:"phase,omitempty"` - // Stdout and stderr tail of the task - TailLines *TaskTailLines `json:"tail_lines,omitempty"` + // Whether or not the pod is ready (i.e. all containers up) + Ready bool `json:"ready,omitempty"` + + // short message explaining the pod's state + Reason *string `json:"reason,omitempty"` } // Validate validates this kubernetes pod func (m *KubernetesPod) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateTailLines(formats); err != nil { + if err := m.validateContainers(formats); err != nil { res = append(res, err) } @@ -43,19 +57,26 @@ func (m *KubernetesPod) Validate(formats strfmt.Registry) error { return nil } -func (m *KubernetesPod) validateTailLines(formats strfmt.Registry) error { +func (m *KubernetesPod) validateContainers(formats strfmt.Registry) error { - if swag.IsZero(m.TailLines) { // not required + if swag.IsZero(m.Containers) { // not required return nil } - if m.TailLines != nil { - if err := m.TailLines.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tail_lines") + for i := 0; i < len(m.Containers); i++ { + if swag.IsZero(m.Containers[i]) { // not required + continue + } + + if m.Containers[i] != nil { + if err := m.Containers[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("containers" + "." + strconv.Itoa(i)) + } + return err } - return err } + } return nil diff --git a/swagger.json b/swagger.json index 69758a7..286ca37 100644 --- a/swagger.json +++ b/swagger.json @@ -65,6 +65,20 @@ "operationId": "metastatus" } }, + "/deploy_queue": { + "get": { + "responses": { + "200": { + "description": "Contents of deploy queue", + "schema": { + "$ref": "#/definitions/DeployQueue" + } + } + }, + "summary": "Get deploy queue contents", + "operationId": "deploy_queue" + } + }, "/service_autoscaler/pause": { "get": { "responses": { @@ -194,9 +208,7 @@ "type": "array", "items": { "type": "array", - "items": { - "type": "object" - } + "items": {} } } } @@ -338,6 +350,13 @@ "required": false, "type": "boolean" }, + { + "in": "query", + "description": "Include Envoy information", + "name": "include_envoy", + "required": false, + "type": "boolean" + }, { "in": "query", "description": "Include Mesos information", @@ -651,6 +670,18 @@ } }, "description": "Nullable Flink instance status and metadata" + }, + "kafkacluster": { + "type": "object", + "properties": { + "status": { + "$ref": "#/definitions/InstanceStatusKafkaCluster" + }, + "metadata": { + "$ref": "#/definitions/InstanceMetadataKafkaCluster" + } + }, + "description": "Nullable KafkaCluster instance status and metadata" } } }, @@ -734,6 +765,10 @@ "$ref": "#/definitions/SmartstackStatus", "description": "Status of the service in smartstack" }, + "envoy": { + "$ref": "#/definitions/EnvoyStatus", + "description": "Status of the service in Envoy" + }, "error_message": { "type": "string", "description": "Error message when a marathon job ID cannot be found" @@ -1058,6 +1093,83 @@ } } }, + "EnvoyStatus": { + "type": "object", + "properties": { + "registration": { + "type": "string", + "description": "Registration name of the service in Smartstack" + }, + "expected_backends_per_location": { + "type": "integer", + "format": "int32", + "description": "Number of backends expected to be present in each location" + }, + "locations": { + "type": "array", + "description": "Locations the service is deployed", + "items": { + "$ref": "#/definitions/EnvoyLocation" + } + } + } + }, + "EnvoyLocation": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the location" + }, + "running_backends_count": { + "type": "integer", + "format": "int32", + "description": "Number of running backends for the service in this location" + }, + "backends": { + "type": "array", + "description": "Envoy backends running in this location", + "items": { + "$ref": "#/definitions/EnvoyBackend" + } + }, + "is_proxied_through_casper": { + "type": "boolean", + "description": "Whether this backend is proxied through Casper" + } + } + }, + "EnvoyBackend": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "Address of the host on which the backend is running" + }, + "port_value": { + "type": "integer", + "format": "int32", + "description": "Port number on which the backend responds" + }, + "hostname": { + "type": "string", + "description": "Name of the host on which the backend is running" + }, + "eds_health_status": { + "type": "string", + "description": "Status of the backend in Envoy as reported by the EDS" + }, + "weight": { + "type": "integer", + "format": "int32", + "description": "The weight of this backend in the cluster" + }, + "has_associated_task": { + "type": "boolean", + "description": "Whether this backend has an associated task running" + } + } + }, "InstanceStatusKubernetes": { "type": "object", "properties": { @@ -1100,6 +1212,10 @@ "NotRunning" ] }, + "deploy_status_message": { + "type": "string", + "description": "Reason for the deploy status" + }, "backoff_seconds": { "type": "integer", "format": "int32", @@ -1142,6 +1258,35 @@ "$ref": "#/definitions/KubernetesPod" } }, + "autoscaling_status": { + "type": "object", + "description": "HPA associated to this app", + "properties": { + "min_instances": { + "type": "integer", + "description": "min_instances as specified in yelpsoa_configs" + }, + "max_instances": { + "type": "integer", + "description": "min_instances as specified in yelpsoa_configs" + }, + "desired_replicas": { + "type": "integer", + "description": "desired number of _instances as calculated by HPA" + }, + "last_scale_time": { + "type": "string", + "description": "timestamp of last autoscale" + }, + "metrics": { + "type": "array", + "description": "Current metrics", + "items": { + "$ref": "#/definitions/HPAMetric" + } + } + } + }, "error_message": { "type": "string", "description": "Error message when a kubernetes object (Deployment/Statefulset) cannot be found" @@ -1153,6 +1298,23 @@ "bounce_method" ] }, + "HPAMetric": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "name of the metric" + }, + "target_value": { + "type": "string", + "description": "setpoint/target_value as specified in yelpsoa_configs" + }, + "current_value": { + "type": "string", + "description": "setpoint/target_value as specified in yelpsoa_configs" + } + } + }, "KubernetesReplicaSet": { "type": "object", "properties": { @@ -1184,6 +1346,10 @@ "type": "string", "description": "name of the pod in Kubernetes" }, + "host": { + "type": "string", + "description": "name of the pod's host" + }, "deployed_timestamp": { "type": "number", "format": "float", @@ -1193,9 +1359,39 @@ "type": "string", "description": "The status of the pod" }, + "ready": { + "type": "boolean", + "description": "Whether or not the pod is ready (i.e. all containers up)" + }, + "containers": { + "type": "array", + "items": { + "$ref": "#/definitions/KubernetesContainer", + "description": "List of containers in the pod" + } + }, + "reason": { + "type": "string", + "x-nullable": true, + "description": "short message explaining the pod's state" + }, + "message": { + "type": "string", + "x-nullable": true, + "description": "long message explaining the pod's state" + } + } + }, + "KubernetesContainer": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the container" + }, "tail_lines": { "$ref": "#/definitions/TaskTailLines", - "description": "Stdout and stderr tail of the task" + "description": "Stdout and stderr tail of the container" } } }, @@ -1260,6 +1456,18 @@ "type": "object", "description": "Flink instance metadata" }, + "InstanceStatusKafkaCluster": { + "type": "object", + "description": "Kafka instance status" + }, + "InstanceMetadataKafkaCluster": { + "type": "object", + "description": "Kafka instance metadata" + }, + "InstanceSpecKafkaCluster": { + "type": "object", + "description": "Kafka instance spec" + }, "InstanceTasks": { "type": "array", "description": "List of tasks associated with instance", @@ -1341,6 +1549,74 @@ } } }, + "DeployQueue": { + "type": "object", + "description": "Current state of the deployd queue", + "properties": { + "available_service_instances": { + "type": "array", + "description": "Service instances that are ready to be acted on by deployd", + "items": { + "$ref": "#/definitions/DeployQueueServiceInstance" + } + }, + "unavailable_service_instances": { + "type": "array", + "description": "Service instances that deployd is waiting to act on", + "items": { + "$ref": "#/definitions/DeployQueueServiceInstance" + } + } + } + }, + "DeployQueueServiceInstance": { + "type": "object", + "description": "An instance of a service in the deploy queue", + "properties": { + "service": { + "type": "string", + "description": "Name of the service" + }, + "instance": { + "type": "string", + "description": "Name of the instance of the service" + }, + "bounce_by": { + "type": "number", + "format": "float", + "description": "Desired timestamp by which the service instance should be bounced" + }, + "wait_until": { + "type": "number", + "format": "float", + "description": "Timestamp before which no action should be taken on this service instance" + }, + "enqueue_time": { + "type": "number", + "format": "float", + "description": "Timestamp at which the service instance was last added to the queue" + }, + "bounce_start_time": { + "type": "number", + "format": "float", + "description": "Timestamp at which service instance was first added to the queue" + }, + "watcher": { + "type": "string", + "description": "The process that enqueued the task" + }, + "failures": { + "type": "integer", + "format": "int32", + "description": "Number of times deployment actions have failed on this service instance" + }, + "processed_count": { + "type": "integer", + "format": "int32", + "description": "Number of times any deployment action has been taken on this service instance" + } + } + }, "Resource": { "type": "array", "items": { From 81cb5afa20c5d47bf40897e1730f672f5abf87a8 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Thu, 23 Apr 2020 16:30:30 -0700 Subject: [PATCH 24/38] remove old config_store, destructure config values --- cmd/paasta-metastatus/main.go | 12 ++- pkg/config_store/store.go | 172 --------------------------------- pkg/config_store/store_test.go | 171 -------------------------------- 3 files changed, 8 insertions(+), 347 deletions(-) delete mode 100644 pkg/config_store/store.go delete mode 100644 pkg/config_store/store_test.go diff --git a/cmd/paasta-metastatus/main.go b/cmd/paasta-metastatus/main.go index 6063b01..067b443 100644 --- a/cmd/paasta-metastatus/main.go +++ b/cmd/paasta-metastatus/main.go @@ -7,7 +7,7 @@ import ( flag "github.com/spf13/pflag" "github.com/Yelp/paasta-tools-go/pkg/cli" - "github.com/Yelp/paasta-tools-go/pkg/config_store" + "github.com/Yelp/paasta-tools-go/pkg/configstore" ) // PaastaMetastatusOptions ... @@ -39,8 +39,10 @@ func metastatus(opts *PaastaMetastatusOptions) error { opts.Verbosity = 2 } } - sysStore := config_store.NewStore(opts.SysDir, nil) - apiEndpoints, err := sysStore.Get("api_endpoints") + sysStore := configstore.NewStore(opts.SysDir, nil) + + var apiEndpoints map[string]interface{} + err := sysStore.Load("api_endpoints", &apiEndpoints) if err != nil { return err } @@ -49,12 +51,14 @@ func metastatus(opts *PaastaMetastatusOptions) error { if opts.Cluster != "" { clusters = []interface{}{opts.Cluster} } else { - clusters, err := sysStore.Get("clusters") + err := sysStore.Load("clusters", &clusters) if err != nil { return err } } + fmt.Printf("api endpoints: %+v\nclusters: %+v\n", apiEndpoints, clusters) + return nil } diff --git a/pkg/config_store/store.go b/pkg/config_store/store.go deleted file mode 100644 index 1a10313..0000000 --- a/pkg/config_store/store.go +++ /dev/null @@ -1,172 +0,0 @@ -package config_store - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "log" - "os" - "path" - "sync" - - "github.com/mitchellh/mapstructure" -) - -// Store holds config data -type Store struct { - // If you care about sanity, never write here, just read - Data map[string]interface{} - Dir string - Hints map[string]string - sync.Mutex - - ListFiles func(string) ([]string, error) - ParseFile func(string, interface{}) error - FileExists func(string) (bool, error) -} - -func listFiles(dirname string) ([]string, error) { - files, err := ioutil.ReadDir(dirname) - if err != nil { - return nil, err - } - - ret := make([]string, len(files)) - for idx, file := range files { - ret[idx] = file.Name() - } - - return ret, nil -} - -func parseFile(path string, value interface{}) error { - reader, err := os.Open(path) - defer reader.Close() - if err != nil { - return err - } - - return json.NewDecoder(reader).Decode(value) -} - -func fileExists(path string) (bool, error) { - _, err := os.Stat(path) - if err != nil { - if os.IsNotExist(err) { - return false, nil - } - return false, err - } - return true, nil -} - -// NewStore creates a new config store -// `dir` is a directory from where data will be loaded -// `hints` is a dictionary to find which file to load for -// a given key -func NewStore(dir string, hints map[string]string) *Store { - if hints == nil { - hints = map[string]string{} - } - return &Store{ - Dir: dir, - Data: map[string]interface{}{}, - Hints: hints, - ListFiles: listFiles, - ParseFile: parseFile, - FileExists: fileExists, - } -} - -// Decode `path` contents using `json`, copy `s.data` into -// a new map, merge loaded data into the copy and swap `s.data` -func (s *Store) loadPath(path string) error { - value := map[string]interface{}{} - err := s.ParseFile(path, &value) - if err != nil { - return err - } - - s.Lock() - defer s.Unlock() - for key, val := range value { - s.Data[key] = val - } - - return nil -} - -// Walk `s.dir` and `s.loadPath` all the files -func (s *Store) loadAll() error { - files, err := s.ListFiles(s.Dir) - if err != nil { - return err - } - - for _, file := range files { - err := s.loadPath(path.Join(s.Dir, file)) - if err != nil { - return err - } - } - return nil -} - -// Look for `file`.json or `file`.yaml, if not found try loading all files and -// print a warning about hints -func (s *Store) load(file string) error { - extensions := []string{"json", "yaml"} - for _, ext := range extensions { - path := path.Join(s.Dir, fmt.Sprintf("%s.%s", file, ext)) - exists, err := s.FileExists(path) - if err != nil { - return err - } - if exists { - return s.loadPath(path) - } - } - - log.Printf( - "WARN: loading all configs, consider adding some hints" + - fmt.Sprintf("for %s in %s", file, s.Dir), - ) - return s.loadAll() -} - -// Get returns value for given `key`. If not found in `s.data`, call -// `s.load` function with `file` from `s.hints` or `key` itself. -func (s *Store) Get(key string) (interface{}, error) { - if val, ok := s.Data[key]; ok { - return val, nil - } - - var file string - if dom, ok := s.Hints[key]; ok { - file = dom - } else { - file = key - } - - err := s.load(file) - if err != nil { - return nil, err - } - - val, ok := s.Data[key] - if !ok { - return nil, fmt.Errorf("key not found: %s", key) - } - return val, nil -} - -// Load uses mapstructure.Decode to parse result of a Get into provided -// destination value -func (s *Store) Load(key string, dst interface{}) error { - val, err := s.Get(key) - if err != nil { - return err - } - mapstructure.Decode(val, dst) - return nil -} diff --git a/pkg/config_store/store_test.go b/pkg/config_store/store_test.go deleted file mode 100644 index a93bf34..0000000 --- a/pkg/config_store/store_test.go +++ /dev/null @@ -1,171 +0,0 @@ -package config_store - -import ( - "fmt" - "testing" -) - -func errorIf(test *testing.T, pred bool, format string, args ...interface{}) { - if pred { - test.Fatalf(format, args...) - } -} - -func errorUnexpected(test *testing.T, expected, actual interface{}) { - errorIf(test, expected != actual, "expected %+v, actual %+v", expected, actual) -} - -func unexpectedParseFile(test *testing.T) func(string, interface{}) error { - return func(file string, val interface{}) error { - test.Fatalf("unexpected call to parseFile(%s, _)", file) - return nil - } -} - -func unexpectedListFiles(test *testing.T) func(string) ([]string, error) { - return func(dirname string) ([]string, error) { - test.Fatalf("unexpected call to listFiles(%s)", dirname) - return []string{}, nil - } -} - -func unexpectedfileExists(test *testing.T) func(path string) (bool, error) { - return func(path string) (bool, error) { - test.Fatalf("unexpected call to fileExists(%s)", path) - return false, nil - } -} - -func TestStore_loadPath(test *testing.T) { - key := "test key" - s := &Store{ - Data: map[string]interface{}{}, - ParseFile: func(file string, val interface{}) error { - v, ok := val.(map[string]interface{}) - if !ok { - panic("assert failed") - } - v[key] = file - return nil - }, - } - expected := "old value" - s.Data[key] = expected - s.loadPath("new value") - - if actual, ok := s.Data[key]; ok { - if actual != "new value" { - test.Fatalf("%+v was expected, got %+v", expected, actual) - } - } else { - test.Fatalf("key %+v not found", key) - } -} - -func TestStore_loadAll(test *testing.T) { - s := &Store{ - Dir: "zero", - Data: map[string]interface{}{}, - ParseFile: func(file string, val interface{}) error { - fmt.Printf("parse file called: %s\n", file) - v, ok := val.(map[string]interface{}) - if !ok { - panic("assert failed") - } - v[file] = "loaded" - return nil - }, - ListFiles: func(dirname string) ([]string, error) { - return []string{"one", "two"}, nil - }, - } - s.loadAll() - - for _, key := range []string{"zero/one", "zero/two"} { - if actual, ok := s.Data[key]; ok { - if actual != "loaded" { - test.Fatalf("%s wasn't loaded correctly", key) - } - } else { - test.Fatalf("key %+v wasn't loaded", key) - } - } -} - -func TestStore_load(test *testing.T) { - s := &Store{ - Dir: "zero", - Data: map[string]interface{}{}, - ParseFile: func(file string, val interface{}) error { return nil }, - ListFiles: unexpectedListFiles(test), - FileExists: func(path string) (bool, error) { - expected := "zero/one.json" - if path != expected { - test.Fatalf("expected path=%s, got path=%s", expected, path) - } - return true, nil - }, - } - s.load("one") - - s.FileExists = func(path string) (bool, error) { return false, nil } - s.ParseFile = unexpectedParseFile(test) - s.ListFiles = func(dirname string) ([]string, error) { return []string{}, nil } - s.load("one") -} - -func TestStore_Get(test *testing.T) { - s := &Store{ - Dir: "zero", - Data: map[string]interface{}{}, - ParseFile: unexpectedParseFile(test), - ListFiles: unexpectedListFiles(test), - FileExists: func(path string) (bool, error) { - test.Fatalf("unexpected call to fileExists(%s)", path) - return true, nil - }, - } - s.Data["one"] = "two" - val, err := s.Get("one") - errorIf(test, err != nil, "key not found") - errorUnexpected(test, "two", val) - - // key is missing, file with same name exists - s.FileExists = func(path string) (bool, error) { return true, nil } - s.ParseFile = func(file string, val interface{}) error { - v := val.(map[string]interface{}) - v["two"] = "three" - return nil - } - val, err = s.Get("two") - errorIf(test, err != nil, "key not found") - errorUnexpected(test, "three", val) - - // key is missing, file corresponding to a hint exists - s.Hints = map[string]string{"three": "four"} - s.FileExists = func(path string) (bool, error) { - errorUnexpected(test, "zero/four.json", path) - return true, nil - } - s.ParseFile = func(file string, val interface{}) error { - errorUnexpected(test, "zero/four.json", file) - v := val.(map[string]interface{}) - v["three"] = "four" - return nil - } - val, err = s.Get("three") - errorIf(test, err != nil, "key not found") - errorUnexpected(test, "four", val) - - // key is missing, file is missing, hint is missing, loaded from all - listFilesCalled := false - s.ListFiles = func(string) ([]string, error) { - listFilesCalled = true - return []string{}, nil - } - s.FileExists = func(string) (bool, error) { - return false, nil - } - val, _ = s.Get("four") - errorIf(test, !listFilesCalled, "listFiles wasn't called") -} From 90b8a443dfaa7ed6195e625343d9333e4247f576 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Thu, 23 Apr 2020 18:02:25 -0700 Subject: [PATCH 25/38] fix config loading, add basic cluster status func and call it in parallel for all requested clusters --- cmd/paasta-metastatus/main.go | 51 ++++++++++++++++++++++++++++------- go.sum | 1 + pkg/configstore/store.go | 9 ++++--- 3 files changed, 49 insertions(+), 12 deletions(-) diff --git a/cmd/paasta-metastatus/main.go b/cmd/paasta-metastatus/main.go index 067b443..f9bb922 100644 --- a/cmd/paasta-metastatus/main.go +++ b/cmd/paasta-metastatus/main.go @@ -3,6 +3,7 @@ package main import ( "fmt" "os" + "sync" flag "github.com/spf13/pflag" @@ -33,7 +34,16 @@ func parseFlags(opts *PaastaMetastatusOptions) error { return nil } -func metastatus(opts *PaastaMetastatusOptions) error { +func printClusterStatus( + cluster, endpoint string, + opts *PaastaMetastatusOptions, + conf *configstore.Store, +) error { + fmt.Printf("cluster %v endpoint %v\n", cluster, endpoint) + return nil +} + +func metastatus(opts *PaastaMetastatusOptions) (bool, error) { if opts.AutoscalingInfo { if opts.Verbosity < 2 { opts.Verbosity = 2 @@ -41,25 +51,45 @@ func metastatus(opts *PaastaMetastatusOptions) error { } sysStore := configstore.NewStore(opts.SysDir, nil) - var apiEndpoints map[string]interface{} + apiEndpoints := map[string]string{} err := sysStore.Load("api_endpoints", &apiEndpoints) if err != nil { - return err + return false, fmt.Errorf("Failed to load api_endpoints from configs: %v", err) } - var clusters []interface{} + var clusters []string if opts.Cluster != "" { - clusters = []interface{}{opts.Cluster} + clusters = []string{opts.Cluster} } else { err := sysStore.Load("clusters", &clusters) if err != nil { - return err + return false, fmt.Errorf("Failed to load clusters from configs: %v", err) } } - fmt.Printf("api endpoints: %+v\nclusters: %+v\n", apiEndpoints, clusters) + var wg sync.WaitGroup + var success bool = true + for _, cluster := range clusters { + endpoint, ok := apiEndpoints[cluster] + if !ok { + fmt.Printf("WARN: api endpoint not found for %v\n", cluster) + continue + } + wg.Add(1) + go func(cluster, endpoint string) { + defer wg.Done() + err := printClusterStatus(cluster, endpoint, opts, sysStore) + if err != nil { + fmt.Printf( + "ERR: couldn't get status for cluster %v: %v", cluster, err, + ) + success = false + } + }(cluster, endpoint) + } + wg.Wait() - return nil + return success, nil } func main() { @@ -74,9 +104,12 @@ func main() { flag.PrintDefaults() os.Exit(0) } - err = metastatus(options) + success, err := metastatus(options) if err != nil { fmt.Println(err) os.Exit(1) } + if !success { + os.Exit(1) + } } diff --git a/go.sum b/go.sum index 5ff0e76..aad7d13 100644 --- a/go.sum +++ b/go.sum @@ -511,6 +511,7 @@ google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.1 h1:q4XQuHFC6I28BKZpo6IYyb3mNO+l7lSOxRuYTCiDfXk= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/pkg/configstore/store.go b/pkg/configstore/store.go index 3fadeb5..998c369 100644 --- a/pkg/configstore/store.go +++ b/pkg/configstore/store.go @@ -105,8 +105,8 @@ func NewStore(dir string, hints map[string]string) *Store { // Decode `path` contents using `json`, lock the store mutex, merge loaded data // into s.Data, unlock the mutex func (s *Store) loadPath(path string) error { - value := map[string]interface{}{} - err := s.ParseFile(path, value) + var value map[string]interface{} + err := s.ParseFile(path, &value) if err != nil { return fmt.Errorf("Failed to parse %s: %v", path, err) } @@ -177,7 +177,10 @@ func (s *Store) Get(key string) (interface{}, error) { } else { file = key } - s.load(file) + err := s.load(file) + if err != nil { + return nil, fmt.Errorf("Failed to load %v: %v", file, err) + } val, ok := s.Data.Load(key) if !ok { From 2539facd45b1c26a4e9d329981792dd64e7d3c3b Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Fri, 24 Apr 2020 02:42:44 -0700 Subject: [PATCH 26/38] print dashboards --- .gitignore | 1 + cmd/paasta-metastatus/main.go | 45 +++++++++++++++++++++++++++++++++-- go.mod | 2 ++ go.sum | 12 ++++++++++ 4 files changed, 58 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f18aad6..aefa06b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ dist bin .idea/* +/paasta-metastatus diff --git a/cmd/paasta-metastatus/main.go b/cmd/paasta-metastatus/main.go index f9bb922..b2cfa64 100644 --- a/cmd/paasta-metastatus/main.go +++ b/cmd/paasta-metastatus/main.go @@ -3,12 +3,14 @@ package main import ( "fmt" "os" + "strings" "sync" flag "github.com/spf13/pflag" "github.com/Yelp/paasta-tools-go/pkg/cli" "github.com/Yelp/paasta-tools-go/pkg/configstore" + "github.com/logrusorgru/aurora" ) // PaastaMetastatusOptions ... @@ -36,10 +38,42 @@ func parseFlags(opts *PaastaMetastatusOptions) error { func printClusterStatus( cluster, endpoint string, + dashboards map[string]interface{}, opts *PaastaMetastatusOptions, conf *configstore.Store, ) error { - fmt.Printf("cluster %v endpoint %v\n", cluster, endpoint) + sb := strings.Builder{} + sb.WriteString(fmt.Sprintf("Cluster: %v\n", cluster)) + if dashboards == nil { + sb.WriteString(aurora.Red("No dashboards configured!\n").String()) + } else { + spacing := 0 + for svc := range dashboards { + svcLen := len(svc) + if svcLen > spacing { + spacing = svcLen + } + } + spacing++ + for svc, dashboard := range dashboards { + spacer := strings.Repeat(" ", spacing-len(svc)) + sb.WriteString(fmt.Sprintf(" %s:%s", svc, spacer)) + switch d := dashboard.(type) { + case string: + sb.WriteString(aurora.Cyan(d).String()) + case []interface{}: + if len(d) > 1 { + for _, url := range d { + sb.WriteString(fmt.Sprintf("\n %v", aurora.Cyan(url.(string)))) + } + } else { + sb.WriteString(aurora.Cyan(d[0].(string)).String()) + } + } + sb.WriteString("\n") + } + } + fmt.Print(sb.String()) return nil } @@ -57,6 +91,12 @@ func metastatus(opts *PaastaMetastatusOptions) (bool, error) { return false, fmt.Errorf("Failed to load api_endpoints from configs: %v", err) } + dashboardLinks := map[string]map[string]interface{}{} + err = sysStore.Load("dashboard_links", &dashboardLinks) + if err != nil { + return false, fmt.Errorf("Failed to load dashboard_links from configs: %v", err) + } + var clusters []string if opts.Cluster != "" { clusters = []string{opts.Cluster} @@ -75,10 +115,11 @@ func metastatus(opts *PaastaMetastatusOptions) (bool, error) { fmt.Printf("WARN: api endpoint not found for %v\n", cluster) continue } + dashboards, ok := dashboardLinks[cluster] wg.Add(1) go func(cluster, endpoint string) { defer wg.Done() - err := printClusterStatus(cluster, endpoint, opts, sysStore) + err := printClusterStatus(cluster, endpoint, dashboards, opts, sysStore) if err != nil { fmt.Printf( "ERR: couldn't get status for cluster %v: %v", cluster, err, diff --git a/go.mod b/go.mod index 0ef4476..b22bef0 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/Yelp/paasta-tools-go require ( cloud.google.com/go v0.38.0 // indirect github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754 + github.com/fatih/color v1.9.0 github.com/fatih/structs v1.1.0 // indirect github.com/go-logfmt/logfmt v0.4.0 // indirect github.com/go-openapi/errors v0.19.2 @@ -11,6 +12,7 @@ require ( github.com/go-openapi/swag v0.19.5 github.com/go-openapi/validate v0.19.5 github.com/go-swagger/go-swagger v0.21.0 // indirect + github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381 github.com/mitchellh/mapstructure v1.1.2 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/pmezard/go-difflib v1.0.0 diff --git a/go.sum b/go.sum index aad7d13..7cbe847 100644 --- a/go.sum +++ b/go.sum @@ -78,6 +78,8 @@ github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLi github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -236,6 +238,8 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381 h1:bqDmpDG49ZRnB5PcgP0RXtQvnMSgIF14M7CBd2shtXs= +github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -247,7 +251,12 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -450,6 +459,7 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= @@ -461,6 +471,8 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190907184412-d223b2b6db03/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69 h1:rOhMmluY6kLMhdnrivzec6lLgaVbMHMn2ISQXJeJ5EM= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f h1:68K/z8GLUxV76xGSqwTWw2gyk/jwn79LUL43rES2g8o= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From f3c1f3a21d506cdc0b551baa0cc31535c0d8e753 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Fri, 24 Apr 2020 04:02:21 -0700 Subject: [PATCH 27/38] send api requests for metastatus --- cmd/paasta-metastatus/main.go | 61 ++++++++++++++----- pkg/paasta_api/client/paasta_client.go | 1 + .../models/instance_status_flink.go | 2 +- 3 files changed, 49 insertions(+), 15 deletions(-) diff --git a/cmd/paasta-metastatus/main.go b/cmd/paasta-metastatus/main.go index b2cfa64..c1e8188 100644 --- a/cmd/paasta-metastatus/main.go +++ b/cmd/paasta-metastatus/main.go @@ -1,16 +1,24 @@ package main import ( + "context" "fmt" + "net/url" "os" "strings" "sync" + "time" flag "github.com/spf13/pflag" "github.com/Yelp/paasta-tools-go/pkg/cli" "github.com/Yelp/paasta-tools-go/pkg/configstore" "github.com/logrusorgru/aurora" + + apiclient "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client" + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/operations" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" ) // PaastaMetastatusOptions ... @@ -36,14 +44,9 @@ func parseFlags(opts *PaastaMetastatusOptions) error { return nil } -func printClusterStatus( - cluster, endpoint string, - dashboards map[string]interface{}, - opts *PaastaMetastatusOptions, - conf *configstore.Store, -) error { - sb := strings.Builder{} - sb.WriteString(fmt.Sprintf("Cluster: %v\n", cluster)) +func printDashboards( + cluster string, dashboards map[string]interface{}, sb *strings.Builder, +) { if dashboards == nil { sb.WriteString(aurora.Red("No dashboards configured!\n").String()) } else { @@ -73,10 +76,44 @@ func printClusterStatus( sb.WriteString("\n") } } - fmt.Print(sb.String()) +} + +func printAPIStatus(cluster, endpoint string, sb *strings.Builder) error { + url, err := url.Parse(endpoint) + if err != nil { + return fmt.Errorf("Failed to parse API endpoint %v: %v", endpoint, err) + } + transport := httptransport.New(url.Host, apiclient.DefaultBasePath, []string{url.Scheme}) + client := apiclient.New(transport, strfmt.Default) + cmdArgs := []string{""} + ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second) + defer cancel() + mp := &operations.MetastatusParams{CmdArgs: cmdArgs, Context: ctx} + resp, err := client.Operations.Metastatus(mp) + if err != nil { + return fmt.Errorf("Failed to get metastatus: %s", aurora.Red(err)) + } + sb.WriteString(fmt.Sprintf("%s\n", resp.Payload.Output)) return nil } +func printClusterStatus( + cluster, endpoint string, + dashboards map[string]interface{}, +) bool { + sb := &strings.Builder{} + sb.WriteString(fmt.Sprintf("Cluster: %v\n", cluster)) + printDashboards(cluster, dashboards, sb) + success := true + err := printAPIStatus(cluster, endpoint, sb) + if err != nil { + success = false + sb.WriteString(fmt.Sprintf("Failed to get status for cluster %v: %v\n", cluster, err)) + } + fmt.Print(sb.String()) + return success +} + func metastatus(opts *PaastaMetastatusOptions) (bool, error) { if opts.AutoscalingInfo { if opts.Verbosity < 2 { @@ -119,11 +156,7 @@ func metastatus(opts *PaastaMetastatusOptions) (bool, error) { wg.Add(1) go func(cluster, endpoint string) { defer wg.Done() - err := printClusterStatus(cluster, endpoint, dashboards, opts, sysStore) - if err != nil { - fmt.Printf( - "ERR: couldn't get status for cluster %v: %v", cluster, err, - ) + if !printClusterStatus(cluster, endpoint, dashboards) { success = false } }(cluster, endpoint) diff --git a/pkg/paasta_api/client/paasta_client.go b/pkg/paasta_api/client/paasta_client.go index d0be7ab..4668e19 100644 --- a/pkg/paasta_api/client/paasta_client.go +++ b/pkg/paasta_api/client/paasta_client.go @@ -12,6 +12,7 @@ import ( "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/autoscaler" "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/marathon_dashboard" + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/operations" "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/resources" "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/service" ) diff --git a/pkg/paasta_api/models/instance_status_flink.go b/pkg/paasta_api/models/instance_status_flink.go index 02bcfce..08b7608 100644 --- a/pkg/paasta_api/models/instance_status_flink.go +++ b/pkg/paasta_api/models/instance_status_flink.go @@ -8,4 +8,4 @@ package models // InstanceStatusFlink Flink instance status // // swagger:model InstanceStatusFlink -type InstanceStatusFlink interface{} +type _InstanceStatusFlink interface{} From fc681db7d8b25a661431f165b60b936c584dc1eb Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Fri, 24 Apr 2020 06:18:16 -0700 Subject: [PATCH 28/38] groupings is a list --- cmd/paasta-metastatus/main.go | 53 +++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/cmd/paasta-metastatus/main.go b/cmd/paasta-metastatus/main.go index c1e8188..b878eb2 100644 --- a/cmd/paasta-metastatus/main.go +++ b/cmd/paasta-metastatus/main.go @@ -26,7 +26,7 @@ type PaastaMetastatusOptions struct { cli.PaastaOptions cli.CSIOptions AutoscalingInfo bool - Groupings string + Groupings []string } // Setup ... @@ -34,7 +34,7 @@ func (o *PaastaMetastatusOptions) Setup() { (&o.PaastaOptions).Setup() (&o.CSIOptions).Setup() flag.BoolVar(&o.AutoscalingInfo, "autoscaling-info", false, "") - flag.StringVarP(&o.Groupings, "groupings", "g", "", "") + flag.StringArrayVarP(&o.Groupings, "groupings", "g", []string{"region"}, "") } func parseFlags(opts *PaastaMetastatusOptions) error { @@ -78,15 +78,49 @@ func printDashboards( } } -func printAPIStatus(cluster, endpoint string, sb *strings.Builder) error { +func getMetastatusCmdArgs(opts *PaastaMetastatusOptions) ([]string, time.Duration) { + cmdArgs := []string{} + verbosity := 0 + timeout := time.Duration(20) + + if opts.Verbosity > 0 { + verbosity = opts.Verbosity + timeout = 120 + } + if opts.AutoscalingInfo { + cmdArgs = append(cmdArgs, "-a") + if verbosity < 2 { + verbosity = 2 + } + timeout = 120 + } + if len(opts.Groupings) > 0 { + cmdArgs = append(cmdArgs, "-g") + cmdArgs = append(cmdArgs, opts.Groupings...) + } + if opts.UseMesosCache { + cmdArgs = append(cmdArgs, "--use-mesos-cache") + } + if verbosity > 0 { + cmdArgs = append(cmdArgs, fmt.Sprintf("-%s", strings.Repeat("v", verbosity))) + } + + return cmdArgs, timeout +} + +func printAPIStatus(cluster, endpoint string, opts *PaastaMetastatusOptions, sb *strings.Builder) error { url, err := url.Parse(endpoint) if err != nil { return fmt.Errorf("Failed to parse API endpoint %v: %v", endpoint, err) } - transport := httptransport.New(url.Host, apiclient.DefaultBasePath, []string{url.Scheme}) - client := apiclient.New(transport, strfmt.Default) - cmdArgs := []string{""} - ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second) + + var ( + transport = httptransport.New(url.Host, apiclient.DefaultBasePath, []string{url.Scheme}) + client = apiclient.New(transport, strfmt.Default) + cmdArgs, timeout = getMetastatusCmdArgs(opts) + ) + + ctx, cancel := context.WithTimeout(context.Background(), timeout*time.Second) defer cancel() mp := &operations.MetastatusParams{CmdArgs: cmdArgs, Context: ctx} resp, err := client.Operations.Metastatus(mp) @@ -100,12 +134,13 @@ func printAPIStatus(cluster, endpoint string, sb *strings.Builder) error { func printClusterStatus( cluster, endpoint string, dashboards map[string]interface{}, + opts *PaastaMetastatusOptions, ) bool { sb := &strings.Builder{} sb.WriteString(fmt.Sprintf("Cluster: %v\n", cluster)) printDashboards(cluster, dashboards, sb) success := true - err := printAPIStatus(cluster, endpoint, sb) + err := printAPIStatus(cluster, endpoint, opts, sb) if err != nil { success = false sb.WriteString(fmt.Sprintf("Failed to get status for cluster %v: %v\n", cluster, err)) @@ -156,7 +191,7 @@ func metastatus(opts *PaastaMetastatusOptions) (bool, error) { wg.Add(1) go func(cluster, endpoint string) { defer wg.Done() - if !printClusterStatus(cluster, endpoint, dashboards) { + if !printClusterStatus(cluster, endpoint, dashboards, opts) { success = false } }(cluster, endpoint) From 5334635658fcb266a77a2032cb73b8564b2f7ce9 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Fri, 24 Apr 2020 06:27:22 -0700 Subject: [PATCH 29/38] sync with configstore branch --- pkg/deployments/deployments.go | 16 +++---- pkg/deployments/deployments_test.go | 73 +++++++++++++++-------------- pkg/volumes/converter.go | 4 +- pkg/volumes/converter_test.go | 20 ++++---- pkg/volumes/volumes.go | 4 +- pkg/volumes/volumes_test.go | 20 ++++---- 6 files changed, 69 insertions(+), 68 deletions(-) diff --git a/pkg/deployments/deployments.go b/pkg/deployments/deployments.go index 77b6e26..e476b07 100644 --- a/pkg/deployments/deployments.go +++ b/pkg/deployments/deployments.go @@ -18,7 +18,7 @@ import ( "fmt" "path" - "github.com/Yelp/paasta-tools-go/pkg/config_store" + "github.com/Yelp/paasta-tools-go/pkg/configstore" ) // V2DeploymentGroup ... @@ -55,17 +55,17 @@ type ImageProvider interface { type DefaultImageProvider struct { Service string - ServiceConfig *config_store.Store - PaastaConfig *config_store.Store + ServiceConfig *configstore.Store + PaastaConfig *configstore.Store } // NewDefaultImageProviderForService ... func NewDefaultImageProviderForService(service string) *DefaultImageProvider { - serviceConfig := config_store.NewStore( + serviceConfig := configstore.NewStore( path.Join("/nail/etc/services", service), map[string]string{"v2": "deployments"}, ) - paastaConfig := config_store.NewStore( + paastaConfig := configstore.NewStore( "/etc/paasta", map[string]string{"registry": "docker_registry"}, ) @@ -96,7 +96,7 @@ func (provider *DefaultImageProvider) DockerImageURLForDeployGroup(deploymentGro func (provider *DefaultImageProvider) getDockerRegistry() (string, error) { dockerRegistry := &DockerRegistry{Registry: ""} - err := provider.PaastaConfig.Load("registry", &dockerRegistry.Registry) + err := provider.PaastaConfig.Load("docker_registry", &dockerRegistry) return dockerRegistry.Registry, err } @@ -122,7 +122,7 @@ func (provider *DefaultImageProvider) getImageForDeployGroup(deploymentGroup str func DeploymentAnnotations( service, cluster, instance, deploymentGroup string, ) (map[string]string, error) { - configStore := config_store.NewStore( + configStore := configstore.NewStore( fmt.Sprintf("/nail/etc/services/%s", service), map[string]string{"v2": "deployments"}, ) @@ -136,7 +136,7 @@ func DeploymentAnnotations( return deploymentAnnotationsForControlGroup(deployments, controlGroup) } -func deploymentsFromConfig(cr *config_store.Store) (*Deployments, error) { +func deploymentsFromConfig(cr *configstore.Store) (*Deployments, error) { deployments := &Deployments{} err := cr.Load("v2", deployments) return deployments, err diff --git a/pkg/deployments/deployments_test.go b/pkg/deployments/deployments_test.go index 62a38d2..bbc4e49 100644 --- a/pkg/deployments/deployments_test.go +++ b/pkg/deployments/deployments_test.go @@ -2,9 +2,10 @@ package deployments import ( "fmt" + "sync" "testing" - "github.com/Yelp/paasta-tools-go/pkg/config_store" + "github.com/Yelp/paasta-tools-go/pkg/configstore" ) const ( @@ -12,30 +13,28 @@ const ( ) func TestDefaultProviderGetDeployment(test *testing.T) { - imageProvider := DefaultImageProvider{ - PaastaConfig: &config_store.Store{ - Data: map[string]interface{}{ - "docker_registry": map[string]interface{}{ - "registry": "fakeregistry.yelp.com", - }, + paastaConfigData := &sync.Map{} + paastaConfigData.Store("docker_registry", map[string]interface{}{ + "docker_registry": "fakeregistry.yelp.com", + }) + + serviceConfigData := &sync.Map{} + serviceConfigData.Store("v2", map[string]interface{}{ + "deployments": map[string]interface{}{ + "dev.every": map[string]interface{}{ + "docker_image": "busybox:latest", + "git_sha": "03d6f783c99695af0e716588abb9ba83ac957be2", }, - }, - ServiceConfig: &config_store.Store{ - Data: map[string]interface{}{ - "v2": map[string]interface{}{ - "deployments": map[string]interface{}{ - "dev.every": map[string]interface{}{ - "docker_image": "busybox:latest", - "git_sha": "03d6f783c99695af0e716588abb9ba83ac957be2", - }, - "test.every": map[string]interface{}{ - "docker_image": "ubuntu:latest", - "git_sha": "f3d6f783c99695af0e716588abb9ba83ac957be3", - }, - }, - }, + "test.every": map[string]interface{}{ + "docker_image": "ubuntu:latest", + "git_sha": "f3d6f783c99695af0e716588abb9ba83ac957be3", }, }, + }) + + imageProvider := DefaultImageProvider{ + PaastaConfig: &configstore.Store{Data: paastaConfigData}, + ServiceConfig: &configstore.Store{Data: serviceConfigData}, } testcases := map[string]string{ "dev.every": "busybox:latest", @@ -106,22 +105,24 @@ func TestDeploymentAnnotationsForControlGroup(test *testing.T) { } func TestDefaultGetRegistry(t *testing.T) { + paastaConfigData := &sync.Map{} + paastaConfigData.Store("docker_registry", map[string]interface{}{ + "docker_registry": "fakeregistry.yelp.com", + }) + + serviceConfigData := &sync.Map{} + serviceConfigData.Store("v2", map[string]interface{}{ + "deployments": map[string]interface{}{}, + }) + imageProvider := DefaultImageProvider{ - PaastaConfig: &config_store.Store{ - Data: map[string]interface{}{ - "registry": "fakeregistry.yelp.com", - }, - }, - ServiceConfig: &config_store.Store{ - Data: map[string]interface{}{ - "v2": map[string]interface{}{ - "deployments": map[string]interface{}{}, - }, - }, - }, + PaastaConfig: &configstore.Store{Data: paastaConfigData}, + ServiceConfig: &configstore.Store{Data: serviceConfigData}, } - url, _ := imageProvider.getDockerRegistry() - if url != "fakeregistry.yelp.com" { + url, err := imageProvider.getDockerRegistry() + if err != nil { + t.Errorf("expected %s actual: error %+v", "fakeregistry.yelp.com", err) + } else if url != "fakeregistry.yelp.com" { t.Errorf("expected %s actual %+v", "fakeregistry.yelp.com", url) } } diff --git a/pkg/volumes/converter.go b/pkg/volumes/converter.go index 02229d8..c8df411 100644 --- a/pkg/volumes/converter.go +++ b/pkg/volumes/converter.go @@ -5,7 +5,7 @@ import ( "log" "strings" - "github.com/Yelp/paasta-tools-go/pkg/config_store" + "github.com/Yelp/paasta-tools-go/pkg/configstore" corev1 "k8s.io/api/core/v1" ) @@ -50,7 +50,7 @@ func formatMountName(hostPath string) string { } // GetDefaultPaastaKubernetesVolumes ... -func GetDefaultPaastaKubernetesVolumes(configStore *config_store.Store) ([]corev1.VolumeMount, []corev1.Volume, error) { +func GetDefaultPaastaKubernetesVolumes(configStore *configstore.Store) ([]corev1.VolumeMount, []corev1.Volume, error) { pvolumes, err := DefaultVolumesFromReader(configStore) if err != nil { err = fmt.Errorf("Error finding default volumes: %s", err) diff --git a/pkg/volumes/converter_test.go b/pkg/volumes/converter_test.go index 9c0b8f6..f0fb20c 100644 --- a/pkg/volumes/converter_test.go +++ b/pkg/volumes/converter_test.go @@ -2,9 +2,10 @@ package volumes import ( "reflect" + "sync" "testing" - "github.com/Yelp/paasta-tools-go/pkg/config_store" + "github.com/Yelp/paasta-tools-go/pkg/configstore" corev1 "k8s.io/api/core/v1" ) @@ -72,16 +73,15 @@ func TestFormatMountName(t *testing.T) { } func TestGetDefaultPaastaKubernetesVolumes(t *testing.T) { - fakeVolumeConfig := map[string]interface{}{ - "volumes": []map[string]interface{}{ - map[string]interface{}{ - "hostPath": "/foo", - "containerPath": "/bar", - "mode": "RO", - }, + fakeVolumeConfig := &sync.Map{} + fakeVolumeConfig.Store("volumes", []map[string]interface{}{ + map[string]interface{}{ + "hostPath": "/foo", + "containerPath": "/bar", + "mode": "RO", }, - } - reader := &config_store.Store{Data: fakeVolumeConfig} + }) + reader := &configstore.Store{Data: fakeVolumeConfig} volumeMounts, volumes, err := GetDefaultPaastaKubernetesVolumes(reader) if err != nil { t.Errorf("Error %s", err) diff --git a/pkg/volumes/volumes.go b/pkg/volumes/volumes.go index 99675fe..166ce9d 100644 --- a/pkg/volumes/volumes.go +++ b/pkg/volumes/volumes.go @@ -1,7 +1,7 @@ package volumes import ( - "github.com/Yelp/paasta-tools-go/pkg/config_store" + "github.com/Yelp/paasta-tools-go/pkg/configstore" ) type VolumeConfig struct { @@ -15,7 +15,7 @@ type Volume struct { } func DefaultVolumesFromReader( - configStore *config_store.Store, + configStore *configstore.Store, ) (volumes []Volume, err error) { volumeConfig := &VolumeConfig{Volumes: []Volume{}} err = configStore.Load("volumes", &volumeConfig.Volumes) diff --git a/pkg/volumes/volumes_test.go b/pkg/volumes/volumes_test.go index 1a84c7b..40149b9 100644 --- a/pkg/volumes/volumes_test.go +++ b/pkg/volumes/volumes_test.go @@ -2,22 +2,22 @@ package volumes import ( "reflect" + "sync" "testing" - "github.com/Yelp/paasta-tools-go/pkg/config_store" + "github.com/Yelp/paasta-tools-go/pkg/configstore" ) func TestDefaultVolumesFromReader(test *testing.T) { - fakeVolumeConfig := map[string]interface{}{ - "volumes": []map[string]interface{}{ - map[string]interface{}{ - "hostPath": "/foo", - "containerPath": "/bar", - "mode": "RO", - }, + fakeVolumeConfig := &sync.Map{} + fakeVolumeConfig.Store("volumes", []map[string]interface{}{ + map[string]interface{}{ + "hostPath": "/foo", + "containerPath": "/bar", + "mode": "RO", }, - } - reader := &config_store.Store{Data: fakeVolumeConfig} + }) + reader := &configstore.Store{Data: fakeVolumeConfig} actual, err := DefaultVolumesFromReader(reader) if err != nil { test.Errorf("failed to read config") From 6975a02df21a2fa4bdfd17b617af3e6e5362986d Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Mon, 27 Apr 2020 09:38:26 -0700 Subject: [PATCH 30/38] add return value to indicate missing key --- pkg/configstore/store.go | 42 +++++++++++++++++++--------------- pkg/configstore/store_test.go | 12 +++++----- pkg/deployments/deployments.go | 15 +++++++++--- pkg/volumes/volumes.go | 11 +++++---- 4 files changed, 49 insertions(+), 31 deletions(-) diff --git a/pkg/configstore/store.go b/pkg/configstore/store.go index 998c369..aefd341 100644 --- a/pkg/configstore/store.go +++ b/pkg/configstore/store.go @@ -141,7 +141,7 @@ var extensions = []string{"json", "yaml"} // Look for `file`.json or `file`.yaml, if not found try loading all files and // print a warning about hints -func (s *Store) load(file string) error { +func (s *Store) load(file string, fromHint bool) error { for _, ext := range extensions { path := path.Join(s.Dir, fmt.Sprintf("%s.%s", file, ext)) exists, err := s.FileExists(path) @@ -157,44 +157,50 @@ func (s *Store) load(file string) error { } } - log.Printf( - "WARN: loading all configs, consider adding some hints in %s", - path.Join(s.Dir, file), - ) - return s.loadAll() + if !fromHint { + log.Printf( + "WARN: loading all configs, consider adding some hints in %s", + path.Join(s.Dir, file), + ) + return s.loadAll() + } + return nil } // Get returns value for given `key`. If not found in `s.data`, call // `s.load` function with `file` from `s.hints` or `key` itself. -func (s *Store) Get(key string) (interface{}, error) { +func (s *Store) Get(key string) (interface{}, bool, error) { if val, ok := s.Data.Load(key); ok { - return val, nil + return val, ok, nil } var file string + var fromHint bool if val, ok := s.Hints[key]; ok { file = val + fromHint = true } else { file = key + fromHint = false } - err := s.load(file) + err := s.load(file, fromHint) if err != nil { - return nil, fmt.Errorf("Failed to load %v: %v", file, err) + return nil, false, fmt.Errorf("Failed to load %v: %v", file, err) } val, ok := s.Data.Load(key) - if !ok { - return nil, fmt.Errorf("key not found: %s", key) - } - return val, nil + return val, ok, nil } // Load uses mapstructure.Decode to parse result of a Get into provided // destination value -func (s *Store) Load(key string, dst interface{}) error { - val, err := s.Get(key) +func (s *Store) Load(key string, dst interface{}) (bool, error) { + val, ok, err := s.Get(key) if err != nil { - return fmt.Errorf("Failed to get %s: %v", key, err) + return false, fmt.Errorf("Failed to get %s: %v", key, err) + } + if !ok { + return false, nil } - return mapstructure.Decode(val, dst) + return true, mapstructure.Decode(val, dst) } diff --git a/pkg/configstore/store_test.go b/pkg/configstore/store_test.go index 85a89ff..69094cd 100644 --- a/pkg/configstore/store_test.go +++ b/pkg/configstore/store_test.go @@ -107,12 +107,12 @@ func TestStore_load(test *testing.T) { return true, nil }, } - s.load("one") + s.load("one", false) s.FileExists = func(path string) (bool, error) { return false, nil } s.ParseFile = unexpectedParseFile(test) s.ListFiles = func(dirname string) ([]string, error) { return []string{}, nil } - s.load("one") + s.load("one", false) } func TestStore_Get(test *testing.T) { @@ -127,7 +127,7 @@ func TestStore_Get(test *testing.T) { }, } s.Data.Store("one", "two") - val, err := s.Get("one") + val, _, err := s.Get("one") errorIf(test, err != nil, "key not found") errorUnexpected(test, "two", val) @@ -138,7 +138,7 @@ func TestStore_Get(test *testing.T) { v["two"] = "three" return nil } - val, err = s.Get("two") + val, _, err = s.Get("two") errorIf(test, err != nil, "key not found") errorUnexpected(test, "three", val) @@ -154,7 +154,7 @@ func TestStore_Get(test *testing.T) { v["three"] = "four" return nil } - val, err = s.Get("three") + val, _, err = s.Get("three") errorIf(test, err != nil, "key not found") errorUnexpected(test, "four", val) @@ -167,6 +167,6 @@ func TestStore_Get(test *testing.T) { s.FileExists = func(string) (bool, error) { return false, nil } - val, _ = s.Get("four") + val, _, _ = s.Get("four") errorIf(test, !listFilesCalled, "listFiles wasn't called") } diff --git a/pkg/deployments/deployments.go b/pkg/deployments/deployments.go index e476b07..01b855c 100644 --- a/pkg/deployments/deployments.go +++ b/pkg/deployments/deployments.go @@ -96,16 +96,22 @@ func (provider *DefaultImageProvider) DockerImageURLForDeployGroup(deploymentGro func (provider *DefaultImageProvider) getDockerRegistry() (string, error) { dockerRegistry := &DockerRegistry{Registry: ""} - err := provider.PaastaConfig.Load("docker_registry", &dockerRegistry) + ok, err := provider.PaastaConfig.Load("docker_registry", &dockerRegistry) + if !ok { + return "", fmt.Errorf("docker registry not found") + } return dockerRegistry.Registry, err } func (provider *DefaultImageProvider) getImageForDeployGroup(deploymentGroup string) (string, error) { deployments := &Deployments{V2: V2DeploymentsConfig{}} - err := provider.ServiceConfig.Load("v2", &deployments.V2) + ok, err := provider.ServiceConfig.Load("v2", &deployments.V2) if err != nil { return "", err } + if !ok { + return "", fmt.Errorf("image for deploymentGroup %v not found", deploymentGroup) + } deployment, ok := deployments.V2.Deployments[deploymentGroup] if !ok { @@ -138,7 +144,10 @@ func DeploymentAnnotations( func deploymentsFromConfig(cr *configstore.Store) (*Deployments, error) { deployments := &Deployments{} - err := cr.Load("v2", deployments) + ok, err := cr.Load("v2", deployments) + if !ok { + return nil, fmt.Errorf("deployments not found") + } return deployments, err } diff --git a/pkg/volumes/volumes.go b/pkg/volumes/volumes.go index 166ce9d..8d46ccb 100644 --- a/pkg/volumes/volumes.go +++ b/pkg/volumes/volumes.go @@ -1,6 +1,8 @@ package volumes import ( + "fmt" + "github.com/Yelp/paasta-tools-go/pkg/configstore" ) @@ -14,10 +16,11 @@ type Volume struct { Mode string `json:"mode" mapstructure:"mode"` } -func DefaultVolumesFromReader( - configStore *configstore.Store, -) (volumes []Volume, err error) { +func DefaultVolumesFromReader(configStore *configstore.Store) ([]Volume, error) { volumeConfig := &VolumeConfig{Volumes: []Volume{}} - err = configStore.Load("volumes", &volumeConfig.Volumes) + ok, err := configStore.Load("volumes", &volumeConfig.Volumes) + if !ok { + return nil, fmt.Errorf("volumes not found") + } return volumeConfig.Volumes, err } From aaa669ee207db71a7bd5d088ba9fb1d0f4d890e6 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Mon, 27 Apr 2020 11:35:26 -0700 Subject: [PATCH 31/38] load from all configs when matching file doesn't contain the key --- pkg/configstore/store.go | 27 +++++++----- pkg/configstore/store_test.go | 80 +++++++++++++++++++++++++++-------- 2 files changed, 80 insertions(+), 27 deletions(-) diff --git a/pkg/configstore/store.go b/pkg/configstore/store.go index aefd341..9e36b95 100644 --- a/pkg/configstore/store.go +++ b/pkg/configstore/store.go @@ -105,7 +105,7 @@ func NewStore(dir string, hints map[string]string) *Store { // Decode `path` contents using `json`, lock the store mutex, merge loaded data // into s.Data, unlock the mutex func (s *Store) loadPath(path string) error { - var value map[string]interface{} + value := map[string]interface{}{} err := s.ParseFile(path, &value) if err != nil { return fmt.Errorf("Failed to parse %s: %v", path, err) @@ -141,7 +141,7 @@ var extensions = []string{"json", "yaml"} // Look for `file`.json or `file`.yaml, if not found try loading all files and // print a warning about hints -func (s *Store) load(file string, fromHint bool) error { +func (s *Store) load(file string) error { for _, ext := range extensions { path := path.Join(s.Dir, fmt.Sprintf("%s.%s", file, ext)) exists, err := s.FileExists(path) @@ -157,13 +157,6 @@ func (s *Store) load(file string, fromHint bool) error { } } - if !fromHint { - log.Printf( - "WARN: loading all configs, consider adding some hints in %s", - path.Join(s.Dir, file), - ) - return s.loadAll() - } return nil } @@ -183,12 +176,26 @@ func (s *Store) Get(key string) (interface{}, bool, error) { file = key fromHint = false } - err := s.load(file, fromHint) + err := s.load(file) if err != nil { return nil, false, fmt.Errorf("Failed to load %v: %v", file, err) } val, ok := s.Data.Load(key) + if !ok { + if !fromHint { + log.Printf( + "WARN: loading all configs, consider adding some hints in %s", + path.Join(s.Dir, file), + ) + err := s.loadAll() + if err != nil { + return nil, false, fmt.Errorf("failed to load all configs: %v", err) + } + val, ok = s.Data.Load(key) + } + } + return val, ok, nil } diff --git a/pkg/configstore/store_test.go b/pkg/configstore/store_test.go index 69094cd..6289b2d 100644 --- a/pkg/configstore/store_test.go +++ b/pkg/configstore/store_test.go @@ -42,11 +42,11 @@ func TestStore_loadPath(test *testing.T) { s := &Store{ Data: &sync.Map{}, ParseFile: func(file string, val interface{}) error { - v, ok := val.(map[string]interface{}) + v, ok := val.(*map[string]interface{}) if !ok { panic("assert failed") } - v[key] = file + (*v)[key] = file return nil }, } @@ -69,11 +69,11 @@ func TestStore_loadAll(test *testing.T) { Data: &sync.Map{}, ParseFile: func(file string, val interface{}) error { fmt.Printf("parse file called: %s\n", file) - v, ok := val.(map[string]interface{}) + v, ok := val.(*map[string]interface{}) if !ok { panic("assert failed") } - v[file] = "loaded" + (*v)[file] = "loaded" return nil }, ListFiles: func(dirname string) ([]string, error) { @@ -107,12 +107,12 @@ func TestStore_load(test *testing.T) { return true, nil }, } - s.load("one", false) + s.load("one") s.FileExists = func(path string) (bool, error) { return false, nil } s.ParseFile = unexpectedParseFile(test) s.ListFiles = func(dirname string) ([]string, error) { return []string{}, nil } - s.load("one", false) + s.load("one") } func TestStore_Get(test *testing.T) { @@ -127,19 +127,21 @@ func TestStore_Get(test *testing.T) { }, } s.Data.Store("one", "two") - val, _, err := s.Get("one") - errorIf(test, err != nil, "key not found") + val, ok, err := s.Get("one") + errorIf(test, !ok, "key not found") + errorIf(test, err != nil, fmt.Sprintf("err when loading: %v", err)) errorUnexpected(test, "two", val) // key is missing, file with same name exists s.FileExists = func(path string) (bool, error) { return true, nil } s.ParseFile = func(file string, val interface{}) error { - v := val.(map[string]interface{}) - v["two"] = "three" + v := val.(*map[string]interface{}) + (*v)["two"] = "three" return nil } - val, _, err = s.Get("two") - errorIf(test, err != nil, "key not found") + val, ok, err = s.Get("two") + errorIf(test, !ok, "key not found") + errorIf(test, err != nil, fmt.Sprintf("err when loading: %v", err)) errorUnexpected(test, "three", val) // key is missing, file corresponding to a hint exists @@ -150,13 +152,27 @@ func TestStore_Get(test *testing.T) { } s.ParseFile = func(file string, val interface{}) error { errorUnexpected(test, "zero/four.json", file) - v := val.(map[string]interface{}) - v["three"] = "four" + v := val.(*map[string]interface{}) + (*v)["three"] = "four" return nil } - val, _, err = s.Get("three") - errorIf(test, err != nil, "key not found") + val, ok, err = s.Get("three") + errorIf(test, !ok, "key not found") + errorIf(test, err != nil, fmt.Sprintf("err when loading: %v", err)) errorUnexpected(test, "four", val) +} + +func TestStore_GetLoadAllWhenNoKey(test *testing.T) { + s := &Store{ + Dir: "zero", + Data: &sync.Map{}, + ParseFile: unexpectedParseFile(test), + ListFiles: unexpectedListFiles(test), + FileExists: func(path string) (bool, error) { + test.Fatalf("unexpected call to fileExists(%s)", path) + return true, nil + }, + } // key is missing, file is missing, hint is missing, loaded from all listFilesCalled := false @@ -167,6 +183,36 @@ func TestStore_Get(test *testing.T) { s.FileExists = func(string) (bool, error) { return false, nil } - val, _, _ = s.Get("four") + s.Get("four") errorIf(test, !listFilesCalled, "listFiles wasn't called") } + +func TestStore_GetCallsListAllWhenMatchingFileHasNoKey(test *testing.T) { + s := &Store{ + Dir: "zero", + Data: &sync.Map{}, + ParseFile: unexpectedParseFile(test), + ListFiles: unexpectedListFiles(test), + FileExists: func(path string) (bool, error) { + test.Fatalf("unexpected call to fileExists(%s)", path) + return true, nil + }, + } + + // file exists, but key in different file + listFilesCalled := false + s.ListFiles = func(string) ([]string, error) { + listFilesCalled = true + return []string{}, nil + } + s.FileExists = func(string) (bool, error) { + return true, nil + } + s.ParseFile = func(file string, val interface{}) error { + v := val.(*map[string]interface{}) + (*v)["five"] = "five" + return nil + } + s.Get("five") + errorIf(test, listFilesCalled, "listFiles wasn't called") +} From 66c3bd0d541c1c9401cf6c92f44a1086f87fd847 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Mon, 27 Apr 2020 12:03:17 -0700 Subject: [PATCH 32/38] create context once and pass it around --- cmd/paasta-metastatus/main.go | 60 +++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/cmd/paasta-metastatus/main.go b/cmd/paasta-metastatus/main.go index b878eb2..7a32604 100644 --- a/cmd/paasta-metastatus/main.go +++ b/cmd/paasta-metastatus/main.go @@ -108,20 +108,22 @@ func getMetastatusCmdArgs(opts *PaastaMetastatusOptions) ([]string, time.Duratio return cmdArgs, timeout } -func printAPIStatus(cluster, endpoint string, opts *PaastaMetastatusOptions, sb *strings.Builder) error { +func printAPIStatus( + ctx context.Context, + cluster, endpoint string, + cmdArgs []string, + sb *strings.Builder, +) error { url, err := url.Parse(endpoint) if err != nil { return fmt.Errorf("Failed to parse API endpoint %v: %v", endpoint, err) } var ( - transport = httptransport.New(url.Host, apiclient.DefaultBasePath, []string{url.Scheme}) - client = apiclient.New(transport, strfmt.Default) - cmdArgs, timeout = getMetastatusCmdArgs(opts) + transport = httptransport.New(url.Host, apiclient.DefaultBasePath, []string{url.Scheme}) + client = apiclient.New(transport, strfmt.Default) ) - ctx, cancel := context.WithTimeout(context.Background(), timeout*time.Second) - defer cancel() mp := &operations.MetastatusParams{CmdArgs: cmdArgs, Context: ctx} resp, err := client.Operations.Metastatus(mp) if err != nil { @@ -131,22 +133,20 @@ func printAPIStatus(cluster, endpoint string, opts *PaastaMetastatusOptions, sb return nil } -func printClusterStatus( +func getClusterStatus( + ctx context.Context, cluster, endpoint string, dashboards map[string]interface{}, - opts *PaastaMetastatusOptions, -) bool { + cmdArgs []string, +) (*strings.Builder, error) { sb := &strings.Builder{} sb.WriteString(fmt.Sprintf("Cluster: %v\n", cluster)) printDashboards(cluster, dashboards, sb) - success := true - err := printAPIStatus(cluster, endpoint, opts, sb) + err := printAPIStatus(ctx, cluster, endpoint, cmdArgs, sb) if err != nil { - success = false - sb.WriteString(fmt.Sprintf("Failed to get status for cluster %v: %v\n", cluster, err)) + return sb, fmt.Errorf("Failed to get status for cluster %v: %v", cluster, err) } - fmt.Print(sb.String()) - return success + return sb, nil } func metastatus(opts *PaastaMetastatusOptions) (bool, error) { @@ -158,27 +158,31 @@ func metastatus(opts *PaastaMetastatusOptions) (bool, error) { sysStore := configstore.NewStore(opts.SysDir, nil) apiEndpoints := map[string]string{} - err := sysStore.Load("api_endpoints", &apiEndpoints) - if err != nil { - return false, fmt.Errorf("Failed to load api_endpoints from configs: %v", err) + ok, err := sysStore.Load("api_endpoints", &apiEndpoints) + if !ok || err != nil { + return false, fmt.Errorf("Failed to load api_endpoints from configs: found=%v, error=%v", ok, err) } dashboardLinks := map[string]map[string]interface{}{} - err = sysStore.Load("dashboard_links", &dashboardLinks) - if err != nil { - return false, fmt.Errorf("Failed to load dashboard_links from configs: %v", err) + ok, err = sysStore.Load("dashboard_links", &dashboardLinks) + if !ok || err != nil { + return false, fmt.Errorf("Failed to load dashboard_links from configs: found=%v, error=%v", ok, err) } var clusters []string if opts.Cluster != "" { clusters = []string{opts.Cluster} } else { - err := sysStore.Load("clusters", &clusters) - if err != nil { - return false, fmt.Errorf("Failed to load clusters from configs: %v", err) + ok, err := sysStore.Load("clusters", &clusters) + if !ok || err != nil { + return false, fmt.Errorf("Failed to load clusters from configs: found=%v, error=%v", ok, err) } } + cmdArgs, timeout := getMetastatusCmdArgs(opts) + ctx, cancel := context.WithTimeout(context.Background(), timeout*time.Second) + defer cancel() + var wg sync.WaitGroup var success bool = true for _, cluster := range clusters { @@ -187,12 +191,14 @@ func metastatus(opts *PaastaMetastatusOptions) (bool, error) { fmt.Printf("WARN: api endpoint not found for %v\n", cluster) continue } - dashboards, ok := dashboardLinks[cluster] + dashboards, _ := dashboardLinks[cluster] wg.Add(1) go func(cluster, endpoint string) { defer wg.Done() - if !printClusterStatus(cluster, endpoint, dashboards, opts) { - success = false + sb, err := getClusterStatus(ctx, cluster, endpoint, dashboards, cmdArgs) + fmt.Print(sb) + if err != nil { + fmt.Fprint(os.Stderr, err.Error()) } }(cluster, endpoint) } From e099eef9367e65f6f6f33f43b06e49f53dd7eb90 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Sat, 2 May 2020 14:41:05 -0700 Subject: [PATCH 33/38] make testable, add tests, fix bugs --- cmd/paasta-metastatus/main.go | 130 ++++++++++++++++---------- cmd/paasta-metastatus/main_test.go | 145 +++++++++++++++++++++++++++++ go.sum | 1 + 3 files changed, 227 insertions(+), 49 deletions(-) create mode 100644 cmd/paasta-metastatus/main_test.go diff --git a/cmd/paasta-metastatus/main.go b/cmd/paasta-metastatus/main.go index 7a32604..b8dc5d8 100644 --- a/cmd/paasta-metastatus/main.go +++ b/cmd/paasta-metastatus/main.go @@ -3,6 +3,7 @@ package main import ( "context" "fmt" + "io" "net/url" "os" "strings" @@ -17,6 +18,7 @@ import ( apiclient "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client" "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/operations" + "github.com/go-openapi/runtime" httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -44,7 +46,7 @@ func parseFlags(opts *PaastaMetastatusOptions) error { return nil } -func printDashboards( +func writeDashboards( cluster string, dashboards map[string]interface{}, sb *strings.Builder, ) { if dashboards == nil { @@ -64,13 +66,15 @@ func printDashboards( switch d := dashboard.(type) { case string: sb.WriteString(aurora.Cyan(d).String()) - case []interface{}: + case []string: if len(d) > 1 { for _, url := range d { - sb.WriteString(fmt.Sprintf("\n %v", aurora.Cyan(url.(string)))) + sb.WriteString( + fmt.Sprintf("\n %v", aurora.Cyan(url)), + ) } - } else { - sb.WriteString(aurora.Cyan(d[0].(string)).String()) + } else if len(d) == 1 { + sb.WriteString(aurora.Cyan(d[0]).String()) } } sb.WriteString("\n") @@ -78,7 +82,7 @@ func printDashboards( } } -func getMetastatusCmdArgs(opts *PaastaMetastatusOptions) ([]string, time.Duration) { +func buildMetastatusCmdArgs(opts *PaastaMetastatusOptions) ([]string, time.Duration) { cmdArgs := []string{} verbosity := 0 timeout := time.Duration(20) @@ -108,7 +112,15 @@ func getMetastatusCmdArgs(opts *PaastaMetastatusOptions) ([]string, time.Duratio return cmdArgs, timeout } -func printAPIStatus( +type ctxKey int + +const ( + ctxKeyTransport ctxKey = iota + ctxKeyOut + ctxKeyErr +) + +func writeAPIStatus( ctx context.Context, cluster, endpoint string, cmdArgs []string, @@ -119,11 +131,15 @@ func printAPIStatus( return fmt.Errorf("Failed to parse API endpoint %v: %v", endpoint, err) } - var ( + var transport runtime.ClientTransport + ctxTransport := ctx.Value(ctxKeyTransport) + if ctxTransport != nil { + transport = ctxTransport.(runtime.ClientTransport) + } else { transport = httptransport.New(url.Host, apiclient.DefaultBasePath, []string{url.Scheme}) - client = apiclient.New(transport, strfmt.Default) - ) + } + client := apiclient.New(transport, strfmt.Default) mp := &operations.MetastatusParams{CmdArgs: cmdArgs, Context: ctx} resp, err := client.Operations.Metastatus(mp) if err != nil { @@ -141,54 +157,30 @@ func getClusterStatus( ) (*strings.Builder, error) { sb := &strings.Builder{} sb.WriteString(fmt.Sprintf("Cluster: %v\n", cluster)) - printDashboards(cluster, dashboards, sb) - err := printAPIStatus(ctx, cluster, endpoint, cmdArgs, sb) + writeDashboards(cluster, dashboards, sb) + err := writeAPIStatus(ctx, cluster, endpoint, cmdArgs, sb) if err != nil { return sb, fmt.Errorf("Failed to get status for cluster %v: %v", cluster, err) } return sb, nil } -func metastatus(opts *PaastaMetastatusOptions) (bool, error) { - if opts.AutoscalingInfo { - if opts.Verbosity < 2 { - opts.Verbosity = 2 - } - } - sysStore := configstore.NewStore(opts.SysDir, nil) - - apiEndpoints := map[string]string{} - ok, err := sysStore.Load("api_endpoints", &apiEndpoints) - if !ok || err != nil { - return false, fmt.Errorf("Failed to load api_endpoints from configs: found=%v, error=%v", ok, err) - } - - dashboardLinks := map[string]map[string]interface{}{} - ok, err = sysStore.Load("dashboard_links", &dashboardLinks) - if !ok || err != nil { - return false, fmt.Errorf("Failed to load dashboard_links from configs: found=%v, error=%v", ok, err) - } - - var clusters []string - if opts.Cluster != "" { - clusters = []string{opts.Cluster} - } else { - ok, err := sysStore.Load("clusters", &clusters) - if !ok || err != nil { - return false, fmt.Errorf("Failed to load clusters from configs: found=%v, error=%v", ok, err) - } - } - - cmdArgs, timeout := getMetastatusCmdArgs(opts) - ctx, cancel := context.WithTimeout(context.Background(), timeout*time.Second) - defer cancel() +func metastatus( + ctx context.Context, + clusters []string, + apiEndpoints map[string]string, + dashboardLinks map[string]map[string]interface{}, + cmdArgs []string, +) (bool, error) { + outf := ctx.Value(ctxKeyOut).(io.Writer) + errf := ctx.Value(ctxKeyErr).(io.Writer) var wg sync.WaitGroup var success bool = true for _, cluster := range clusters { endpoint, ok := apiEndpoints[cluster] if !ok { - fmt.Printf("WARN: api endpoint not found for %v\n", cluster) + fmt.Fprintf(errf, "WARN: api endpoint not found for %v\n", cluster) continue } dashboards, _ := dashboardLinks[cluster] @@ -196,9 +188,9 @@ func metastatus(opts *PaastaMetastatusOptions) (bool, error) { go func(cluster, endpoint string) { defer wg.Done() sb, err := getClusterStatus(ctx, cluster, endpoint, dashboards, cmdArgs) - fmt.Print(sb) + fmt.Fprint(outf, sb) if err != nil { - fmt.Fprint(os.Stderr, err.Error()) + fmt.Fprint(errf, err.Error()) } }(cluster, endpoint) } @@ -219,7 +211,47 @@ func main() { flag.PrintDefaults() os.Exit(0) } - success, err := metastatus(options) + + if options.AutoscalingInfo { + if options.Verbosity < 2 { + options.Verbosity = 2 + } + } + sysStore := configstore.NewStore(options.SysDir, nil) + + apiEndpoints := map[string]string{} + ok, err := sysStore.Load("api_endpoints", &apiEndpoints) + if !ok || err != nil { + fmt.Fprintf(os.Stderr, "Failed to load api_endpoints from configs: found=%v, error=%v", ok, err) + os.Exit(1) + } + + dashboardLinks := map[string]map[string]interface{}{} + ok, err = sysStore.Load("dashboard_links", &dashboardLinks) + if !ok || err != nil { + fmt.Fprintf(os.Stderr, "Failed to load dashboard_links from configs: found=%v, error=%v", ok, err) + os.Exit(1) + } + + var clusters []string + if options.Cluster != "" { + clusters = []string{options.Cluster} + } else { + ok, err := sysStore.Load("clusters", &clusters) + if !ok || err != nil { + fmt.Fprintf(os.Stderr, "Failed to load clusters from configs: found=%v, error=%v", ok, err) + os.Exit(1) + } + } + + cmdArgs, timeout := buildMetastatusCmdArgs(options) + ctx, cancel := context.WithTimeout(context.Background(), timeout*time.Second) + defer cancel() + + ctx = context.WithValue(ctx, ctxKeyOut, os.Stdout) + ctx = context.WithValue(ctx, ctxKeyErr, os.Stderr) + + success, err := metastatus(ctx, clusters, apiEndpoints, dashboardLinks, cmdArgs) if err != nil { fmt.Println(err) os.Exit(1) diff --git a/cmd/paasta-metastatus/main_test.go b/cmd/paasta-metastatus/main_test.go new file mode 100644 index 0000000..c66a032 --- /dev/null +++ b/cmd/paasta-metastatus/main_test.go @@ -0,0 +1,145 @@ +package main + +import ( + "context" + "reflect" + "regexp" + "strings" + "testing" + "time" + + "github.com/Yelp/paasta-tools-go/pkg/cli" + + "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" + + "github.com/go-openapi/runtime" + "github.com/stretchr/testify/assert" + + operations "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/operations" +) + +type MockTransport struct { + Ops []*runtime.ClientOperation +} + +func (m *MockTransport) Submit(co *runtime.ClientOperation) (interface{}, error) { + m.Ops = append(m.Ops, co) + return &operations.MetastatusOK{ + Payload: &models.MetaStatus{ + Output: "foo", + }, + }, nil +} + +func (m *MockTransport) Reset() { + m.Ops = []*runtime.ClientOperation{} +} + +func makeTestContext() context.Context { + t := &MockTransport{} + err := &strings.Builder{} + out := &strings.Builder{} + ctx := context.WithValue(context.Background(), ctxKeyTransport, t) + ctx = context.WithValue(ctx, ctxKeyOut, out) + ctx = context.WithValue(ctx, ctxKeyErr, err) + return ctx +} + +func TestMetastatus(test *testing.T) { + ctx := makeTestContext() + mockCmdArgs := []string{"foo", "bar"} + metastatus( + ctx, + []string{"cluster-foo"}, + map[string]string{"cluster-foo": "endpoint-foo"}, + map[string]map[string]interface{}{ + "cluster-foo": { + "dashboard-foo-1": "dashboard-foo-1-content", + }, + }, + mockCmdArgs, + ) + + transport := ctx.Value(ctxKeyTransport).(*MockTransport) + if len(transport.Ops) != 1 { + test.Logf("opes: %v", transport.Ops) + test.Errorf("expected number of operations: 1, got: %v", len(transport.Ops)) + } + + metastatusOp := transport.Ops[0] + if metastatusOp.PathPattern != "/metastatus" { + test.Errorf("unexpected path: %v", metastatusOp.PathPattern) + } + + params := metastatusOp.Params.(*operations.MetastatusParams) + if !reflect.DeepEqual(params.CmdArgs, mockCmdArgs) { + test.Errorf("expected mock args: %v, actual: %v", mockCmdArgs, params.CmdArgs) + } + + errf := ctx.Value(ctxKeyErr).(*strings.Builder) + if errf.String() != "" { + test.Errorf("error stream not empty: %v", errf) + } + + outf := ctx.Value(ctxKeyOut).(*strings.Builder) + outs := outf.String() + ok, _ := regexp.MatchString(`Cluster: cluster-foo`, outs) + if !ok { + test.Errorf("out doesn't match `Cluster: cluster-foo`:\n%v", outs) + } +} + +func Test_writeDashboards(test *testing.T) { + sb := &strings.Builder{} + writeDashboards("cluster-foo", nil, sb) + assert.Regexp(test, `No dashboards configured`, sb.String()) + + sb = &strings.Builder{} + writeDashboards( + "cluster-foo", + map[string]interface{}{ + "one": "two", + "three": []string{"four"}, + "five": []string{"six", "seven"}, + }, + sb, + ) + assert.Regexp(test, `one:.*two`, sb.String()) + assert.Regexp(test, `three:.*four`, sb.String()) + assert.Regexp(test, `five:.*\n.*six.*\n.*seven`, sb.String()) +} +func Test_buildMetastatusCmdArgs(test *testing.T) { + args, timeout := buildMetastatusCmdArgs(&PaastaMetastatusOptions{}) + assert.Equal(test, args, []string{}) + assert.Equal(test, timeout, time.Duration(20)) + + args, timeout = buildMetastatusCmdArgs(&PaastaMetastatusOptions{ + PaastaOptions: cli.PaastaOptions{Verbosity: 5}, + }) + assert.Equal(test, args, []string{"-vvvvv"}) + assert.Equal(test, timeout, time.Duration(120)) + + args, timeout = buildMetastatusCmdArgs(&PaastaMetastatusOptions{ + AutoscalingInfo: true, + }) + assert.Equal(test, args, []string{"-a", "-vv"}) + assert.Equal(test, timeout, time.Duration(120)) + + args, _ = buildMetastatusCmdArgs(&PaastaMetastatusOptions{ + Groupings: []string{"foo", "bar"}, + }) + assert.Equal(test, args, []string{"-g", "foo", "bar"}) + + args, _ = buildMetastatusCmdArgs(&PaastaMetastatusOptions{ + PaastaOptions: cli.PaastaOptions{UseMesosCache: true}, + }) + assert.Equal(test, args, []string{"--use-mesos-cache"}) +} + +func Test_writeAPIStatus(test *testing.T) { + // TODO: more tests +} + +func Test_getClusterStatus(test *testing.T) { + // TODO: more tests +} diff --git a/go.sum b/go.sum index 7cbe847..c1b5528 100644 --- a/go.sum +++ b/go.sum @@ -365,6 +365,7 @@ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijb github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yelp/paasta-tools-go v0.0.0-20200427191252-351d9715626f h1:rdWD6ESbIWIm5ZZRToe4P4QpMsW95JdhtXyClEBjFrA= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= From 50ea1980353fc02642a9558324f4d6f718948672 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Sat, 2 May 2020 17:24:03 -0700 Subject: [PATCH 34/38] sync with master --- pkg/test_framework/harness.go | 153 +++++++++++++++++---- pkg/test_framework/harness_test.go | 213 ++++++++++++++++++++--------- pkg/test_framework/test_test.go | 149 ++++++++++++-------- 3 files changed, 366 insertions(+), 149 deletions(-) diff --git a/pkg/test_framework/harness.go b/pkg/test_framework/harness.go index f13f69f..09ed86c 100644 --- a/pkg/test_framework/harness.go +++ b/pkg/test_framework/harness.go @@ -8,6 +8,7 @@ import ( "os" "path/filepath" "regexp" + "sync/atomic" "testing" "time" @@ -15,15 +16,22 @@ import ( "github.com/dlespiau/kube-test-harness/logger" htesting "github.com/dlespiau/kube-test-harness/testing" "github.com/subosito/gotenv" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" client "sigs.k8s.io/controller-runtime/pkg/client" ) +type internalState struct { + testCounter uint32 +} + type Harness struct { + internalState harness.Harness Options Options Sinks Sinks + Scheme *runtime.Scheme Client client.Client } @@ -43,6 +51,8 @@ func (h *Harness) NewTest(t htesting.T) *Test { Test: *test, operatorRunning: false, harness: h, + testCount: atomic.AddUint32(&h.internalState.testCounter, 1), + envs: map[string]string{}, } } @@ -59,10 +69,11 @@ func (h *Harness) OpenManifest(manifest string) (*os.File, error) { type Options struct { harness.Options - Makefile string - MakeDir string - Prefix string - OperatorStartDelay time.Duration + Makefile string + MakeDir string + Prefix string + OperatorDelay time.Duration + EnvAlways bool } // Users can use these to capture the "console" output from the spawned sub-processes rather than @@ -75,16 +86,92 @@ type Sinks struct { var Kube *Harness -func Parse() *Options { - noCleanup := flag.Bool("k8s.no-cleanup", false, "should test cleanup after themselves") - verbose := flag.Bool("k8s.log.verbose", false, "turn on more verbose logging") - makefile := flag.String("k8s.makefile", "Makefile", "makefile for cluster manipulation targets, relative to makedir") - makedir := flag.String("k8s.makedir", "", "directory to makefile") - prefix := flag.String("k8s.prefix", "test", "prefix for make cluster manipulation targets") - manifests := flag.String("k8s.manifests", "manifests", "directory to K8s manifests") - delay := flag.Duration("k8s.op-delay", 2 * time.Second, "operator start delay") +type ParseOptions struct { + MakeDir string + Manifests string + Prefix string + NoCleanup bool + OperatorDelay time.Duration + EnvAlways bool + OsArgs []string + CmdLine *flag.FlagSet +} + +type ParseOptionFn func (a* ParseOptions) + +func DefaultMakeDir(makedir string) ParseOptionFn { + return func(a* ParseOptions) { + a.MakeDir = makedir + } +} + +func DefaultManifests(manifests string) ParseOptionFn { + return func(a* ParseOptions) { + a.Manifests = manifests + } +} + +func DefaultPrefix(prefix string) ParseOptionFn { + return func(a* ParseOptions) { + a.Prefix = prefix + } +} + +func DefaultNoCleanup() ParseOptionFn { + return func(a* ParseOptions) { + a.NoCleanup = true + } +} + +func DefaultOperatorDelay(opdelay time.Duration) ParseOptionFn { + return func(a* ParseOptions) { + a.OperatorDelay = opdelay + } +} + +func DefaultEnvAlways() ParseOptionFn { + return func(a* ParseOptions) { + a.EnvAlways = true + } +} + +func OverrideOsArgs(osargs []string) ParseOptionFn { + return func(a* ParseOptions) { + a.OsArgs = osargs + } +} + +func OverrideCmdLine(cmdline *flag.FlagSet) ParseOptionFn { + return func(a* ParseOptions) { + a.CmdLine = cmdline + } +} + +// We are making use of Functional Options pattern here. +func Parse(opts ...ParseOptionFn) *Options { + args := ParseOptions{ + MakeDir: "", + Manifests: "manifests", + Prefix: "test", + NoCleanup: false, + OperatorDelay: 2 * time.Second, + EnvAlways: false, + OsArgs: os.Args[1:], + CmdLine: flag.CommandLine, + } + for _, opt := range opts { + opt(&args) + } - flag.Parse() + noCleanup := args.CmdLine.Bool("k8s.no-cleanup", args.NoCleanup, "should test cleanup after themselves") + verbose := args.CmdLine.Bool("k8s.log.verbose", false, "turn on more verbose logging") + makefile := args.CmdLine.String("k8s.makefile", "Makefile", "makefile for cluster manipulation targets, relative to MakeDir") + makedir := args.CmdLine.String("k8s.makedir", args.MakeDir, "directory to makefile") + prefix := args.CmdLine.String("k8s.prefix", args.Prefix, "prefix for make cluster manipulation targets") + manifests := args.CmdLine.String("k8s.manifests", args.Manifests, "directory to K8s manifests") + delay := args.CmdLine.Duration("k8s.op-delay", args.OperatorDelay, "operator start delay") + envAlways := args.CmdLine.Bool("k8s.env-always", args.EnvAlways, "always use environment variables from makefile") + _ = args.CmdLine.Parse(args.OsArgs) // NOTE: We call "sanitize" functions both here and in Start(). This is to enable // the users to create Options by hand, in case if they do not want to use this @@ -95,10 +182,11 @@ func Parse() *Options { NoCleanup: *noCleanup, Logger: &logger.PrintfLogger{}, }, - Makefile: *makefile, - MakeDir: sanitizeMakeDir(*makedir), - Prefix: sanitizePrefix(*prefix), - OperatorStartDelay: *delay, + Makefile: *makefile, + MakeDir: sanitizeMakeDir(*makedir), + Prefix: sanitizePrefix(*prefix), + OperatorDelay: *delay, + EnvAlways: *envAlways, } if *verbose { options.LogLevel = logger.Debug @@ -107,14 +195,18 @@ func Parse() *Options { return &options } -func Start(m *testing.M, options Options, sinks Sinks) { +// We have a fair number of optional parameters here, let's use poor man's default +func Start(options Options, sinks* Sinks, scheme* runtime.Scheme) { // NOTE: We call "sanitize" functions both here and in Parse() to avoid // strong coupling, i.e. we do not make strong assumption as to the format // of MakeDir and Prefix here, hence allowing the user to skip Parse() options.MakeDir = sanitizeMakeDir(options.MakeDir) options.Prefix = sanitizePrefix(options.Prefix) - Kube = startHarness(options, sinks) - Kube.Client = newClient() + if sinks == nil { + sinks = &Sinks{} + } + Kube = startHarness(options, *sinks, scheme) + Kube.Client = newClient(scheme) } // NOTE: this function MUST be idempotent, because it will be called both @@ -153,7 +245,7 @@ func newClientConfig(kubeconfig string) (*rest.Config, error) { ).ClientConfig() } -func newClient() client.Client { +func newClient(scheme* runtime.Scheme) client.Client { kubeconfig := os.Getenv("KUBECONFIG") if len(kubeconfig) == 0 { log.Panicf("KUBECONFIG is empty or not set") @@ -164,7 +256,10 @@ func newClient() client.Client { log.Panic(err) } - cclient, err := client.New(config, client.Options{}) + cclient, err := client.New(config, client.Options{ + Scheme: scheme, + Mapper: nil, + }) if err != nil { log.Panic(err) } @@ -172,15 +267,17 @@ func newClient() client.Client { return cclient } -func startHarness(options Options, sinks Sinks) *Harness { +func startHarness(options Options, sinks Sinks, scheme* runtime.Scheme) *Harness { checkMakefile(options, sinks) buildEnv(options, sinks) stopCluster(options, sinks) startCluster(options, sinks) return &Harness{ + internalState: internalState{0}, Harness: *harness.New(options.Options), Options: options, Sinks: sinks, + Scheme: scheme, Client: nil, } } @@ -191,7 +288,7 @@ func checkMakefile(options Options, sinks Sinks) { check := func(target string) { args := []string{"make", "-s", "-f", makefile, "-C", makedir, "--dry-run", target} log.Printf("Checking %v ...", args) - err := run(sinks.Stdout, sinks.Stderr, args) + err := run(sinks.Stdout, sinks.Stderr, args, nil) if err != nil { log.Panicf("error checking target %s: %v", target, err) } else { @@ -227,7 +324,7 @@ func buildEnv(options Options, sinks Sinks) { // clone sinks.Stdout and add exports cout := append([]io.Writer{}, sinks.Stdout...) cout = append(cout, &exports) - err := run(cout, sinks.Stderr, args) + err := run(cout, sinks.Stderr, args, nil) if err != nil { log.Panic(err) } @@ -240,7 +337,7 @@ func buildEnv(options Options, sinks Sinks) { for key, val := range env { // Empty environment variable looks the same as undefined to // the user, so let's treat them the same way here, too - if old, present := os.LookupEnv(key); !present || old == "" { + if old, present := os.LookupEnv(key); options.EnvAlways || !present || old == "" { if err := os.Setenv(key, val); err != nil { log.Panic(err) } @@ -253,7 +350,7 @@ func startCluster(options Options, sinks Sinks) { makedir := options.MakeDir args := []string{"make", "-s", "-f", makefile, "-C", makedir, options.clusterStart()} log.Printf("Running %v ...", args) - err := run(sinks.Stdout, sinks.Stderr, args) + err := run(sinks.Stdout, sinks.Stderr, args, nil) if err != nil { log.Panic(err) } @@ -275,6 +372,6 @@ func stopCluster(options Options, sinks Sinks) { args := []string{"make", "-s", "-f", makefile, "-C", makedir, options.clusterStop()} log.Printf("Running %v ...", args) // if this fails that's perfectly OK - the cluster might not have been running! - _ = run(sinks.Stdout, sinks.Stderr, args) + _ = run(sinks.Stdout, sinks.Stderr, args, nil) log.Print("... done") } diff --git a/pkg/test_framework/harness_test.go b/pkg/test_framework/harness_test.go index c9e47a7..d78dded 100644 --- a/pkg/test_framework/harness_test.go +++ b/pkg/test_framework/harness_test.go @@ -2,14 +2,14 @@ package framework import ( "bytes" + "flag" "fmt" "io" "os" "path/filepath" "testing" + "time" - harness "github.com/dlespiau/kube-test-harness" - "github.com/dlespiau/kube-test-harness/logger" "github.com/stretchr/testify/assert" ) @@ -78,9 +78,9 @@ func TestSanitizePrefix(t *testing.T) { func TestRunNoOutput(t *testing.T) { args := []string{"make", "-s", "-C", "tests", "default"} _ = os.Setenv("RND", "BAZ") - err := run([]io.Writer{}, nil, args) + err := run([]io.Writer{}, nil, args, nil) assert.NoError(t, err) - err = run(nil, []io.Writer{}, args) + err = run(nil, []io.Writer{}, args, nil) assert.NoError(t, err) } @@ -89,48 +89,137 @@ func TestRunSimple(t *testing.T) { cout := bytes.Buffer{} cerr := bytes.Buffer{} args := []string{"make", "-s", "-C", "tests", "default"} - _ = os.Setenv("RND", "BAZ") - err := run([]io.Writer{&cout}, []io.Writer{&cerr}, args) + envs := map[string]string{"RND": "BAZ"} + err := run([]io.Writer{&cout}, []io.Writer{&cerr}, args, envs) assert.NoError(t, err) assert.Equal(t, "default BAZ\n", cout.String()) assert.Empty(t, cerr.String()) } -func newOptions(args ... string) *Options { - prefix := "tests" - if len(args) >= 1 { - prefix = args[0] - } - nocleanup := false - if len(args) >= 2 { - nocleanup = args[1] == "nocleanup" - } - - return &Options{ - Options: harness.Options{ - ManifestDirectory: "", - NoCleanup: nocleanup, - Logger: &logger.PrintfLogger{}, - }, - Makefile: "Makefile", - MakeDir: sanitizeMakeDir("tests"), - Prefix: sanitizePrefix(prefix), - } +func TestParse(t *testing.T) { + // Verify default options + defs := *Parse(OverrideOsArgs([]string{})) + assert.Equal(t, "manifests", defs.ManifestDirectory) + assert.Equal(t, false, defs.NoCleanup) + assert.Equal(t, "Makefile", defs.Makefile) + assert.Equal(t, sanitizeMakeDir(""), defs.MakeDir) + assert.Equal(t, "test-", defs.Prefix) + assert.Equal(t, 2 * time.Second, defs.OperatorDelay) + assert.Equal(t, false, defs.EnvAlways) + + // Test handling of unknown options + assert.Panics(t, func() { + _ = Parse( + OverrideOsArgs([]string{"-no-such-option"}), + OverrideCmdLine(flag.NewFlagSet("tests", flag.PanicOnError)), + ) + }) + + // Test individual options (except verbose) + r1 := defs + r1.MakeDir = sanitizeMakeDir("foo") + r1.ManifestDirectory = "baz" + r1.Prefix = "fizz-" + r1.OperatorDelay = 5 * time.Second + r1.NoCleanup = true + r1.EnvAlways = true + + // Options can be set with Default... functions + o1 := *Parse( + DefaultMakeDir("foo"), + DefaultManifests("baz"), + DefaultPrefix("fizz"), + DefaultOperatorDelay(5 * time.Second), + DefaultNoCleanup(), + DefaultEnvAlways(), + OverrideOsArgs([]string{}), + OverrideCmdLine(flag.NewFlagSet("tests", flag.PanicOnError)), + ) + + // Options can be set with command line + assert.Equal(t, r1, o1) + o2 := *Parse( + OverrideOsArgs([]string{ + "-k8s.makedir=foo", + "-k8s.manifests=baz", + "-k8s.prefix=fizz", + "-k8s.op-delay=5s", + "-k8s.no-cleanup=true", + "-k8s.env-always=true", + }), + OverrideCmdLine(flag.NewFlagSet("tests", flag.PanicOnError)), + ) + assert.Equal(t, r1, o2) + + // Options can be set with Default... functions and overridden from command line + o3 := *Parse( + DefaultMakeDir("foo"), + DefaultManifests("baz"), + DefaultPrefix("fizz"), + DefaultOperatorDelay(5 * time.Second), + DefaultNoCleanup(), + DefaultEnvAlways(), + OverrideOsArgs([]string{ + "-k8s.makedir=tests", + "-k8s.manifests=manifests", + "-k8s.prefix=tests", + "-k8s.op-delay=2s", + "-k8s.no-cleanup=false", + "-k8s.env-always=false", + }), + OverrideCmdLine(flag.NewFlagSet("tests", flag.PanicOnError)), + ) + r2 := defs + r2.Prefix = "tests-" + r2.MakeDir = sanitizeMakeDir("tests") + assert.Equal(t, r2, o3) + + // Test merging of options + oflags := flag.NewFlagSet("tests", flag.PanicOnError) + something := oflags.Bool("something", false, "some bool value") + o4 := *Parse( + OverrideOsArgs([]string{"-k8s.no-cleanup", "-k8s.prefix", "buzz", "-something", "true"}), + OverrideCmdLine(oflags), + ) + r3 := defs + r3.NoCleanup = true + r3.Prefix = "buzz-" + assert.Equal(t, r3, o4) + assert.Equal(t, true, *something) } -func TestCheckAll(t *testing.T) { - options := *newOptions() +func newOptions(opts ...ParseOptionFn) *Options { + // The options in the front are applied first + opts = append([]ParseOptionFn{ + OverrideOsArgs([]string{}), + OverrideCmdLine(flag.NewFlagSet("tests", flag.PanicOnError)), + DefaultMakeDir("tests"), + DefaultPrefix("tests"), + }, opts ...) + return Parse(opts...) +} + +func newSinks() (Sinks, *bytes.Buffer, *bytes.Buffer, *bytes.Buffer) { cout := bytes.Buffer{} cerr := bytes.Buffer{} operator := bytes.Buffer{} - sinks := Sinks{[]io.Writer{&cout}, []io.Writer{&cerr}, []io.Writer{&operator}} + return Sinks{ + Stdout: []io.Writer{&cout}, + Stderr: []io.Writer{&cerr}, + Operator: []io.Writer{&operator}, + }, &cout, &cerr, &operator +} + +func TestCheckAll(t *testing.T) { + options := *newOptions() + sinks, cout, cerr, operator := newSinks() checkMakefile(options, sinks) assert.Regexp(t, `^echo "export RND=.* echo "tests-cluster-start \$\{RND\}" echo "tests-cluster-stop \$\{RND\}" -echo "tests-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\}" -echo "tests-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\}" -echo "tests-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "tests-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "tests-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "tests-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" $`, cout.String()) assert.Empty(t, cerr.String()) assert.Empty(t, operator.String()) @@ -138,11 +227,8 @@ $`, cout.String()) func TestCheckFail(t *testing.T) { // expect fail-close-cluster-stop to fail, not skipped - options := *newOptions("fail-close") - cout := bytes.Buffer{} - cerr := bytes.Buffer{} - operator := bytes.Buffer{} - sinks := Sinks{[]io.Writer{&cout}, []io.Writer{&cerr}, []io.Writer{&operator}} + options := *newOptions(DefaultPrefix("fail-close")) + sinks, cout, cerr, operator := newSinks() assert.Panics(t, func() { checkMakefile(options, sinks) }) // however, stopCluster() just swallows errors stopCluster(options, sinks) @@ -155,40 +241,38 @@ $`, cout.String()) func TestCheckNoCleanup(t *testing.T) { // expect fail-close-cluster-stop to fail, should be skipped - options := *newOptions("fail-close", "nocleanup") - cout := bytes.Buffer{} - cerr := bytes.Buffer{} - operator := bytes.Buffer{} - sinks := Sinks{[]io.Writer{&cout}, []io.Writer{&cerr}, []io.Writer{&operator}} + options := *newOptions( + DefaultPrefix("fail-close"), + DefaultNoCleanup(), + ) + sinks, cout, cerr, operator := newSinks() checkMakefile(options, sinks) assert.Regexp(t, `^echo "export RND=.* echo "fail-close-cluster-start \$\{RND\}" -echo "fail-close-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\}" -echo "fail-close-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\}" -echo "fail-close-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "fail-close-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "fail-close-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "fail-close-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" $`, cout.String()) assert.Empty(t, cerr.String()) assert.Empty(t, operator.String()) } func TestStart(t *testing.T) { - options := *newOptions() - cout := bytes.Buffer{} - cerr := bytes.Buffer{} - operator := bytes.Buffer{} - sinks := Sinks{[]io.Writer{&cout}, []io.Writer{&cerr}, []io.Writer{&operator}} + options := *newOptions(DefaultEnvAlways()) + sinks, cout, cerr, operator := newSinks() // NOTE: buildEnv never overwrites existing env. variable - _ = os.Unsetenv("RND") - kube := startHarness(options, sinks) + _ = os.Setenv("RND", "DUMMYDATA") + kube := startHarness(options, sinks, nil) assert.NotNil(t, kube) rnd, ok := os.LookupEnv("RND") + assert.NotEqual(t, "DUMMYDATA", rnd) assert.Equal(t, true, ok) cmp := `^echo "export RND=.* echo "tests-cluster-start \$\{RND\}" echo "tests-cluster-stop \$\{RND\}" -echo "tests-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\}" -echo "tests-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\}" -echo "tests-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "tests-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "tests-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "tests-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" ` err := kube.Close() assert.NoError(t, err) @@ -204,22 +288,21 @@ $`, rnd, rnd, rnd, rnd) func TestStartNoCleanup(t *testing.T) { // expect fail-close-cluster-stop to fail, should be skipped - options := *newOptions("fail-close", "nocleanup") - cout := bytes.Buffer{} - cerr := bytes.Buffer{} - operator := bytes.Buffer{} - sinks := Sinks{[]io.Writer{&cout}, []io.Writer{&cerr}, []io.Writer{&operator}} - // NOTE: buildEnv never overwrites existing env. variable + options := *newOptions( + DefaultPrefix("fail-close"), + DefaultNoCleanup(), + ) + sinks, cout, cerr, operator := newSinks() _ = os.Unsetenv("RND") - kube := startHarness(options, sinks) + kube := startHarness(options, sinks, nil) assert.NotNil(t, kube) rnd, ok := os.LookupEnv("RND") assert.Equal(t, true, ok) cmp := `^echo "export RND=.* echo "fail-close-cluster-start \$\{RND\}" -echo "fail-close-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\}" -echo "fail-close-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\}" -echo "fail-close-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "fail-close-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "fail-close-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "fail-close-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" ` err := kube.Close() assert.NoError(t, err) diff --git a/pkg/test_framework/test_test.go b/pkg/test_framework/test_test.go index 77df111..5cac4b4 100644 --- a/pkg/test_framework/test_test.go +++ b/pkg/test_framework/test_test.go @@ -1,10 +1,9 @@ package framework import ( - "bytes" "fmt" - "io" "os" + "runtime" "testing" "time" @@ -12,86 +11,74 @@ import ( ) func TestStartQuick(t *testing.T) { - options := *newOptions() - options.OperatorStartDelay = 500 * time.Millisecond - cout := bytes.Buffer{} - cerr := bytes.Buffer{} - operator := bytes.Buffer{} - sinks := Sinks{[]io.Writer{&cout}, []io.Writer{&cerr}, []io.Writer{&operator}} - // NOTE: buildEnv never overwrites existing env. variable + options := *newOptions(DefaultOperatorDelay(500 * time.Millisecond)) + sinks, cout, cerr, operator := newSinks() _ = os.Unsetenv("RND") - kube := startHarness(options, sinks) + kube := startHarness(options, sinks, nil) assert.NotNil(t, kube) test := kube.NewTest(t).Setup() err := test.StartOperator() // error because make tests-operator-start is not blocking assert.NotNil(t, err) - ns, nset := os.LookupEnv("TEST_OPERATOR_NS") - assert.Equal(t,true, nset) - assert.Equal(t, test.Namespace, ns) + ns := test.Namespace rnd, ok := os.LookupEnv("RND") assert.Equal(t, true, ok) cmp := `^echo "export RND=.* echo "tests-cluster-start \$\{RND\}" echo "tests-cluster-stop \$\{RND\}" -echo "tests-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\}" -echo "tests-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\}" -echo "tests-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "tests-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "tests-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "tests-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" ` cmp += fmt.Sprintf(`export RND=%s tests-cluster-stop %s tests-cluster-start %s -tests-cleanup %s %s +tests-cleanup %s %s 1 tests-cluster-stop %s $`, rnd, rnd, rnd, rnd, ns, rnd) test.Close() err = kube.Close() assert.NoError(t, err) assert.Regexp(t, cmp, cout.String()) - cmp = fmt.Sprintf("tests-operator-start %s %s\n", rnd, test.Namespace) + cmp = fmt.Sprintf("tests-operator-start %s %s 1\n", rnd, test.Namespace) assert.Equal(t, cmp, operator.String()) assert.Empty(t, cerr.String()) } func TestStartSlowNoCleanup(t *testing.T) { - options := *newOptions("test-sleep05", "nocleanup") - options.OperatorStartDelay = 200 * time.Millisecond - cout := bytes.Buffer{} - cerr := bytes.Buffer{} - operator := bytes.Buffer{} - sinks := Sinks{[]io.Writer{&cout}, []io.Writer{&cerr}, []io.Writer{&operator}} - // NOTE: buildEnv never overwrites existing env. variable - _ = os.Unsetenv("RND") - kube := startHarness(options, sinks) + options := *newOptions( + DefaultEnvAlways(), + DefaultPrefix("test-sleep05"), + DefaultNoCleanup(), + DefaultOperatorDelay(200 * time.Millisecond), + ) + sinks, cout, cerr, operator := newSinks() + kube := startHarness(options, sinks, nil) assert.NotNil(t, kube) test := kube.NewTest(t).Setup() // this will block long enough to register "operator running" err := test.StartOperator() assert.NoError(t, err) - ns, nset := os.LookupEnv("TEST_OPERATOR_NS") - assert.Equal(t, true, nset) - assert.Equal(t, test.Namespace, ns) + err = test.StartOperator() // operator already started assert.NotNil(t, err) - ns, nset = os.LookupEnv("TEST_OPERATOR_NS") - assert.Equal(t, true, nset) - assert.Equal(t, test.Namespace, ns) + ns := test.Namespace rnd, ok := os.LookupEnv("RND") assert.Equal(t, true, ok) cmp := `^echo "export RND=.* echo "test-sleep05-cluster-start \$\{RND\}" -echo "test-sleep05-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "test-sleep05-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" sleep 0\.5s -echo "test-sleep05-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\}" -echo "test-sleep05-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "test-sleep05-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "test-sleep05-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" ` cmp += fmt.Sprintf(`export RND=%s test-sleep05-cluster-start %s -test-sleep05-operator-stop %s %s +test-sleep05-operator-stop %s %s 1 $`, rnd, rnd, rnd, ns) // intentionally not calling StopOperator(), test.Close() should call it for us test.Close() @@ -99,55 +86,105 @@ $`, rnd, rnd, rnd, ns) assert.NoError(t, err) assert.Regexp(t, cmp, cout.String()) // stdout output of the operator goes to the operator sink - cmp = fmt.Sprintf("test-sleep05-operator-start %s %s\n", rnd, ns) + cmp = fmt.Sprintf("test-sleep05-operator-start %s %s 1\n", rnd, ns) assert.Equal(t, cmp, operator.String()) assert.Empty(t, cerr.String()) } func TestStartSlowWithCleanup(t *testing.T) { - options := *newOptions("test-sleep05") - options.OperatorStartDelay = 200 * time.Millisecond - cout := bytes.Buffer{} - cerr := bytes.Buffer{} - operator := bytes.Buffer{} - sinks := Sinks{[]io.Writer{&cout}, []io.Writer{&cerr}, []io.Writer{&operator}} - // NOTE: buildEnv never overwrites existing env. variable - _ = os.Unsetenv("RND") - kube := startHarness(options, sinks) + options := *newOptions( + DefaultEnvAlways(), + DefaultPrefix("test-sleep05"), + DefaultOperatorDelay(200 * time.Millisecond), + ) + sinks, cout, cerr, operator := newSinks() + kube := startHarness(options, sinks, nil) assert.NotNil(t, kube) test := kube.NewTest(t).Setup() // this will block long enough to register "operator running" err := test.StartOperator() assert.NoError(t, err) - ns, nset := os.LookupEnv("TEST_OPERATOR_NS") - assert.Equal(t, true, nset) - assert.Equal(t, test.Namespace, ns) + ns := test.Namespace rnd, ok := os.LookupEnv("RND") assert.Equal(t, true, ok) cmp := `^echo "export RND=.* echo "test-sleep05-cluster-start \$\{RND\}" echo "test-sleep05-cluster-stop \$\{RND\}" -echo "test-sleep05-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "test-sleep05-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" sleep 0\.5s -echo "test-sleep05-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\}" -echo "test-sleep05-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\}" +echo "test-sleep05-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "test-sleep05-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" ` cmp += fmt.Sprintf(`export RND=%s test-sleep05-cluster-stop %s test-sleep05-cluster-start %s -test-sleep05-operator-stop %s %s -test-sleep05-cleanup %s %s +test-sleep05-operator-stop %s %s 1 +test-sleep05-cleanup %s %s 1 test-sleep05-cluster-stop %s $`, rnd, rnd, rnd, rnd, ns, rnd, ns, rnd) // intentionally not calling StopOperator(), test.Close() should call it for us test.Close() err = kube.Close() assert.NoError(t, err) + assert.Regexp(t, cmp, cout.String()) // stdout output of the operator goes to the operator sink - cmp = fmt.Sprintf("test-sleep05-operator-start %s %s\n", rnd, ns) + cmp = fmt.Sprintf("test-sleep05-operator-start %s %s 1\n", rnd, ns) assert.Equal(t, cmp, operator.String()) assert.Empty(t, cerr.String()) } + +func TestRunArbitraryTarget(t *testing.T) { + options := *newOptions( + DefaultEnvAlways(), + DefaultPrefix("test-sleep05"), + DefaultOperatorDelay(200 * time.Millisecond), + ) + sinks, cout, _, _ := newSinks() + kube := startHarness(options, sinks, nil) + assert.NotNil(t, kube) + + test := kube.NewTest(t).Setup() + // this will block long enough to register "operator running" + err := test.StartOperator() + assert.NoError(t, err) + + err = test.RunTarget("foo") + assert.NoError(t, err) + + // try again, detecting an error this time + err = test.RunTarget("bar") + assert.NotNil(t, err) + + rnd, ok := os.LookupEnv("RND") + assert.Equal(t, true, ok) + ns := test.Namespace + cmp := `^echo "export RND=.* +echo "test-sleep05-cluster-start \$\{RND\}" +echo "test-sleep05-cluster-stop \$\{RND\}" +echo "test-sleep05-operator-start \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +sleep 0\.5s +echo "test-sleep05-operator-stop \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +echo "test-sleep05-cleanup \$\{RND\} \$\{TEST_OPERATOR_NS\} \$\{TEST_COUNT\}" +` + cmp += fmt.Sprintf(`export RND=%s +test-sleep05-cluster-stop %s +test-sleep05-cluster-start %s +test-sleep05-foo %s %s 1 +test-sleep05-bar %s %s 1.*error +`, rnd, rnd, rnd, rnd, ns, rnd, ns) + if runtime.GOOS == "linux" { + // I am very sorry, but there does not seem to be a way to tell the GNU make to keep quiet here + cmp += "Makefile:.* failed\n" + } + cmp += fmt.Sprintf(`test-sleep05-operator-stop %s %s 1 +test-sleep05-cleanup %s %s 1 +test-sleep05-cluster-stop %s +$`, rnd, ns, rnd, ns, rnd) + test.Close() + err = kube.Close() + assert.NoError(t, err) + assert.Regexp(t, cmp, cout.String()) +} From 47e7e0699bf9ac32ceef130664a9e959964d63a5 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Mon, 4 May 2020 12:43:27 -0700 Subject: [PATCH 35/38] fix go.mod/sum --- go.mod | 49 ++++++---- go.sum | 297 ++++++++------------------------------------------------- 2 files changed, 69 insertions(+), 277 deletions(-) diff --git a/go.mod b/go.mod index b22bef0..3e9ad20 100644 --- a/go.mod +++ b/go.mod @@ -1,31 +1,40 @@ module github.com/Yelp/paasta-tools-go require ( - cloud.google.com/go v0.38.0 // indirect github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754 - github.com/fatih/color v1.9.0 - github.com/fatih/structs v1.1.0 // indirect - github.com/go-logfmt/logfmt v0.4.0 // indirect - github.com/go-openapi/errors v0.19.2 - github.com/go-openapi/runtime v0.19.5 - github.com/go-openapi/strfmt v0.19.3 + github.com/fatih/structs v1.1.0 + github.com/go-logr/zapr v0.1.1 // indirect + github.com/go-openapi/errors v0.19.4 + github.com/go-openapi/runtime v0.19.15 + github.com/go-openapi/strfmt v0.19.5 github.com/go-openapi/swag v0.19.5 - github.com/go-openapi/validate v0.19.5 - github.com/go-swagger/go-swagger v0.21.0 // indirect + github.com/go-openapi/validate v0.19.8 + github.com/gogo/protobuf v1.2.1 // indirect + github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 // indirect + github.com/hashicorp/golang-lru v0.5.3 // indirect + github.com/imdario/mergo v0.3.8 // indirect github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381 - github.com/mitchellh/mapstructure v1.1.2 - github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/mitchellh/mapstructure v1.2.2 + github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 + github.com/pkg/errors v0.8.1 github.com/pmezard/go-difflib v1.0.0 - github.com/prometheus/tsdb v0.7.1 // indirect - github.com/spf13/pflag v1.0.5 + github.com/prometheus/client_golang v1.3.0 // indirect + github.com/spf13/pflag v1.0.3 github.com/stretchr/testify v1.4.0 github.com/subosito/gotenv v1.2.0 - gopkg.in/yaml.v2 v2.2.7 - k8s.io/api v0.17.2 - k8s.io/apimachinery v0.17.2 - k8s.io/client-go v11.0.0+incompatible - k8s.io/kubernetes v1.14.0 // indirect - sigs.k8s.io/controller-runtime v0.5.2 + go.uber.org/zap v1.13.0 // indirect + golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 // indirect + golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 // indirect + golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect + gopkg.in/yaml.v2 v2.2.4 + k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b + k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d + k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible + k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a // indirect + k8s.io/kubernetes v1.14.0 + k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 // indirect + sigs.k8s.io/controller-runtime v0.2.2 ) -go 1.13 +go 1.12 diff --git a/go.sum b/go.sum index c1b5528..18abd24 100644 --- a/go.sum +++ b/go.sum @@ -1,18 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= @@ -27,7 +16,6 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/appscode/jsonpatch v2.0.1+incompatible h1:Ksl+gGquV3TeYmiZPBsDNauiyloE7sg9OMUWKr5Ctmg= -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 h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= @@ -35,56 +23,24 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/corbym/gocrest v1.0.3/go.mod h1:maVFL5lbdS2PgfOQgGRWDYTeunSWQeiEgoNdTABShCs= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754 h1:Qd6djMDE2KFeLwuKQ4B316XYt101DFoymbgoxFHeKCY= github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754/go.mod h1:rTr8X4qZPRmQKsyAjhECPi+zPnmlcmv5W9s1F11oBSo= -github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -105,9 +61,9 @@ github.com/go-openapi/analysis v0.19.5 h1:8b2ZgKfKIUTVQpTb77MoRDIMEIwvDVw40o3aOX github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.19.2 h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4= +github.com/go-openapi/errors v0.19.4 h1:fSGwO1tSYHFu70NKaWJt5Qh0qoBRtCm/mXS1yhf+0W0= +github.com/go-openapi/errors v0.19.4/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= @@ -117,7 +73,6 @@ github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34 github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= @@ -125,15 +80,14 @@ github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.3 h1:jwIoahqCmaA5OBoc/B+1+Mu2L0Gr8xYQnbeyQEo/7b0= github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= github.com/go-openapi/loads v0.19.4 h1:5I4CCSqoWzT+82bBkNIvmLc0UOsoKKQ4Fz+3VxOB7SY= github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/runtime v0.19.5 h1:h4Zk7oTfB3ZYM2oMNliQvL+3BrDstTIX8lqP7yaYCuI= -github.com/go-openapi/runtime v0.19.5/go.mod h1:WIH6IYPXOrtgTClTV8xzdrD20jBlrK25D0aQbdSlqp8= +github.com/go-openapi/runtime v0.19.15 h1:2GIefxs9Rx1vCDNghRtypRq+ig8KSLrjHbAYI/gCLCM= +github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= @@ -144,8 +98,10 @@ github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pL github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.3 h1:eRfyY5SkaNJCAwmmMcADjY31ow9+N7MCLW7oRkbsINA= github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/strfmt v0.19.5 h1:0utjKrw+BAh8s57XE9Xz8DUBsVvPmRUB6styvl9wWIM= +github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87 h1:zP3nY8Tk2E6RTkqGYrarZXuzh+ffyLDljLxCy1iJw80= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= @@ -154,83 +110,51 @@ github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tF github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.3 h1:PAH/2DylwWcIU1s0Y7k3yNmeAgWOcKrNE2Q7Ww/kCg4= github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= -github.com/go-openapi/validate v0.19.5 h1:QhCBKRYqZR+SKo4gl1lPhPahope8/RLt6EVgY8X80w0= -github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= +github.com/go-openapi/validate v0.19.8 h1:YFzsdWIDfVuLvIOF+ZmKjVg1MbPJ1QgY9PihMwei1ys= +github.com/go-openapi/validate v0.19.8/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-swagger/go-swagger v0.21.0/go.mod h1:tDb8PdDVFcaE8EPXkMOsuxpL3UEPiwu1UDZar9Z/1RY= -github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013/go.mod h1:b65mBPzqzZWxOZGxSWrqs4GInLIn+u99Q9q7p+GKni0= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= -github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -240,29 +164,20 @@ github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381 h1:bqDmpDG49ZRnB5PcgP0RXtQvnMSgIF14M7CBd2shtXs= github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a h1:TpvdAwDAt1K4ANVOfcihouRdvP+MgAfDWwBuct4l6ZY= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.2.2 h1:dxe5oCinTXiTIcfgmZecdCzPmAJKd46KsCWc35r0TV4= +github.com/mitchellh/mapstructure v1.2.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -274,33 +189,22 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= +github.com/prometheus/client_golang v0.9.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0 h1:miYCvYqFXtl/J9FIy8eNpBfYthAEFg+Ys0XyUVEcDsc= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= @@ -308,42 +212,24 @@ github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1: github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0 h1:ElTg5tNp4DqfV7UQjDqv2+RJlNzsDtvNAWccbItceIE= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.4.0 h1:yXHLWeravcrgGyFSyCgdYpXQ9dR9c/WED3pg1RhxqEU= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= @@ -356,249 +242,146 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/toqueteos/webbrowser v1.2.0/go.mod h1:XWoZq4cyp9WeUeak7w7LXRUQf1F1ATJMir8RTqb4ayM= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yelp/paasta-tools-go v0.0.0-20200427191252-351d9715626f h1:rdWD6ESbIWIm5ZZRToe4P4QpMsW95JdhtXyClEBjFrA= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1 h1:Sq1fR+0c58RME5EoqKdjkiQAmPjmfHlZOoRI6fTUOcs= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.2 h1:jxcFYjlkl8xaERsgLo+RNquI0epW6zuy/ZRQs6jnrFA= go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190907121410-71b5226ff739/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 h1:ulvT7fqt0yHWzpJwI57MezWnYDVpCAYBVuYst/L+fAY= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 h1:rjwSpXsdiK0dV8/Naq3kAw9ymfAeJIyd0upUIElB+lI= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190907184412-d223b2b6db03/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69 h1:rOhMmluY6kLMhdnrivzec6lLgaVbMHMn2ISQXJeJ5EM= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f h1:68K/z8GLUxV76xGSqwTWw2gyk/jwn79LUL43rES2g8o= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gomodules.xyz/jsonpatch/v2 v2.0.1 h1:xyiBuvkD2g5n7cYzx6u2sxQvsAy4QJsZFCzGVdzOXZ0= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= -gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.1 h1:q4XQuHFC6I28BKZpo6IYyb3mNO+l7lSOxRuYTCiDfXk= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= k8s.io/api v0.0.0-20190202010724-74b699b93c15 h1:AoUGjnJ3PJMFz+Rkp4lx3X+6mPUnY1MESJhbUSGX+pc= k8s.io/api v0.0.0-20190202010724-74b699b93c15/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.0.0-20190313235455-40a48860b5ab h1:DG9A67baNpoeweOy2spF1OWHhnVY5KR7/Ek/+U1lVZc= k8s.io/api v0.0.0-20190313235455-40a48860b5ab/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= -k8s.io/api v0.17.2 h1:NF1UFXcKN7/OOv1uxdRz3qfra8AHsPav5M93hlV9+Dc= -k8s.io/api v0.17.2/go.mod h1:BS9fjjLc4CMuqfSO8vgbHPKMt5+SF0ET6u/RVDihTo4= -k8s.io/apiextensions-apiserver v0.17.2/go.mod h1:4KdMpjkEjjDI2pPfBA15OscyNldHWdBCfsWMDWAmSTs= +k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b h1:aBGgKJUM9Hk/3AE8WaZIApnTxG35kbuQba2w+SXqezo= +k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= +k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8 h1:q1Qvjzs/iEdXF6A1a8H3AKVFDzJNcJn3nXMs6R6qFtA= +k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c h1:02KEBFny6M5VWKj6Y8Ns27epjefTqLJXD4fvqP5tGFg= k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1 h1:IS7K02iBkQXpCeieSiyJjGoLSdVOv2DbPaWHJ+ZtgKg= k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= -k8s.io/apimachinery v0.17.2 h1:hwDQQFbdRlpnnsR64Asdi55GyCaIP/3WQpMmbNBeWr4= -k8s.io/apimachinery v0.17.2/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= -k8s.io/apiserver v0.17.2/go.mod h1:lBmw/TtQdtxvrTk0e2cgtOxHizXI+d0mmGQURIHQZlo= -k8s.io/client-go v0.17.2/go.mod h1:QAzRgsa0C2xl4/eVpeVAZMvikCn8Nm81yqVx3Kk9XYI= +k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d h1:Jmdtdt1ZnoGfWWIIik61Z7nKYgO3J+swQJtPYsP9wHA= +k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/client-go v11.0.0+incompatible h1:LBbX2+lOwY9flffWlJM7f1Ct8V2SRNiMRDFeiwnJo9o= k8s.io/client-go v11.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= -k8s.io/code-generator v0.17.2/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s= -k8s.io/component-base v0.17.2/go.mod h1:zMPW3g5aH7cHJpKYQ/ZsGMcgbsA/VyhEugF3QT1awLs= +k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible h1:U5Bt+dab9K8qaUmXINrkXO135kA11/i5Kg1RUydgaMQ= +k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.2.0 h1:0ElL0OHzF3N+OhoJTL0uca20SxtYt4X4+bzHeqrB83c= k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= -k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kubernetes v1.14.0 h1:6T2iAEoOYQnzQb3WvPlUkcczEEXZ7+YPlAO8olwujRw= k8s.io/kubernetes v1.14.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 h1:p0Ai3qVtkbCG/Af26dBmU0E1W58NID3hSSh7cMyylpM= k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -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= -modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= -modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= sigs.k8s.io/controller-runtime v0.1.10 h1:amLOmcekVdnsD1uIpmgRqfTbQWJ2qxvQkcdeFhcotn4= sigs.k8s.io/controller-runtime v0.1.10/go.mod h1:HFAYoOh6XMV+jKF1UjFwrknPbowfyHEHHRdJMf2jMX8= -sigs.k8s.io/controller-runtime v0.5.2 h1:pyXbUfoTo+HA3jeIfr0vgi+1WtmNh0CwlcnQGLXwsSw= -sigs.k8s.io/controller-runtime v0.5.2/go.mod h1:JZUwSMVbxDupo0lTJSSFP5pimEyxGynROImSsqIOx1A= +sigs.k8s.io/controller-runtime v0.2.2 h1:JT/vJJhUjjL9NZNwnm8AXmqCBUXSCFKmTaNjwDi28N0= +sigs.k8s.io/controller-runtime v0.2.2/go.mod h1:9dyohw3ZtoXQuV1e766PHUn+cmrRCIcBh6XIMFNMZ+I= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06/go.mod h1:/ULNhyfzRopfcjskuui0cTITekDduZ7ycKN3oUT9R18= +sigs.k8s.io/testing_frameworks v0.1.1/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9qL6ht1zEr/U= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= From 0ded11b94e8ee00ad9e947fca388730594b550be Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Tue, 17 Nov 2020 10:19:40 +0100 Subject: [PATCH 36/38] tidy --- go.mod | 12 ++--- go.sum | 137 ++++++++++++--------------------------------------------- 2 files changed, 33 insertions(+), 116 deletions(-) diff --git a/go.mod b/go.mod index 903d35d..20cd02e 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,6 @@ module github.com/Yelp/paasta-tools-go require ( github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754 - github.com/fatih/structs v1.1.0 github.com/go-logr/zapr v0.1.1 // indirect github.com/go-openapi/errors v0.19.4 github.com/go-openapi/runtime v0.19.15 @@ -10,31 +9,28 @@ require ( github.com/go-openapi/swag v0.19.5 github.com/go-openapi/validate v0.19.8 github.com/gogo/protobuf v1.2.1 // indirect - github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 // indirect - github.com/hashicorp/golang-lru v0.5.3 // indirect + github.com/google/go-cmp v0.3.1 // indirect github.com/imdario/mergo v0.3.8 // indirect + github.com/json-iterator/go v1.1.8 // indirect github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381 github.com/mitchellh/mapstructure v1.2.2 github.com/modern-go/reflect2 v1.0.1 // indirect - github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 github.com/openzipkin/zipkin-go v0.2.2 - github.com/pkg/errors v0.8.1 github.com/pmezard/go-difflib v1.0.0 - github.com/prometheus/client_golang v1.3.0 // indirect github.com/spf13/pflag v1.0.3 github.com/stretchr/testify v1.4.0 github.com/subosito/gotenv v1.2.0 + github.yelpcorp.com/go-packages/monk v0.0.0-20200713102923-aa075ebbb2e7 go.uber.org/zap v1.13.0 // indirect golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 // indirect golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 + golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect gopkg.in/yaml.v2 v2.2.4 k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible k8s.io/klog v1.0.0 - k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a // indirect - k8s.io/kubernetes v1.14.0 k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 // indirect sigs.k8s.io/controller-runtime v0.2.2 ) diff --git a/go.sum b/go.sum index fdc6dd2..140bf55 100644 --- a/go.sum +++ b/go.sum @@ -2,35 +2,22 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= git.apache.org/thrift.git v0.0.0-20171203172758-327ebb6c2b6d h1:RsHq5kCWkxgbqyQPWB8OWNU/CRStjE/vusovT2bGKOw= git.apache.org/thrift.git v0.0.0-20171203172758-327ebb6c2b6d/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/appscode/jsonpatch v2.0.1+incompatible h1:Ksl+gGquV3TeYmiZPBsDNauiyloE7sg9OMUWKr5Ctmg= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -42,20 +29,13 @@ github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3 github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= @@ -73,13 +53,11 @@ github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQH github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= github.com/go-openapi/errors v0.19.4 h1:fSGwO1tSYHFu70NKaWJt5Qh0qoBRtCm/mXS1yhf+0W0= github.com/go-openapi/errors v0.19.4/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= @@ -97,7 +75,6 @@ github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= github.com/go-openapi/runtime v0.19.15 h1:2GIefxs9Rx1vCDNghRtypRq+ig8KSLrjHbAYI/gCLCM= github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= @@ -110,8 +87,6 @@ github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6 github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= github.com/go-openapi/strfmt v0.19.5 h1:0utjKrw+BAh8s57XE9Xz8DUBsVvPmRUB6styvl9wWIM= github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87 h1:zP3nY8Tk2E6RTkqGYrarZXuzh+ffyLDljLxCy1iJw80= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= @@ -131,58 +106,48 @@ github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= +github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.2 h1:Pgr17XVTNXAk3q/r4CpKzC5xBM/qW1uVLV+IhRZpIIk= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= -github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381 h1:bqDmpDG49ZRnB5PcgP0RXtQvnMSgIF14M7CBd2shtXs= github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a h1:TpvdAwDAt1K4ANVOfcihouRdvP+MgAfDWwBuct4l6ZY= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -199,19 +164,14 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OH github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= -github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/openzipkin/zipkin-go v0.2.2 h1:nY8Hti+WKaP0cRsSeQ026wU03QsM762XBeCXBb9NAWI= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= @@ -219,38 +179,19 @@ github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7ir github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.3.0 h1:miYCvYqFXtl/J9FIy8eNpBfYthAEFg+Ys0XyUVEcDsc= -github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.1.0 h1:ElTg5tNp4DqfV7UQjDqv2+RJlNzsDtvNAWccbItceIE= -github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -258,7 +199,6 @@ github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -266,12 +206,14 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= -github.yelpcorp.com/go-packages/monk v0.0.0-20200623102145-af41f6e5224d h1:qbyNnu67PWuQdko5nu0gnIx3fPIvyLAqSkNEmmOqqPk= -github.yelpcorp.com/go-packages/monk v0.0.0-20200701154824-364e86298c97/go.mod h1:r68sHLqP79UXr8iRyAKicKDOMKYrwJJgbSDRi5p3clo= +github.yelpcorp.com/go-packages/monk v0.0.0-20200713102923-aa075ebbb2e7 h1:+Y4wW5yXg8cojHAyKdZMKq6XwRTbzlYnIOx18Jpz0YA= +github.yelpcorp.com/go-packages/monk v0.0.0-20200713102923-aa075ebbb2e7/go.mod h1:r68sHLqP79UXr8iRyAKicKDOMKYrwJJgbSDRi5p3clo= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.2 h1:jxcFYjlkl8xaERsgLo+RNquI0epW6zuy/ZRQs6jnrFA= go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY= @@ -279,12 +221,12 @@ go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -293,16 +235,13 @@ golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 h1:ulvT7fqt0yHWzpJwI57MezWnYDVpCAYBVuYst/L+fAY= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= @@ -312,27 +251,25 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 h1:eDrdRpKgkcCqKZQwyZRyeFZgfqt37SL7Kv3tok06cKE= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f h1:68K/z8GLUxV76xGSqwTWw2gyk/jwn79LUL43rES2g8o= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= @@ -342,30 +279,33 @@ golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqG golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.0.1 h1:xyiBuvkD2g5n7cYzx6u2sxQvsAy4QJsZFCzGVdzOXZ0= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/grpc v1.20.0 h1:DlsSIrgEBuZAUFJcta2B5i/lzeHHbnfkNFAfFXLVFYQ= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= @@ -373,29 +313,16 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -k8s.io/api v0.0.0-20190202010724-74b699b93c15 h1:AoUGjnJ3PJMFz+Rkp4lx3X+6mPUnY1MESJhbUSGX+pc= -k8s.io/api v0.0.0-20190202010724-74b699b93c15/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= -k8s.io/api v0.0.0-20190313235455-40a48860b5ab h1:DG9A67baNpoeweOy2spF1OWHhnVY5KR7/Ek/+U1lVZc= -k8s.io/api v0.0.0-20190313235455-40a48860b5ab/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b h1:aBGgKJUM9Hk/3AE8WaZIApnTxG35kbuQba2w+SXqezo= k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8 h1:q1Qvjzs/iEdXF6A1a8H3AKVFDzJNcJn3nXMs6R6qFtA= k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= -k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c h1:02KEBFny6M5VWKj6Y8Ns27epjefTqLJXD4fvqP5tGFg= -k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= -k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1 h1:IS7K02iBkQXpCeieSiyJjGoLSdVOv2DbPaWHJ+ZtgKg= -k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d h1:Jmdtdt1ZnoGfWWIIik61Z7nKYgO3J+swQJtPYsP9wHA= k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= -k8s.io/client-go v11.0.0+incompatible h1:LBbX2+lOwY9flffWlJM7f1Ct8V2SRNiMRDFeiwnJo9o= -k8s.io/client-go v11.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible h1:U5Bt+dab9K8qaUmXINrkXO135kA11/i5Kg1RUydgaMQ= k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.2.0 h1:0ElL0OHzF3N+OhoJTL0uca20SxtYt4X4+bzHeqrB83c= -k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= @@ -403,18 +330,12 @@ k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.1.0 h1:X3+Mru/L3jy4BI4vcAYkHvL6PyU+QBsuhEqwlI4mgkA= k8s.io/klog/v2 v2.1.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/kubernetes v1.14.0 h1:6T2iAEoOYQnzQb3WvPlUkcczEEXZ7+YPlAO8olwujRw= -k8s.io/kubernetes v1.14.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 h1:p0Ai3qVtkbCG/Af26dBmU0E1W58NID3hSSh7cMyylpM= k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -sigs.k8s.io/controller-runtime v0.1.10 h1:amLOmcekVdnsD1uIpmgRqfTbQWJ2qxvQkcdeFhcotn4= -sigs.k8s.io/controller-runtime v0.1.10/go.mod h1:HFAYoOh6XMV+jKF1UjFwrknPbowfyHEHHRdJMf2jMX8= sigs.k8s.io/controller-runtime v0.2.2 h1:JT/vJJhUjjL9NZNwnm8AXmqCBUXSCFKmTaNjwDi28N0= sigs.k8s.io/controller-runtime v0.2.2/go.mod h1:9dyohw3ZtoXQuV1e766PHUn+cmrRCIcBh6XIMFNMZ+I= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/testing_frameworks v0.1.1 h1:cP2l8fkA3O9vekpy5Ks8mmA0NW/F7yBdXf8brkWhVrs= sigs.k8s.io/testing_frameworks v0.1.1/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9qL6ht1zEr/U= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= From 038902984097d229c9c3c2ad4fe2377360398f24 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Tue, 17 Nov 2020 04:03:33 -0800 Subject: [PATCH 37/38] use new paastaapi --- cmd/paasta-metastatus/main.go | 30 +- cmd/paasta-metastatus/main_test.go | 64 ++- .../client/autoscaler/autoscaler_client.go | 108 ----- .../get_autoscaler_count_parameters.go | 156 ------ .../get_autoscaler_count_responses.go | 154 ------ .../update_autoscaler_count_parameters.go | 173 ------- .../update_autoscaler_count_responses.go | 192 -------- .../marathon_dashboard_client.go | 72 --- .../marathon_dashboard_parameters.go | 112 ----- .../marathon_dashboard_responses.go | 67 --- ...ete_service_autoscaler_pause_parameters.go | 112 ----- ...lete_service_autoscaler_pause_responses.go | 81 ---- .../operations/deploy_queue_parameters.go | 112 ----- .../operations/deploy_queue_responses.go | 69 --- ...get_service_autoscaler_pause_parameters.go | 112 ----- .../get_service_autoscaler_pause_responses.go | 92 ---- .../operations/metastatus_parameters.go | 139 ------ .../client/operations/metastatus_responses.go | 96 ---- .../client/operations/operations_client.go | 252 ---------- .../operations/show_version_parameters.go | 112 ----- .../operations/show_version_responses.go | 65 --- ...ate_service_autoscaler_pause_parameters.go | 131 ----- ...date_service_autoscaler_pause_responses.go | 114 ----- pkg/paasta_api/client/paasta_client.go | 132 ----- .../client/resources/resources_client.go | 72 --- .../client/resources/resources_parameters.go | 163 ------- .../client/resources/resources_responses.go | 94 ---- .../service/delay_instance_parameters.go | 156 ------ .../service/delay_instance_responses.go | 148 ------ .../service/instance_set_state_parameters.go | 177 ------- .../service/instance_set_state_responses.go | 108 ----- .../service/list_instances_parameters.go | 135 ------ .../service/list_instances_responses.go | 100 ---- .../list_services_for_cluster_parameters.go | 112 ----- .../list_services_for_cluster_responses.go | 100 ---- .../client/service/service_client.go | 289 ----------- .../service/status_instance_parameters.go | 285 ----------- .../service/status_instance_responses.go | 123 ----- .../service/task_instance_parameters.go | 210 -------- .../client/service/task_instance_responses.go | 148 ------ .../service/tasks_instance_parameters.go | 221 --------- .../service/tasks_instance_responses.go | 148 ------ pkg/paasta_api/models/adhoc_launch_history.go | 49 -- pkg/paasta_api/models/deploy_queue.go | 112 ----- .../models/deploy_queue_service_instance.go | 67 --- pkg/paasta_api/models/envoy_backend.go | 58 --- pkg/paasta_api/models/envoy_location.go | 89 ---- pkg/paasta_api/models/envoy_status.go | 86 ---- pkg/paasta_api/models/float_and_error.go | 46 -- pkg/paasta_api/models/h_p_a_metric.go | 49 -- pkg/paasta_api/models/instance_delay.go | 11 - .../models/instance_metadata_flink.go | 11 - .../models/instance_metadata_kafka_cluster.go | 11 - .../models/instance_spec_kafka_cluster.go | 11 - pkg/paasta_api/models/instance_status.go | 300 ------------ .../models/instance_status_adhoc.go | 45 -- .../models/instance_status_flink.go | 11 - .../models/instance_status_kafka_cluster.go | 11 - .../models/instance_status_kubernetes.go | 456 ------------------ .../models/instance_status_marathon.go | 390 --------------- pkg/paasta_api/models/instance_status_tron.go | 108 ----- pkg/paasta_api/models/instance_task.go | 11 - pkg/paasta_api/models/instance_tasks.go | 20 - pkg/paasta_api/models/integer_and_error.go | 46 -- pkg/paasta_api/models/kubernetes_container.go | 74 --- pkg/paasta_api/models/kubernetes_pod.go | 101 ---- .../models/kubernetes_replica_set.go | 52 -- pkg/paasta_api/models/marathon_app_status.go | 107 ---- .../models/marathon_autoscaling_info.go | 55 --- pkg/paasta_api/models/marathon_dashboard.go | 42 -- .../models/marathon_dashboard_cluster.go | 45 -- .../models/marathon_dashboard_item.go | 49 -- .../models/marathon_mesos_nonrunning_task.go | 83 ---- .../models/marathon_mesos_running_task.go | 183 ------- .../models/marathon_mesos_status.go | 118 ----- pkg/paasta_api/models/marathon_task.go | 55 --- pkg/paasta_api/models/meta_status.go | 46 -- pkg/paasta_api/models/resource.go | 45 -- pkg/paasta_api/models/resource_item.go | 124 ----- pkg/paasta_api/models/resource_value.go | 49 -- pkg/paasta_api/models/smartstack_backend.go | 64 --- pkg/paasta_api/models/smartstack_location.go | 86 ---- pkg/paasta_api/models/smartstack_status.go | 86 ---- pkg/paasta_api/models/task_tail_lines.go | 49 -- 84 files changed, 44 insertions(+), 9003 deletions(-) delete mode 100644 pkg/paasta_api/client/autoscaler/autoscaler_client.go delete mode 100644 pkg/paasta_api/client/autoscaler/get_autoscaler_count_parameters.go delete mode 100644 pkg/paasta_api/client/autoscaler/get_autoscaler_count_responses.go delete mode 100644 pkg/paasta_api/client/autoscaler/update_autoscaler_count_parameters.go delete mode 100644 pkg/paasta_api/client/autoscaler/update_autoscaler_count_responses.go delete mode 100644 pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_client.go delete mode 100644 pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_parameters.go delete mode 100644 pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_responses.go delete mode 100644 pkg/paasta_api/client/operations/delete_service_autoscaler_pause_parameters.go delete mode 100644 pkg/paasta_api/client/operations/delete_service_autoscaler_pause_responses.go delete mode 100644 pkg/paasta_api/client/operations/deploy_queue_parameters.go delete mode 100644 pkg/paasta_api/client/operations/deploy_queue_responses.go delete mode 100644 pkg/paasta_api/client/operations/get_service_autoscaler_pause_parameters.go delete mode 100644 pkg/paasta_api/client/operations/get_service_autoscaler_pause_responses.go delete mode 100644 pkg/paasta_api/client/operations/metastatus_parameters.go delete mode 100644 pkg/paasta_api/client/operations/metastatus_responses.go delete mode 100644 pkg/paasta_api/client/operations/operations_client.go delete mode 100644 pkg/paasta_api/client/operations/show_version_parameters.go delete mode 100644 pkg/paasta_api/client/operations/show_version_responses.go delete mode 100644 pkg/paasta_api/client/operations/update_service_autoscaler_pause_parameters.go delete mode 100644 pkg/paasta_api/client/operations/update_service_autoscaler_pause_responses.go delete mode 100644 pkg/paasta_api/client/paasta_client.go delete mode 100644 pkg/paasta_api/client/resources/resources_client.go delete mode 100644 pkg/paasta_api/client/resources/resources_parameters.go delete mode 100644 pkg/paasta_api/client/resources/resources_responses.go delete mode 100644 pkg/paasta_api/client/service/delay_instance_parameters.go delete mode 100644 pkg/paasta_api/client/service/delay_instance_responses.go delete mode 100644 pkg/paasta_api/client/service/instance_set_state_parameters.go delete mode 100644 pkg/paasta_api/client/service/instance_set_state_responses.go delete mode 100644 pkg/paasta_api/client/service/list_instances_parameters.go delete mode 100644 pkg/paasta_api/client/service/list_instances_responses.go delete mode 100644 pkg/paasta_api/client/service/list_services_for_cluster_parameters.go delete mode 100644 pkg/paasta_api/client/service/list_services_for_cluster_responses.go delete mode 100644 pkg/paasta_api/client/service/service_client.go delete mode 100644 pkg/paasta_api/client/service/status_instance_parameters.go delete mode 100644 pkg/paasta_api/client/service/status_instance_responses.go delete mode 100644 pkg/paasta_api/client/service/task_instance_parameters.go delete mode 100644 pkg/paasta_api/client/service/task_instance_responses.go delete mode 100644 pkg/paasta_api/client/service/tasks_instance_parameters.go delete mode 100644 pkg/paasta_api/client/service/tasks_instance_responses.go delete mode 100644 pkg/paasta_api/models/adhoc_launch_history.go delete mode 100644 pkg/paasta_api/models/deploy_queue.go delete mode 100644 pkg/paasta_api/models/deploy_queue_service_instance.go delete mode 100644 pkg/paasta_api/models/envoy_backend.go delete mode 100644 pkg/paasta_api/models/envoy_location.go delete mode 100644 pkg/paasta_api/models/envoy_status.go delete mode 100644 pkg/paasta_api/models/float_and_error.go delete mode 100644 pkg/paasta_api/models/h_p_a_metric.go delete mode 100644 pkg/paasta_api/models/instance_delay.go delete mode 100644 pkg/paasta_api/models/instance_metadata_flink.go delete mode 100644 pkg/paasta_api/models/instance_metadata_kafka_cluster.go delete mode 100644 pkg/paasta_api/models/instance_spec_kafka_cluster.go delete mode 100644 pkg/paasta_api/models/instance_status.go delete mode 100644 pkg/paasta_api/models/instance_status_adhoc.go delete mode 100644 pkg/paasta_api/models/instance_status_flink.go delete mode 100644 pkg/paasta_api/models/instance_status_kafka_cluster.go delete mode 100644 pkg/paasta_api/models/instance_status_kubernetes.go delete mode 100644 pkg/paasta_api/models/instance_status_marathon.go delete mode 100644 pkg/paasta_api/models/instance_status_tron.go delete mode 100644 pkg/paasta_api/models/instance_task.go delete mode 100644 pkg/paasta_api/models/instance_tasks.go delete mode 100644 pkg/paasta_api/models/integer_and_error.go delete mode 100644 pkg/paasta_api/models/kubernetes_container.go delete mode 100644 pkg/paasta_api/models/kubernetes_pod.go delete mode 100644 pkg/paasta_api/models/kubernetes_replica_set.go delete mode 100644 pkg/paasta_api/models/marathon_app_status.go delete mode 100644 pkg/paasta_api/models/marathon_autoscaling_info.go delete mode 100644 pkg/paasta_api/models/marathon_dashboard.go delete mode 100644 pkg/paasta_api/models/marathon_dashboard_cluster.go delete mode 100644 pkg/paasta_api/models/marathon_dashboard_item.go delete mode 100644 pkg/paasta_api/models/marathon_mesos_nonrunning_task.go delete mode 100644 pkg/paasta_api/models/marathon_mesos_running_task.go delete mode 100644 pkg/paasta_api/models/marathon_mesos_status.go delete mode 100644 pkg/paasta_api/models/marathon_task.go delete mode 100644 pkg/paasta_api/models/meta_status.go delete mode 100644 pkg/paasta_api/models/resource.go delete mode 100644 pkg/paasta_api/models/resource_item.go delete mode 100644 pkg/paasta_api/models/resource_value.go delete mode 100644 pkg/paasta_api/models/smartstack_backend.go delete mode 100644 pkg/paasta_api/models/smartstack_location.go delete mode 100644 pkg/paasta_api/models/smartstack_status.go delete mode 100644 pkg/paasta_api/models/task_tail_lines.go diff --git a/cmd/paasta-metastatus/main.go b/cmd/paasta-metastatus/main.go index b8dc5d8..468fb71 100644 --- a/cmd/paasta-metastatus/main.go +++ b/cmd/paasta-metastatus/main.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "io" + "net/http" "net/url" "os" "strings" @@ -16,11 +17,7 @@ import ( "github.com/Yelp/paasta-tools-go/pkg/configstore" "github.com/logrusorgru/aurora" - apiclient "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client" - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/operations" - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" + "github.com/Yelp/paasta-tools-go/pkg/paastaapi" ) // PaastaMetastatusOptions ... @@ -115,7 +112,7 @@ func buildMetastatusCmdArgs(opts *PaastaMetastatusOptions) ([]string, time.Durat type ctxKey int const ( - ctxKeyTransport ctxKey = iota + ctxKeyHTTPClient ctxKey = iota ctxKeyOut ctxKeyErr ) @@ -131,21 +128,22 @@ func writeAPIStatus( return fmt.Errorf("Failed to parse API endpoint %v: %v", endpoint, err) } - var transport runtime.ClientTransport - ctxTransport := ctx.Value(ctxKeyTransport) - if ctxTransport != nil { - transport = ctxTransport.(runtime.ClientTransport) - } else { - transport = httptransport.New(url.Host, apiclient.DefaultBasePath, []string{url.Scheme}) + config := paastaapi.NewConfiguration() + config.Host = url.Host + config.Scheme = url.Scheme + + httpClient := ctx.Value(ctxKeyHTTPClient) + if httpClient != nil { + config.HTTPClient = httpClient.(*http.Client) } - client := apiclient.New(transport, strfmt.Default) - mp := &operations.MetastatusParams{CmdArgs: cmdArgs, Context: ctx} - resp, err := client.Operations.Metastatus(mp) + client := paastaapi.NewAPIClient(config) + mr := client.DefaultApi.Metastatus(ctx).CmdArgs(cmdArgs) + metastatusResp, _, err := mr.Execute() if err != nil { return fmt.Errorf("Failed to get metastatus: %s", aurora.Red(err)) } - sb.WriteString(fmt.Sprintf("%s\n", resp.Payload.Output)) + sb.WriteString(fmt.Sprintf("%s\n", metastatusResp.GetOutput())) return nil } diff --git a/cmd/paasta-metastatus/main_test.go b/cmd/paasta-metastatus/main_test.go index c66a032..88d63a4 100644 --- a/cmd/paasta-metastatus/main_test.go +++ b/cmd/paasta-metastatus/main_test.go @@ -1,8 +1,11 @@ package main import ( + "bytes" "context" - "reflect" + "fmt" + "io/ioutil" + "net/http" "regexp" "strings" "testing" @@ -10,38 +13,30 @@ import ( "github.com/Yelp/paasta-tools-go/pkg/cli" - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" - - "github.com/go-openapi/runtime" "github.com/stretchr/testify/assert" - - operations "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/operations" ) -type MockTransport struct { - Ops []*runtime.ClientOperation +type recordingTransport struct { + req []*http.Request } -func (m *MockTransport) Submit(co *runtime.ClientOperation) (interface{}, error) { - m.Ops = append(m.Ops, co) - return &operations.MetastatusOK{ - Payload: &models.MetaStatus{ - Output: "foo", - }, +func (t *recordingTransport) RoundTrip(req *http.Request) (resp *http.Response, err error) { + t.req = append(t.req, req) + return &http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(bytes.NewReader([]byte("{}"))), + Header: http.Header{"Content-Type": []string{"application/json"}}, }, nil } -func (m *MockTransport) Reset() { - m.Ops = []*runtime.ClientOperation{} -} - func makeTestContext() context.Context { - t := &MockTransport{} - err := &strings.Builder{} - out := &strings.Builder{} - ctx := context.WithValue(context.Background(), ctxKeyTransport, t) - ctx = context.WithValue(ctx, ctxKeyOut, out) - ctx = context.WithValue(ctx, ctxKeyErr, err) + t := &recordingTransport{} + t.req = make([]*http.Request, 0) + cl := &http.Client{Transport: t} + fmt.Printf("%p\n", cl) + ctx := context.WithValue(context.Background(), ctxKeyHTTPClient, cl) + ctx = context.WithValue(ctx, ctxKeyOut, &strings.Builder{}) + ctx = context.WithValue(ctx, ctxKeyErr, &strings.Builder{}) return ctx } @@ -60,20 +55,21 @@ func TestMetastatus(test *testing.T) { mockCmdArgs, ) - transport := ctx.Value(ctxKeyTransport).(*MockTransport) - if len(transport.Ops) != 1 { - test.Logf("opes: %v", transport.Ops) - test.Errorf("expected number of operations: 1, got: %v", len(transport.Ops)) + cl := ctx.Value(ctxKeyHTTPClient).(*http.Client) + tr := cl.Transport.(*recordingTransport) + if len(tr.req) != 1 { + test.Logf("requests: %v", tr.req) + test.Errorf("expected number of requests: 1, got: %v", len(tr.req)) } - metastatusOp := transport.Ops[0] - if metastatusOp.PathPattern != "/metastatus" { - test.Errorf("unexpected path: %v", metastatusOp.PathPattern) + request := tr.req[0] + if request.URL.Path != "/v1/metastatus" { + test.Errorf("unexpected path: %v", request.URL.Path) } - params := metastatusOp.Params.(*operations.MetastatusParams) - if !reflect.DeepEqual(params.CmdArgs, mockCmdArgs) { - test.Errorf("expected mock args: %v, actual: %v", mockCmdArgs, params.CmdArgs) + query := request.URL.RawQuery + if query != "cmd_args=foo%2Cbar" { + test.Errorf("expected mock args: %v, actual: %v", mockCmdArgs, query) } errf := ctx.Value(ctxKeyErr).(*strings.Builder) diff --git a/pkg/paasta_api/client/autoscaler/autoscaler_client.go b/pkg/paasta_api/client/autoscaler/autoscaler_client.go deleted file mode 100644 index 723b895..0000000 --- a/pkg/paasta_api/client/autoscaler/autoscaler_client.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package autoscaler - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new autoscaler API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for autoscaler API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientService is the interface for Client methods -type ClientService interface { - GetAutoscalerCount(params *GetAutoscalerCountParams) (*GetAutoscalerCountOK, error) - - UpdateAutoscalerCount(params *UpdateAutoscalerCountParams) (*UpdateAutoscalerCountAccepted, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetAutoscalerCount gets status of service name instance name -*/ -func (a *Client) GetAutoscalerCount(params *GetAutoscalerCountParams) (*GetAutoscalerCountOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAutoscalerCountParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "get_autoscaler_count", - Method: "GET", - PathPattern: "/services/{service}/{instance}/autoscaler", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAutoscalerCountReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetAutoscalerCountOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for get_autoscaler_count: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateAutoscalerCount gets status of service name instance name -*/ -func (a *Client) UpdateAutoscalerCount(params *UpdateAutoscalerCountParams) (*UpdateAutoscalerCountAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateAutoscalerCountParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "update_autoscaler_count", - Method: "POST", - PathPattern: "/services/{service}/{instance}/autoscaler", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateAutoscalerCountReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateAutoscalerCountAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for update_autoscaler_count: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/paasta_api/client/autoscaler/get_autoscaler_count_parameters.go b/pkg/paasta_api/client/autoscaler/get_autoscaler_count_parameters.go deleted file mode 100644 index df8c045..0000000 --- a/pkg/paasta_api/client/autoscaler/get_autoscaler_count_parameters.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package autoscaler - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetAutoscalerCountParams creates a new GetAutoscalerCountParams object -// with the default values initialized. -func NewGetAutoscalerCountParams() *GetAutoscalerCountParams { - var () - return &GetAutoscalerCountParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewGetAutoscalerCountParamsWithTimeout creates a new GetAutoscalerCountParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewGetAutoscalerCountParamsWithTimeout(timeout time.Duration) *GetAutoscalerCountParams { - var () - return &GetAutoscalerCountParams{ - - timeout: timeout, - } -} - -// NewGetAutoscalerCountParamsWithContext creates a new GetAutoscalerCountParams object -// with the default values initialized, and the ability to set a context for a request -func NewGetAutoscalerCountParamsWithContext(ctx context.Context) *GetAutoscalerCountParams { - var () - return &GetAutoscalerCountParams{ - - Context: ctx, - } -} - -// NewGetAutoscalerCountParamsWithHTTPClient creates a new GetAutoscalerCountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewGetAutoscalerCountParamsWithHTTPClient(client *http.Client) *GetAutoscalerCountParams { - var () - return &GetAutoscalerCountParams{ - HTTPClient: client, - } -} - -/*GetAutoscalerCountParams contains all the parameters to send to the API endpoint -for the get autoscaler count operation typically these are written to a http.Request -*/ -type GetAutoscalerCountParams struct { - - /*Instance - Instance name - - */ - Instance string - /*Service - Service name - - */ - Service string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the get autoscaler count params -func (o *GetAutoscalerCountParams) WithTimeout(timeout time.Duration) *GetAutoscalerCountParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get autoscaler count params -func (o *GetAutoscalerCountParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get autoscaler count params -func (o *GetAutoscalerCountParams) WithContext(ctx context.Context) *GetAutoscalerCountParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get autoscaler count params -func (o *GetAutoscalerCountParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get autoscaler count params -func (o *GetAutoscalerCountParams) WithHTTPClient(client *http.Client) *GetAutoscalerCountParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get autoscaler count params -func (o *GetAutoscalerCountParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithInstance adds the instance to the get autoscaler count params -func (o *GetAutoscalerCountParams) WithInstance(instance string) *GetAutoscalerCountParams { - o.SetInstance(instance) - return o -} - -// SetInstance adds the instance to the get autoscaler count params -func (o *GetAutoscalerCountParams) SetInstance(instance string) { - o.Instance = instance -} - -// WithService adds the service to the get autoscaler count params -func (o *GetAutoscalerCountParams) WithService(service string) *GetAutoscalerCountParams { - o.SetService(service) - return o -} - -// SetService adds the service to the get autoscaler count params -func (o *GetAutoscalerCountParams) SetService(service string) { - o.Service = service -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAutoscalerCountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param instance - if err := r.SetPathParam("instance", o.Instance); err != nil { - return err - } - - // path param service - if err := r.SetPathParam("service", o.Service); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/client/autoscaler/get_autoscaler_count_responses.go b/pkg/paasta_api/client/autoscaler/get_autoscaler_count_responses.go deleted file mode 100644 index 3530321..0000000 --- a/pkg/paasta_api/client/autoscaler/get_autoscaler_count_responses.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package autoscaler - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// GetAutoscalerCountReader is a Reader for the GetAutoscalerCount structure. -type GetAutoscalerCountReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAutoscalerCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAutoscalerCountOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewGetAutoscalerCountNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAutoscalerCountInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewGetAutoscalerCountOK creates a GetAutoscalerCountOK with default headers values -func NewGetAutoscalerCountOK() *GetAutoscalerCountOK { - return &GetAutoscalerCountOK{} -} - -/*GetAutoscalerCountOK handles this case with default header values. - -Get desired instance count for a service instance -*/ -type GetAutoscalerCountOK struct { - Payload *GetAutoscalerCountOKBody -} - -func (o *GetAutoscalerCountOK) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/autoscaler][%d] getAutoscalerCountOK %+v", 200, o.Payload) -} - -func (o *GetAutoscalerCountOK) GetPayload() *GetAutoscalerCountOKBody { - return o.Payload -} - -func (o *GetAutoscalerCountOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(GetAutoscalerCountOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAutoscalerCountNotFound creates a GetAutoscalerCountNotFound with default headers values -func NewGetAutoscalerCountNotFound() *GetAutoscalerCountNotFound { - return &GetAutoscalerCountNotFound{} -} - -/*GetAutoscalerCountNotFound handles this case with default header values. - -Deployment key not found -*/ -type GetAutoscalerCountNotFound struct { -} - -func (o *GetAutoscalerCountNotFound) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/autoscaler][%d] getAutoscalerCountNotFound ", 404) -} - -func (o *GetAutoscalerCountNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewGetAutoscalerCountInternalServerError creates a GetAutoscalerCountInternalServerError with default headers values -func NewGetAutoscalerCountInternalServerError() *GetAutoscalerCountInternalServerError { - return &GetAutoscalerCountInternalServerError{} -} - -/*GetAutoscalerCountInternalServerError handles this case with default header values. - -Instance failure -*/ -type GetAutoscalerCountInternalServerError struct { -} - -func (o *GetAutoscalerCountInternalServerError) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/autoscaler][%d] getAutoscalerCountInternalServerError ", 500) -} - -func (o *GetAutoscalerCountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -/*GetAutoscalerCountOKBody get autoscaler count o k body -swagger:model GetAutoscalerCountOKBody -*/ -type GetAutoscalerCountOKBody struct { - - // desired instances - DesiredInstances int64 `json:"desired_instances,omitempty"` -} - -// Validate validates this get autoscaler count o k body -func (o *GetAutoscalerCountOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAutoscalerCountOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAutoscalerCountOKBody) UnmarshalBinary(b []byte) error { - var res GetAutoscalerCountOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/paasta_api/client/autoscaler/update_autoscaler_count_parameters.go b/pkg/paasta_api/client/autoscaler/update_autoscaler_count_parameters.go deleted file mode 100644 index 4e4e1dc..0000000 --- a/pkg/paasta_api/client/autoscaler/update_autoscaler_count_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package autoscaler - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewUpdateAutoscalerCountParams creates a new UpdateAutoscalerCountParams object -// with the default values initialized. -func NewUpdateAutoscalerCountParams() *UpdateAutoscalerCountParams { - var () - return &UpdateAutoscalerCountParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateAutoscalerCountParamsWithTimeout creates a new UpdateAutoscalerCountParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewUpdateAutoscalerCountParamsWithTimeout(timeout time.Duration) *UpdateAutoscalerCountParams { - var () - return &UpdateAutoscalerCountParams{ - - timeout: timeout, - } -} - -// NewUpdateAutoscalerCountParamsWithContext creates a new UpdateAutoscalerCountParams object -// with the default values initialized, and the ability to set a context for a request -func NewUpdateAutoscalerCountParamsWithContext(ctx context.Context) *UpdateAutoscalerCountParams { - var () - return &UpdateAutoscalerCountParams{ - - Context: ctx, - } -} - -// NewUpdateAutoscalerCountParamsWithHTTPClient creates a new UpdateAutoscalerCountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewUpdateAutoscalerCountParamsWithHTTPClient(client *http.Client) *UpdateAutoscalerCountParams { - var () - return &UpdateAutoscalerCountParams{ - HTTPClient: client, - } -} - -/*UpdateAutoscalerCountParams contains all the parameters to send to the API endpoint -for the update autoscaler count operation typically these are written to a http.Request -*/ -type UpdateAutoscalerCountParams struct { - - /*Instance - Instance name - - */ - Instance string - /*JSONBody*/ - JSONBody UpdateAutoscalerCountBody - /*Service - Service name - - */ - Service string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) WithTimeout(timeout time.Duration) *UpdateAutoscalerCountParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) WithContext(ctx context.Context) *UpdateAutoscalerCountParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) WithHTTPClient(client *http.Client) *UpdateAutoscalerCountParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithInstance adds the instance to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) WithInstance(instance string) *UpdateAutoscalerCountParams { - o.SetInstance(instance) - return o -} - -// SetInstance adds the instance to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) SetInstance(instance string) { - o.Instance = instance -} - -// WithJSONBody adds the jSONBody to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) WithJSONBody(jSONBody UpdateAutoscalerCountBody) *UpdateAutoscalerCountParams { - o.SetJSONBody(jSONBody) - return o -} - -// SetJSONBody adds the jsonBody to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) SetJSONBody(jSONBody UpdateAutoscalerCountBody) { - o.JSONBody = jSONBody -} - -// WithService adds the service to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) WithService(service string) *UpdateAutoscalerCountParams { - o.SetService(service) - return o -} - -// SetService adds the service to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) SetService(service string) { - o.Service = service -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateAutoscalerCountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param instance - if err := r.SetPathParam("instance", o.Instance); err != nil { - return err - } - - if err := r.SetBodyParam(o.JSONBody); err != nil { - return err - } - - // path param service - if err := r.SetPathParam("service", o.Service); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/client/autoscaler/update_autoscaler_count_responses.go b/pkg/paasta_api/client/autoscaler/update_autoscaler_count_responses.go deleted file mode 100644 index fc7be49..0000000 --- a/pkg/paasta_api/client/autoscaler/update_autoscaler_count_responses.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package autoscaler - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// UpdateAutoscalerCountReader is a Reader for the UpdateAutoscalerCount structure. -type UpdateAutoscalerCountReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateAutoscalerCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewUpdateAutoscalerCountAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewUpdateAutoscalerCountNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateAutoscalerCountInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewUpdateAutoscalerCountAccepted creates a UpdateAutoscalerCountAccepted with default headers values -func NewUpdateAutoscalerCountAccepted() *UpdateAutoscalerCountAccepted { - return &UpdateAutoscalerCountAccepted{} -} - -/*UpdateAutoscalerCountAccepted handles this case with default header values. - -Set desired instance count for a service instance -*/ -type UpdateAutoscalerCountAccepted struct { - Payload *UpdateAutoscalerCountAcceptedBody -} - -func (o *UpdateAutoscalerCountAccepted) Error() string { - return fmt.Sprintf("[POST /services/{service}/{instance}/autoscaler][%d] updateAutoscalerCountAccepted %+v", 202, o.Payload) -} - -func (o *UpdateAutoscalerCountAccepted) GetPayload() *UpdateAutoscalerCountAcceptedBody { - return o.Payload -} - -func (o *UpdateAutoscalerCountAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(UpdateAutoscalerCountAcceptedBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateAutoscalerCountNotFound creates a UpdateAutoscalerCountNotFound with default headers values -func NewUpdateAutoscalerCountNotFound() *UpdateAutoscalerCountNotFound { - return &UpdateAutoscalerCountNotFound{} -} - -/*UpdateAutoscalerCountNotFound handles this case with default header values. - -Deployment key not found -*/ -type UpdateAutoscalerCountNotFound struct { -} - -func (o *UpdateAutoscalerCountNotFound) Error() string { - return fmt.Sprintf("[POST /services/{service}/{instance}/autoscaler][%d] updateAutoscalerCountNotFound ", 404) -} - -func (o *UpdateAutoscalerCountNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewUpdateAutoscalerCountInternalServerError creates a UpdateAutoscalerCountInternalServerError with default headers values -func NewUpdateAutoscalerCountInternalServerError() *UpdateAutoscalerCountInternalServerError { - return &UpdateAutoscalerCountInternalServerError{} -} - -/*UpdateAutoscalerCountInternalServerError handles this case with default header values. - -Instance failure -*/ -type UpdateAutoscalerCountInternalServerError struct { -} - -func (o *UpdateAutoscalerCountInternalServerError) Error() string { - return fmt.Sprintf("[POST /services/{service}/{instance}/autoscaler][%d] updateAutoscalerCountInternalServerError ", 500) -} - -func (o *UpdateAutoscalerCountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -/*UpdateAutoscalerCountAcceptedBody update autoscaler count accepted body -swagger:model UpdateAutoscalerCountAcceptedBody -*/ -type UpdateAutoscalerCountAcceptedBody struct { - - // desired instances - DesiredInstances int64 `json:"desired_instances,omitempty"` - - // status - Status string `json:"status,omitempty"` -} - -// Validate validates this update autoscaler count accepted body -func (o *UpdateAutoscalerCountAcceptedBody) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateAutoscalerCountAcceptedBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateAutoscalerCountAcceptedBody) UnmarshalBinary(b []byte) error { - var res UpdateAutoscalerCountAcceptedBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*UpdateAutoscalerCountBody update autoscaler count body -swagger:model UpdateAutoscalerCountBody -*/ -type UpdateAutoscalerCountBody struct { - - // calculated instances - CalculatedInstances int64 `json:"calculated_instances,omitempty"` - - // desired instances - DesiredInstances int64 `json:"desired_instances,omitempty"` -} - -// Validate validates this update autoscaler count body -func (o *UpdateAutoscalerCountBody) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateAutoscalerCountBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateAutoscalerCountBody) UnmarshalBinary(b []byte) error { - var res UpdateAutoscalerCountBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_client.go b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_client.go deleted file mode 100644 index 986e590..0000000 --- a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_client.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package marathon_dashboard - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new marathon dashboard API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for marathon dashboard API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientService is the interface for Client methods -type ClientService interface { - MarathonDashboard(params *MarathonDashboardParams) (*MarathonDashboardOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - MarathonDashboard gets marathon service instances and their shards -*/ -func (a *Client) MarathonDashboard(params *MarathonDashboardParams) (*MarathonDashboardOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewMarathonDashboardParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "marathon_dashboard", - Method: "GET", - PathPattern: "/marathon_dashboard", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &MarathonDashboardReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*MarathonDashboardOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for marathon_dashboard: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_parameters.go b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_parameters.go deleted file mode 100644 index 67d5f61..0000000 --- a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_parameters.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package marathon_dashboard - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewMarathonDashboardParams creates a new MarathonDashboardParams object -// with the default values initialized. -func NewMarathonDashboardParams() *MarathonDashboardParams { - - return &MarathonDashboardParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewMarathonDashboardParamsWithTimeout creates a new MarathonDashboardParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewMarathonDashboardParamsWithTimeout(timeout time.Duration) *MarathonDashboardParams { - - return &MarathonDashboardParams{ - - timeout: timeout, - } -} - -// NewMarathonDashboardParamsWithContext creates a new MarathonDashboardParams object -// with the default values initialized, and the ability to set a context for a request -func NewMarathonDashboardParamsWithContext(ctx context.Context) *MarathonDashboardParams { - - return &MarathonDashboardParams{ - - Context: ctx, - } -} - -// NewMarathonDashboardParamsWithHTTPClient creates a new MarathonDashboardParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewMarathonDashboardParamsWithHTTPClient(client *http.Client) *MarathonDashboardParams { - - return &MarathonDashboardParams{ - HTTPClient: client, - } -} - -/*MarathonDashboardParams contains all the parameters to send to the API endpoint -for the marathon dashboard operation typically these are written to a http.Request -*/ -type MarathonDashboardParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the marathon dashboard params -func (o *MarathonDashboardParams) WithTimeout(timeout time.Duration) *MarathonDashboardParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the marathon dashboard params -func (o *MarathonDashboardParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the marathon dashboard params -func (o *MarathonDashboardParams) WithContext(ctx context.Context) *MarathonDashboardParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the marathon dashboard params -func (o *MarathonDashboardParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the marathon dashboard params -func (o *MarathonDashboardParams) WithHTTPClient(client *http.Client) *MarathonDashboardParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the marathon dashboard params -func (o *MarathonDashboardParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *MarathonDashboardParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_responses.go b/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_responses.go deleted file mode 100644 index b474020..0000000 --- a/pkg/paasta_api/client/marathon_dashboard/marathon_dashboard_responses.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package marathon_dashboard - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" -) - -// MarathonDashboardReader is a Reader for the MarathonDashboard structure. -type MarathonDashboardReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *MarathonDashboardReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewMarathonDashboardOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewMarathonDashboardOK creates a MarathonDashboardOK with default headers values -func NewMarathonDashboardOK() *MarathonDashboardOK { - return &MarathonDashboardOK{} -} - -/*MarathonDashboardOK handles this case with default header values. - -List of service instances and information on their Marathon shard -*/ -type MarathonDashboardOK struct { - Payload models.MarathonDashboard -} - -func (o *MarathonDashboardOK) Error() string { - return fmt.Sprintf("[GET /marathon_dashboard][%d] marathonDashboardOK %+v", 200, o.Payload) -} - -func (o *MarathonDashboardOK) GetPayload() models.MarathonDashboard { - return o.Payload -} - -func (o *MarathonDashboardOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_parameters.go b/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_parameters.go deleted file mode 100644 index 999782b..0000000 --- a/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_parameters.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteServiceAutoscalerPauseParams creates a new DeleteServiceAutoscalerPauseParams object -// with the default values initialized. -func NewDeleteServiceAutoscalerPauseParams() *DeleteServiceAutoscalerPauseParams { - - return &DeleteServiceAutoscalerPauseParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteServiceAutoscalerPauseParamsWithTimeout creates a new DeleteServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewDeleteServiceAutoscalerPauseParamsWithTimeout(timeout time.Duration) *DeleteServiceAutoscalerPauseParams { - - return &DeleteServiceAutoscalerPauseParams{ - - timeout: timeout, - } -} - -// NewDeleteServiceAutoscalerPauseParamsWithContext creates a new DeleteServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a context for a request -func NewDeleteServiceAutoscalerPauseParamsWithContext(ctx context.Context) *DeleteServiceAutoscalerPauseParams { - - return &DeleteServiceAutoscalerPauseParams{ - - Context: ctx, - } -} - -// NewDeleteServiceAutoscalerPauseParamsWithHTTPClient creates a new DeleteServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewDeleteServiceAutoscalerPauseParamsWithHTTPClient(client *http.Client) *DeleteServiceAutoscalerPauseParams { - - return &DeleteServiceAutoscalerPauseParams{ - HTTPClient: client, - } -} - -/*DeleteServiceAutoscalerPauseParams contains all the parameters to send to the API endpoint -for the delete service autoscaler pause operation typically these are written to a http.Request -*/ -type DeleteServiceAutoscalerPauseParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the delete service autoscaler pause params -func (o *DeleteServiceAutoscalerPauseParams) WithTimeout(timeout time.Duration) *DeleteServiceAutoscalerPauseParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete service autoscaler pause params -func (o *DeleteServiceAutoscalerPauseParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete service autoscaler pause params -func (o *DeleteServiceAutoscalerPauseParams) WithContext(ctx context.Context) *DeleteServiceAutoscalerPauseParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete service autoscaler pause params -func (o *DeleteServiceAutoscalerPauseParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete service autoscaler pause params -func (o *DeleteServiceAutoscalerPauseParams) WithHTTPClient(client *http.Client) *DeleteServiceAutoscalerPauseParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete service autoscaler pause params -func (o *DeleteServiceAutoscalerPauseParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteServiceAutoscalerPauseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_responses.go b/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_responses.go deleted file mode 100644 index d41f68f..0000000 --- a/pkg/paasta_api/client/operations/delete_service_autoscaler_pause_responses.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// DeleteServiceAutoscalerPauseReader is a Reader for the DeleteServiceAutoscalerPause structure. -type DeleteServiceAutoscalerPauseReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteServiceAutoscalerPauseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteServiceAutoscalerPauseOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 500: - result := NewDeleteServiceAutoscalerPauseInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewDeleteServiceAutoscalerPauseOK creates a DeleteServiceAutoscalerPauseOK with default headers values -func NewDeleteServiceAutoscalerPauseOK() *DeleteServiceAutoscalerPauseOK { - return &DeleteServiceAutoscalerPauseOK{} -} - -/*DeleteServiceAutoscalerPauseOK handles this case with default header values. - -Service autoscaler successfully unpaused -*/ -type DeleteServiceAutoscalerPauseOK struct { -} - -func (o *DeleteServiceAutoscalerPauseOK) Error() string { - return fmt.Sprintf("[DELETE /service_autoscaler/pause][%d] deleteServiceAutoscalerPauseOK ", 200) -} - -func (o *DeleteServiceAutoscalerPauseOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteServiceAutoscalerPauseInternalServerError creates a DeleteServiceAutoscalerPauseInternalServerError with default headers values -func NewDeleteServiceAutoscalerPauseInternalServerError() *DeleteServiceAutoscalerPauseInternalServerError { - return &DeleteServiceAutoscalerPauseInternalServerError{} -} - -/*DeleteServiceAutoscalerPauseInternalServerError handles this case with default header values. - -Unable to talk to zookeeper -*/ -type DeleteServiceAutoscalerPauseInternalServerError struct { -} - -func (o *DeleteServiceAutoscalerPauseInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /service_autoscaler/pause][%d] deleteServiceAutoscalerPauseInternalServerError ", 500) -} - -func (o *DeleteServiceAutoscalerPauseInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paasta_api/client/operations/deploy_queue_parameters.go b/pkg/paasta_api/client/operations/deploy_queue_parameters.go deleted file mode 100644 index a7e02a0..0000000 --- a/pkg/paasta_api/client/operations/deploy_queue_parameters.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeployQueueParams creates a new DeployQueueParams object -// with the default values initialized. -func NewDeployQueueParams() *DeployQueueParams { - - return &DeployQueueParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewDeployQueueParamsWithTimeout creates a new DeployQueueParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewDeployQueueParamsWithTimeout(timeout time.Duration) *DeployQueueParams { - - return &DeployQueueParams{ - - timeout: timeout, - } -} - -// NewDeployQueueParamsWithContext creates a new DeployQueueParams object -// with the default values initialized, and the ability to set a context for a request -func NewDeployQueueParamsWithContext(ctx context.Context) *DeployQueueParams { - - return &DeployQueueParams{ - - Context: ctx, - } -} - -// NewDeployQueueParamsWithHTTPClient creates a new DeployQueueParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewDeployQueueParamsWithHTTPClient(client *http.Client) *DeployQueueParams { - - return &DeployQueueParams{ - HTTPClient: client, - } -} - -/*DeployQueueParams contains all the parameters to send to the API endpoint -for the deploy queue operation typically these are written to a http.Request -*/ -type DeployQueueParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the deploy queue params -func (o *DeployQueueParams) WithTimeout(timeout time.Duration) *DeployQueueParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the deploy queue params -func (o *DeployQueueParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the deploy queue params -func (o *DeployQueueParams) WithContext(ctx context.Context) *DeployQueueParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the deploy queue params -func (o *DeployQueueParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the deploy queue params -func (o *DeployQueueParams) WithHTTPClient(client *http.Client) *DeployQueueParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the deploy queue params -func (o *DeployQueueParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *DeployQueueParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/client/operations/deploy_queue_responses.go b/pkg/paasta_api/client/operations/deploy_queue_responses.go deleted file mode 100644 index eab3e11..0000000 --- a/pkg/paasta_api/client/operations/deploy_queue_responses.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" -) - -// DeployQueueReader is a Reader for the DeployQueue structure. -type DeployQueueReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeployQueueReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeployQueueOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewDeployQueueOK creates a DeployQueueOK with default headers values -func NewDeployQueueOK() *DeployQueueOK { - return &DeployQueueOK{} -} - -/*DeployQueueOK handles this case with default header values. - -Contents of deploy queue -*/ -type DeployQueueOK struct { - Payload *models.DeployQueue -} - -func (o *DeployQueueOK) Error() string { - return fmt.Sprintf("[GET /deploy_queue][%d] deployQueueOK %+v", 200, o.Payload) -} - -func (o *DeployQueueOK) GetPayload() *models.DeployQueue { - return o.Payload -} - -func (o *DeployQueueOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.DeployQueue) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/paasta_api/client/operations/get_service_autoscaler_pause_parameters.go b/pkg/paasta_api/client/operations/get_service_autoscaler_pause_parameters.go deleted file mode 100644 index e00dd1b..0000000 --- a/pkg/paasta_api/client/operations/get_service_autoscaler_pause_parameters.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetServiceAutoscalerPauseParams creates a new GetServiceAutoscalerPauseParams object -// with the default values initialized. -func NewGetServiceAutoscalerPauseParams() *GetServiceAutoscalerPauseParams { - - return &GetServiceAutoscalerPauseParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewGetServiceAutoscalerPauseParamsWithTimeout creates a new GetServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewGetServiceAutoscalerPauseParamsWithTimeout(timeout time.Duration) *GetServiceAutoscalerPauseParams { - - return &GetServiceAutoscalerPauseParams{ - - timeout: timeout, - } -} - -// NewGetServiceAutoscalerPauseParamsWithContext creates a new GetServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a context for a request -func NewGetServiceAutoscalerPauseParamsWithContext(ctx context.Context) *GetServiceAutoscalerPauseParams { - - return &GetServiceAutoscalerPauseParams{ - - Context: ctx, - } -} - -// NewGetServiceAutoscalerPauseParamsWithHTTPClient creates a new GetServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewGetServiceAutoscalerPauseParamsWithHTTPClient(client *http.Client) *GetServiceAutoscalerPauseParams { - - return &GetServiceAutoscalerPauseParams{ - HTTPClient: client, - } -} - -/*GetServiceAutoscalerPauseParams contains all the parameters to send to the API endpoint -for the get service autoscaler pause operation typically these are written to a http.Request -*/ -type GetServiceAutoscalerPauseParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the get service autoscaler pause params -func (o *GetServiceAutoscalerPauseParams) WithTimeout(timeout time.Duration) *GetServiceAutoscalerPauseParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get service autoscaler pause params -func (o *GetServiceAutoscalerPauseParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get service autoscaler pause params -func (o *GetServiceAutoscalerPauseParams) WithContext(ctx context.Context) *GetServiceAutoscalerPauseParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get service autoscaler pause params -func (o *GetServiceAutoscalerPauseParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get service autoscaler pause params -func (o *GetServiceAutoscalerPauseParams) WithHTTPClient(client *http.Client) *GetServiceAutoscalerPauseParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get service autoscaler pause params -func (o *GetServiceAutoscalerPauseParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *GetServiceAutoscalerPauseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/client/operations/get_service_autoscaler_pause_responses.go b/pkg/paasta_api/client/operations/get_service_autoscaler_pause_responses.go deleted file mode 100644 index 5e0eda9..0000000 --- a/pkg/paasta_api/client/operations/get_service_autoscaler_pause_responses.go +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// GetServiceAutoscalerPauseReader is a Reader for the GetServiceAutoscalerPause structure. -type GetServiceAutoscalerPauseReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetServiceAutoscalerPauseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetServiceAutoscalerPauseOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 500: - result := NewGetServiceAutoscalerPauseInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewGetServiceAutoscalerPauseOK creates a GetServiceAutoscalerPauseOK with default headers values -func NewGetServiceAutoscalerPauseOK() *GetServiceAutoscalerPauseOK { - return &GetServiceAutoscalerPauseOK{} -} - -/*GetServiceAutoscalerPauseOK handles this case with default header values. - -The time until which the servcie autoscaler is paused for -*/ -type GetServiceAutoscalerPauseOK struct { - Payload string -} - -func (o *GetServiceAutoscalerPauseOK) Error() string { - return fmt.Sprintf("[GET /service_autoscaler/pause][%d] getServiceAutoscalerPauseOK %+v", 200, o.Payload) -} - -func (o *GetServiceAutoscalerPauseOK) GetPayload() string { - return o.Payload -} - -func (o *GetServiceAutoscalerPauseOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetServiceAutoscalerPauseInternalServerError creates a GetServiceAutoscalerPauseInternalServerError with default headers values -func NewGetServiceAutoscalerPauseInternalServerError() *GetServiceAutoscalerPauseInternalServerError { - return &GetServiceAutoscalerPauseInternalServerError{} -} - -/*GetServiceAutoscalerPauseInternalServerError handles this case with default header values. - -Unable to talk to zookeeper -*/ -type GetServiceAutoscalerPauseInternalServerError struct { -} - -func (o *GetServiceAutoscalerPauseInternalServerError) Error() string { - return fmt.Sprintf("[GET /service_autoscaler/pause][%d] getServiceAutoscalerPauseInternalServerError ", 500) -} - -func (o *GetServiceAutoscalerPauseInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paasta_api/client/operations/metastatus_parameters.go b/pkg/paasta_api/client/operations/metastatus_parameters.go deleted file mode 100644 index 3448fcd..0000000 --- a/pkg/paasta_api/client/operations/metastatus_parameters.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewMetastatusParams creates a new MetastatusParams object -// with the default values initialized. -func NewMetastatusParams() *MetastatusParams { - var () - return &MetastatusParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewMetastatusParamsWithTimeout creates a new MetastatusParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewMetastatusParamsWithTimeout(timeout time.Duration) *MetastatusParams { - var () - return &MetastatusParams{ - - timeout: timeout, - } -} - -// NewMetastatusParamsWithContext creates a new MetastatusParams object -// with the default values initialized, and the ability to set a context for a request -func NewMetastatusParamsWithContext(ctx context.Context) *MetastatusParams { - var () - return &MetastatusParams{ - - Context: ctx, - } -} - -// NewMetastatusParamsWithHTTPClient creates a new MetastatusParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewMetastatusParamsWithHTTPClient(client *http.Client) *MetastatusParams { - var () - return &MetastatusParams{ - HTTPClient: client, - } -} - -/*MetastatusParams contains all the parameters to send to the API endpoint -for the metastatus operation typically these are written to a http.Request -*/ -type MetastatusParams struct { - - /*CmdArgs - comma separated list of command arguments - - */ - CmdArgs []string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the metastatus params -func (o *MetastatusParams) WithTimeout(timeout time.Duration) *MetastatusParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the metastatus params -func (o *MetastatusParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the metastatus params -func (o *MetastatusParams) WithContext(ctx context.Context) *MetastatusParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the metastatus params -func (o *MetastatusParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the metastatus params -func (o *MetastatusParams) WithHTTPClient(client *http.Client) *MetastatusParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the metastatus params -func (o *MetastatusParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCmdArgs adds the cmdArgs to the metastatus params -func (o *MetastatusParams) WithCmdArgs(cmdArgs []string) *MetastatusParams { - o.SetCmdArgs(cmdArgs) - return o -} - -// SetCmdArgs adds the cmdArgs to the metastatus params -func (o *MetastatusParams) SetCmdArgs(cmdArgs []string) { - o.CmdArgs = cmdArgs -} - -// WriteToRequest writes these params to a swagger request -func (o *MetastatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - valuesCmdArgs := o.CmdArgs - - joinedCmdArgs := swag.JoinByFormat(valuesCmdArgs, "csv") - // query array param cmd_args - if err := r.SetQueryParam("cmd_args", joinedCmdArgs...); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/client/operations/metastatus_responses.go b/pkg/paasta_api/client/operations/metastatus_responses.go deleted file mode 100644 index 60f309a..0000000 --- a/pkg/paasta_api/client/operations/metastatus_responses.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" -) - -// MetastatusReader is a Reader for the Metastatus structure. -type MetastatusReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *MetastatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewMetastatusOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 500: - result := NewMetastatusInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewMetastatusOK creates a MetastatusOK with default headers values -func NewMetastatusOK() *MetastatusOK { - return &MetastatusOK{} -} - -/*MetastatusOK handles this case with default header values. - -Detailed metastatus -*/ -type MetastatusOK struct { - Payload *models.MetaStatus -} - -func (o *MetastatusOK) Error() string { - return fmt.Sprintf("[GET /metastatus][%d] metastatusOK %+v", 200, o.Payload) -} - -func (o *MetastatusOK) GetPayload() *models.MetaStatus { - return o.Payload -} - -func (o *MetastatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.MetaStatus) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewMetastatusInternalServerError creates a MetastatusInternalServerError with default headers values -func NewMetastatusInternalServerError() *MetastatusInternalServerError { - return &MetastatusInternalServerError{} -} - -/*MetastatusInternalServerError handles this case with default header values. - -Metastatus failure -*/ -type MetastatusInternalServerError struct { -} - -func (o *MetastatusInternalServerError) Error() string { - return fmt.Sprintf("[GET /metastatus][%d] metastatusInternalServerError ", 500) -} - -func (o *MetastatusInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paasta_api/client/operations/operations_client.go b/pkg/paasta_api/client/operations/operations_client.go deleted file mode 100644 index 825d239..0000000 --- a/pkg/paasta_api/client/operations/operations_client.go +++ /dev/null @@ -1,252 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new operations API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for operations API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientService is the interface for Client methods -type ClientService interface { - DeleteServiceAutoscalerPause(params *DeleteServiceAutoscalerPauseParams) (*DeleteServiceAutoscalerPauseOK, error) - - DeployQueue(params *DeployQueueParams) (*DeployQueueOK, error) - - GetServiceAutoscalerPause(params *GetServiceAutoscalerPauseParams) (*GetServiceAutoscalerPauseOK, error) - - Metastatus(params *MetastatusParams) (*MetastatusOK, error) - - ShowVersion(params *ShowVersionParams) (*ShowVersionOK, error) - - UpdateServiceAutoscalerPause(params *UpdateServiceAutoscalerPauseParams) (*UpdateServiceAutoscalerPauseOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - DeleteServiceAutoscalerPause unpauses the autoscaler -*/ -func (a *Client) DeleteServiceAutoscalerPause(params *DeleteServiceAutoscalerPauseParams) (*DeleteServiceAutoscalerPauseOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteServiceAutoscalerPauseParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "delete_service_autoscaler_pause", - Method: "DELETE", - PathPattern: "/service_autoscaler/pause", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &DeleteServiceAutoscalerPauseReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteServiceAutoscalerPauseOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for delete_service_autoscaler_pause: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeployQueue gets deploy queue contents -*/ -func (a *Client) DeployQueue(params *DeployQueueParams) (*DeployQueueOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeployQueueParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "deploy_queue", - Method: "GET", - PathPattern: "/deploy_queue", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &DeployQueueReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*DeployQueueOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deploy_queue: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetServiceAutoscalerPause gets autoscaling pause time -*/ -func (a *Client) GetServiceAutoscalerPause(params *GetServiceAutoscalerPauseParams) (*GetServiceAutoscalerPauseOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetServiceAutoscalerPauseParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "get_service_autoscaler_pause", - Method: "GET", - PathPattern: "/service_autoscaler/pause", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetServiceAutoscalerPauseReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetServiceAutoscalerPauseOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for get_service_autoscaler_pause: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - Metastatus gets metastatus -*/ -func (a *Client) Metastatus(params *MetastatusParams) (*MetastatusOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewMetastatusParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "metastatus", - Method: "GET", - PathPattern: "/metastatus", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &MetastatusReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*MetastatusOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for metastatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ShowVersion versions of paasta tools package -*/ -func (a *Client) ShowVersion(params *ShowVersionParams) (*ShowVersionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewShowVersionParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "showVersion", - Method: "GET", - PathPattern: "/version", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ShowVersionReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*ShowVersionOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for showVersion: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateServiceAutoscalerPause update service autoscaler pause API -*/ -func (a *Client) UpdateServiceAutoscalerPause(params *UpdateServiceAutoscalerPauseParams) (*UpdateServiceAutoscalerPauseOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateServiceAutoscalerPauseParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "update_service_autoscaler_pause", - Method: "POST", - PathPattern: "/service_autoscaler/pause", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateServiceAutoscalerPauseReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateServiceAutoscalerPauseOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for update_service_autoscaler_pause: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/paasta_api/client/operations/show_version_parameters.go b/pkg/paasta_api/client/operations/show_version_parameters.go deleted file mode 100644 index a8b181a..0000000 --- a/pkg/paasta_api/client/operations/show_version_parameters.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewShowVersionParams creates a new ShowVersionParams object -// with the default values initialized. -func NewShowVersionParams() *ShowVersionParams { - - return &ShowVersionParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewShowVersionParamsWithTimeout creates a new ShowVersionParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewShowVersionParamsWithTimeout(timeout time.Duration) *ShowVersionParams { - - return &ShowVersionParams{ - - timeout: timeout, - } -} - -// NewShowVersionParamsWithContext creates a new ShowVersionParams object -// with the default values initialized, and the ability to set a context for a request -func NewShowVersionParamsWithContext(ctx context.Context) *ShowVersionParams { - - return &ShowVersionParams{ - - Context: ctx, - } -} - -// NewShowVersionParamsWithHTTPClient creates a new ShowVersionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewShowVersionParamsWithHTTPClient(client *http.Client) *ShowVersionParams { - - return &ShowVersionParams{ - HTTPClient: client, - } -} - -/*ShowVersionParams contains all the parameters to send to the API endpoint -for the show version operation typically these are written to a http.Request -*/ -type ShowVersionParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the show version params -func (o *ShowVersionParams) WithTimeout(timeout time.Duration) *ShowVersionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the show version params -func (o *ShowVersionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the show version params -func (o *ShowVersionParams) WithContext(ctx context.Context) *ShowVersionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the show version params -func (o *ShowVersionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the show version params -func (o *ShowVersionParams) WithHTTPClient(client *http.Client) *ShowVersionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the show version params -func (o *ShowVersionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ShowVersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/client/operations/show_version_responses.go b/pkg/paasta_api/client/operations/show_version_responses.go deleted file mode 100644 index bd7c8f7..0000000 --- a/pkg/paasta_api/client/operations/show_version_responses.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// ShowVersionReader is a Reader for the ShowVersion structure. -type ShowVersionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ShowVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewShowVersionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewShowVersionOK creates a ShowVersionOK with default headers values -func NewShowVersionOK() *ShowVersionOK { - return &ShowVersionOK{} -} - -/*ShowVersionOK handles this case with default header values. - -Version of paasta_tools package -*/ -type ShowVersionOK struct { - Payload string -} - -func (o *ShowVersionOK) Error() string { - return fmt.Sprintf("[GET /version][%d] showVersionOK %+v", 200, o.Payload) -} - -func (o *ShowVersionOK) GetPayload() string { - return o.Payload -} - -func (o *ShowVersionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/paasta_api/client/operations/update_service_autoscaler_pause_parameters.go b/pkg/paasta_api/client/operations/update_service_autoscaler_pause_parameters.go deleted file mode 100644 index 5fb998d..0000000 --- a/pkg/paasta_api/client/operations/update_service_autoscaler_pause_parameters.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewUpdateServiceAutoscalerPauseParams creates a new UpdateServiceAutoscalerPauseParams object -// with the default values initialized. -func NewUpdateServiceAutoscalerPauseParams() *UpdateServiceAutoscalerPauseParams { - var () - return &UpdateServiceAutoscalerPauseParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateServiceAutoscalerPauseParamsWithTimeout creates a new UpdateServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewUpdateServiceAutoscalerPauseParamsWithTimeout(timeout time.Duration) *UpdateServiceAutoscalerPauseParams { - var () - return &UpdateServiceAutoscalerPauseParams{ - - timeout: timeout, - } -} - -// NewUpdateServiceAutoscalerPauseParamsWithContext creates a new UpdateServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a context for a request -func NewUpdateServiceAutoscalerPauseParamsWithContext(ctx context.Context) *UpdateServiceAutoscalerPauseParams { - var () - return &UpdateServiceAutoscalerPauseParams{ - - Context: ctx, - } -} - -// NewUpdateServiceAutoscalerPauseParamsWithHTTPClient creates a new UpdateServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewUpdateServiceAutoscalerPauseParamsWithHTTPClient(client *http.Client) *UpdateServiceAutoscalerPauseParams { - var () - return &UpdateServiceAutoscalerPauseParams{ - HTTPClient: client, - } -} - -/*UpdateServiceAutoscalerPauseParams contains all the parameters to send to the API endpoint -for the update service autoscaler pause operation typically these are written to a http.Request -*/ -type UpdateServiceAutoscalerPauseParams struct { - - /*JSONBody*/ - JSONBody UpdateServiceAutoscalerPauseBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the update service autoscaler pause params -func (o *UpdateServiceAutoscalerPauseParams) WithTimeout(timeout time.Duration) *UpdateServiceAutoscalerPauseParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update service autoscaler pause params -func (o *UpdateServiceAutoscalerPauseParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update service autoscaler pause params -func (o *UpdateServiceAutoscalerPauseParams) WithContext(ctx context.Context) *UpdateServiceAutoscalerPauseParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update service autoscaler pause params -func (o *UpdateServiceAutoscalerPauseParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update service autoscaler pause params -func (o *UpdateServiceAutoscalerPauseParams) WithHTTPClient(client *http.Client) *UpdateServiceAutoscalerPauseParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update service autoscaler pause params -func (o *UpdateServiceAutoscalerPauseParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithJSONBody adds the jSONBody to the update service autoscaler pause params -func (o *UpdateServiceAutoscalerPauseParams) WithJSONBody(jSONBody UpdateServiceAutoscalerPauseBody) *UpdateServiceAutoscalerPauseParams { - o.SetJSONBody(jSONBody) - return o -} - -// SetJSONBody adds the jsonBody to the update service autoscaler pause params -func (o *UpdateServiceAutoscalerPauseParams) SetJSONBody(jSONBody UpdateServiceAutoscalerPauseBody) { - o.JSONBody = jSONBody -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateServiceAutoscalerPauseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if err := r.SetBodyParam(o.JSONBody); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/client/operations/update_service_autoscaler_pause_responses.go b/pkg/paasta_api/client/operations/update_service_autoscaler_pause_responses.go deleted file mode 100644 index 4496259..0000000 --- a/pkg/paasta_api/client/operations/update_service_autoscaler_pause_responses.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// UpdateServiceAutoscalerPauseReader is a Reader for the UpdateServiceAutoscalerPause structure. -type UpdateServiceAutoscalerPauseReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateServiceAutoscalerPauseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateServiceAutoscalerPauseOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 500: - result := NewUpdateServiceAutoscalerPauseInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewUpdateServiceAutoscalerPauseOK creates a UpdateServiceAutoscalerPauseOK with default headers values -func NewUpdateServiceAutoscalerPauseOK() *UpdateServiceAutoscalerPauseOK { - return &UpdateServiceAutoscalerPauseOK{} -} - -/*UpdateServiceAutoscalerPauseOK handles this case with default header values. - -Service autoscaler successfully paused -*/ -type UpdateServiceAutoscalerPauseOK struct { -} - -func (o *UpdateServiceAutoscalerPauseOK) Error() string { - return fmt.Sprintf("[POST /service_autoscaler/pause][%d] updateServiceAutoscalerPauseOK ", 200) -} - -func (o *UpdateServiceAutoscalerPauseOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewUpdateServiceAutoscalerPauseInternalServerError creates a UpdateServiceAutoscalerPauseInternalServerError with default headers values -func NewUpdateServiceAutoscalerPauseInternalServerError() *UpdateServiceAutoscalerPauseInternalServerError { - return &UpdateServiceAutoscalerPauseInternalServerError{} -} - -/*UpdateServiceAutoscalerPauseInternalServerError handles this case with default header values. - -Unable to talk to zookeeper -*/ -type UpdateServiceAutoscalerPauseInternalServerError struct { -} - -func (o *UpdateServiceAutoscalerPauseInternalServerError) Error() string { - return fmt.Sprintf("[POST /service_autoscaler/pause][%d] updateServiceAutoscalerPauseInternalServerError ", 500) -} - -func (o *UpdateServiceAutoscalerPauseInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -/*UpdateServiceAutoscalerPauseBody update service autoscaler pause body -swagger:model UpdateServiceAutoscalerPauseBody -*/ -type UpdateServiceAutoscalerPauseBody struct { - - // minutes - Minutes int64 `json:"minutes,omitempty"` -} - -// Validate validates this update service autoscaler pause body -func (o *UpdateServiceAutoscalerPauseBody) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateServiceAutoscalerPauseBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateServiceAutoscalerPauseBody) UnmarshalBinary(b []byte) error { - var res UpdateServiceAutoscalerPauseBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/paasta_api/client/paasta_client.go b/pkg/paasta_api/client/paasta_client.go deleted file mode 100644 index 4668e19..0000000 --- a/pkg/paasta_api/client/paasta_client.go +++ /dev/null @@ -1,132 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/autoscaler" - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/marathon_dashboard" - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/operations" - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/resources" - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/client/service" -) - -// Default paasta HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/v1" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http"} - -// NewHTTPClient creates a new paasta HTTP client. -func NewHTTPClient(formats strfmt.Registry) *Paasta { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new paasta HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Paasta { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new paasta client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Paasta { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(Paasta) - cli.Transport = transport - cli.Autoscaler = autoscaler.New(transport, formats) - cli.MarathonDashboard = marathon_dashboard.New(transport, formats) - cli.Operations = operations.New(transport, formats) - cli.Resources = resources.New(transport, formats) - cli.Service = service.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// Paasta is a client for paasta -type Paasta struct { - Autoscaler autoscaler.ClientService - - MarathonDashboard marathon_dashboard.ClientService - - Operations operations.ClientService - - Resources resources.ClientService - - Service service.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *Paasta) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.Autoscaler.SetTransport(transport) - c.MarathonDashboard.SetTransport(transport) - c.Operations.SetTransport(transport) - c.Resources.SetTransport(transport) - c.Service.SetTransport(transport) -} diff --git a/pkg/paasta_api/client/resources/resources_client.go b/pkg/paasta_api/client/resources/resources_client.go deleted file mode 100644 index 94639f3..0000000 --- a/pkg/paasta_api/client/resources/resources_client.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package resources - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new resources API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for resources API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientService is the interface for Client methods -type ClientService interface { - Resources(params *ResourcesParams) (*ResourcesOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - Resources gets resources in the cluster -*/ -func (a *Client) Resources(params *ResourcesParams) (*ResourcesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewResourcesParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "resources", - Method: "GET", - PathPattern: "/resources/utilization", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ResourcesReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*ResourcesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for resources: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/paasta_api/client/resources/resources_parameters.go b/pkg/paasta_api/client/resources/resources_parameters.go deleted file mode 100644 index 48a697f..0000000 --- a/pkg/paasta_api/client/resources/resources_parameters.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package resources - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewResourcesParams creates a new ResourcesParams object -// with the default values initialized. -func NewResourcesParams() *ResourcesParams { - var () - return &ResourcesParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewResourcesParamsWithTimeout creates a new ResourcesParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewResourcesParamsWithTimeout(timeout time.Duration) *ResourcesParams { - var () - return &ResourcesParams{ - - timeout: timeout, - } -} - -// NewResourcesParamsWithContext creates a new ResourcesParams object -// with the default values initialized, and the ability to set a context for a request -func NewResourcesParamsWithContext(ctx context.Context) *ResourcesParams { - var () - return &ResourcesParams{ - - Context: ctx, - } -} - -// NewResourcesParamsWithHTTPClient creates a new ResourcesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewResourcesParamsWithHTTPClient(client *http.Client) *ResourcesParams { - var () - return &ResourcesParams{ - HTTPClient: client, - } -} - -/*ResourcesParams contains all the parameters to send to the API endpoint -for the resources operation typically these are written to a http.Request -*/ -type ResourcesParams struct { - - /*Filter - List of slave filters in format 'filter=attr_name:value1,value2&filter=attr2:value3,value4'. Matches attr_name=(value1 OR value2) AND attr2=(value3 OR value4) - - */ - Filter []string - /*Groupings - comma separated list of keys to group by - - */ - Groupings []string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the resources params -func (o *ResourcesParams) WithTimeout(timeout time.Duration) *ResourcesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the resources params -func (o *ResourcesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the resources params -func (o *ResourcesParams) WithContext(ctx context.Context) *ResourcesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the resources params -func (o *ResourcesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the resources params -func (o *ResourcesParams) WithHTTPClient(client *http.Client) *ResourcesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the resources params -func (o *ResourcesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the resources params -func (o *ResourcesParams) WithFilter(filter []string) *ResourcesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the resources params -func (o *ResourcesParams) SetFilter(filter []string) { - o.Filter = filter -} - -// WithGroupings adds the groupings to the resources params -func (o *ResourcesParams) WithGroupings(groupings []string) *ResourcesParams { - o.SetGroupings(groupings) - return o -} - -// SetGroupings adds the groupings to the resources params -func (o *ResourcesParams) SetGroupings(groupings []string) { - o.Groupings = groupings -} - -// WriteToRequest writes these params to a swagger request -func (o *ResourcesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - valuesFilter := o.Filter - - joinedFilter := swag.JoinByFormat(valuesFilter, "multi") - // query array param filter - if err := r.SetQueryParam("filter", joinedFilter...); err != nil { - return err - } - - valuesGroupings := o.Groupings - - joinedGroupings := swag.JoinByFormat(valuesGroupings, "csv") - // query array param groupings - if err := r.SetQueryParam("groupings", joinedGroupings...); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/client/resources/resources_responses.go b/pkg/paasta_api/client/resources/resources_responses.go deleted file mode 100644 index e82b82e..0000000 --- a/pkg/paasta_api/client/resources/resources_responses.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package resources - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" -) - -// ResourcesReader is a Reader for the Resources structure. -type ResourcesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ResourcesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewResourcesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewResourcesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewResourcesOK creates a ResourcesOK with default headers values -func NewResourcesOK() *ResourcesOK { - return &ResourcesOK{} -} - -/*ResourcesOK handles this case with default header values. - -Resources in the cluster, filtered and grouped by parameters -*/ -type ResourcesOK struct { - Payload models.Resource -} - -func (o *ResourcesOK) Error() string { - return fmt.Sprintf("[GET /resources/utilization][%d] resourcesOK %+v", 200, o.Payload) -} - -func (o *ResourcesOK) GetPayload() models.Resource { - return o.Payload -} - -func (o *ResourcesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewResourcesBadRequest creates a ResourcesBadRequest with default headers values -func NewResourcesBadRequest() *ResourcesBadRequest { - return &ResourcesBadRequest{} -} - -/*ResourcesBadRequest handles this case with default header values. - -Poorly formated query parameters -*/ -type ResourcesBadRequest struct { -} - -func (o *ResourcesBadRequest) Error() string { - return fmt.Sprintf("[GET /resources/utilization][%d] resourcesBadRequest ", 400) -} - -func (o *ResourcesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paasta_api/client/service/delay_instance_parameters.go b/pkg/paasta_api/client/service/delay_instance_parameters.go deleted file mode 100644 index 3b90c31..0000000 --- a/pkg/paasta_api/client/service/delay_instance_parameters.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDelayInstanceParams creates a new DelayInstanceParams object -// with the default values initialized. -func NewDelayInstanceParams() *DelayInstanceParams { - var () - return &DelayInstanceParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewDelayInstanceParamsWithTimeout creates a new DelayInstanceParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewDelayInstanceParamsWithTimeout(timeout time.Duration) *DelayInstanceParams { - var () - return &DelayInstanceParams{ - - timeout: timeout, - } -} - -// NewDelayInstanceParamsWithContext creates a new DelayInstanceParams object -// with the default values initialized, and the ability to set a context for a request -func NewDelayInstanceParamsWithContext(ctx context.Context) *DelayInstanceParams { - var () - return &DelayInstanceParams{ - - Context: ctx, - } -} - -// NewDelayInstanceParamsWithHTTPClient creates a new DelayInstanceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewDelayInstanceParamsWithHTTPClient(client *http.Client) *DelayInstanceParams { - var () - return &DelayInstanceParams{ - HTTPClient: client, - } -} - -/*DelayInstanceParams contains all the parameters to send to the API endpoint -for the delay instance operation typically these are written to a http.Request -*/ -type DelayInstanceParams struct { - - /*Instance - Instance name - - */ - Instance string - /*Service - Service name - - */ - Service string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the delay instance params -func (o *DelayInstanceParams) WithTimeout(timeout time.Duration) *DelayInstanceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delay instance params -func (o *DelayInstanceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delay instance params -func (o *DelayInstanceParams) WithContext(ctx context.Context) *DelayInstanceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delay instance params -func (o *DelayInstanceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delay instance params -func (o *DelayInstanceParams) WithHTTPClient(client *http.Client) *DelayInstanceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delay instance params -func (o *DelayInstanceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithInstance adds the instance to the delay instance params -func (o *DelayInstanceParams) WithInstance(instance string) *DelayInstanceParams { - o.SetInstance(instance) - return o -} - -// SetInstance adds the instance to the delay instance params -func (o *DelayInstanceParams) SetInstance(instance string) { - o.Instance = instance -} - -// WithService adds the service to the delay instance params -func (o *DelayInstanceParams) WithService(service string) *DelayInstanceParams { - o.SetService(service) - return o -} - -// SetService adds the service to the delay instance params -func (o *DelayInstanceParams) SetService(service string) { - o.Service = service -} - -// WriteToRequest writes these params to a swagger request -func (o *DelayInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param instance - if err := r.SetPathParam("instance", o.Instance); err != nil { - return err - } - - // path param service - if err := r.SetPathParam("service", o.Service); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/client/service/delay_instance_responses.go b/pkg/paasta_api/client/service/delay_instance_responses.go deleted file mode 100644 index eb5d10a..0000000 --- a/pkg/paasta_api/client/service/delay_instance_responses.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" -) - -// DelayInstanceReader is a Reader for the DelayInstance structure. -type DelayInstanceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DelayInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDelayInstanceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 204: - result := NewDelayInstanceNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewDelayInstanceNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDelayInstanceInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewDelayInstanceOK creates a DelayInstanceOK with default headers values -func NewDelayInstanceOK() *DelayInstanceOK { - return &DelayInstanceOK{} -} - -/*DelayInstanceOK handles this case with default header values. - -The service is delayed for these possible reasons -*/ -type DelayInstanceOK struct { - Payload models.InstanceDelay -} - -func (o *DelayInstanceOK) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/delay][%d] delayInstanceOK %+v", 200, o.Payload) -} - -func (o *DelayInstanceOK) GetPayload() models.InstanceDelay { - return o.Payload -} - -func (o *DelayInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDelayInstanceNoContent creates a DelayInstanceNoContent with default headers values -func NewDelayInstanceNoContent() *DelayInstanceNoContent { - return &DelayInstanceNoContent{} -} - -/*DelayInstanceNoContent handles this case with default header values. - -Could not find any reasons for a delay -*/ -type DelayInstanceNoContent struct { -} - -func (o *DelayInstanceNoContent) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/delay][%d] delayInstanceNoContent ", 204) -} - -func (o *DelayInstanceNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDelayInstanceNotFound creates a DelayInstanceNotFound with default headers values -func NewDelayInstanceNotFound() *DelayInstanceNotFound { - return &DelayInstanceNotFound{} -} - -/*DelayInstanceNotFound handles this case with default header values. - -Deployment key not found -*/ -type DelayInstanceNotFound struct { -} - -func (o *DelayInstanceNotFound) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/delay][%d] delayInstanceNotFound ", 404) -} - -func (o *DelayInstanceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDelayInstanceInternalServerError creates a DelayInstanceInternalServerError with default headers values -func NewDelayInstanceInternalServerError() *DelayInstanceInternalServerError { - return &DelayInstanceInternalServerError{} -} - -/*DelayInstanceInternalServerError handles this case with default header values. - -Instance failure -*/ -type DelayInstanceInternalServerError struct { -} - -func (o *DelayInstanceInternalServerError) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/delay][%d] delayInstanceInternalServerError ", 500) -} - -func (o *DelayInstanceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paasta_api/client/service/instance_set_state_parameters.go b/pkg/paasta_api/client/service/instance_set_state_parameters.go deleted file mode 100644 index 3359d4e..0000000 --- a/pkg/paasta_api/client/service/instance_set_state_parameters.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewInstanceSetStateParams creates a new InstanceSetStateParams object -// with the default values initialized. -func NewInstanceSetStateParams() *InstanceSetStateParams { - var () - return &InstanceSetStateParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewInstanceSetStateParamsWithTimeout creates a new InstanceSetStateParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewInstanceSetStateParamsWithTimeout(timeout time.Duration) *InstanceSetStateParams { - var () - return &InstanceSetStateParams{ - - timeout: timeout, - } -} - -// NewInstanceSetStateParamsWithContext creates a new InstanceSetStateParams object -// with the default values initialized, and the ability to set a context for a request -func NewInstanceSetStateParamsWithContext(ctx context.Context) *InstanceSetStateParams { - var () - return &InstanceSetStateParams{ - - Context: ctx, - } -} - -// NewInstanceSetStateParamsWithHTTPClient creates a new InstanceSetStateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewInstanceSetStateParamsWithHTTPClient(client *http.Client) *InstanceSetStateParams { - var () - return &InstanceSetStateParams{ - HTTPClient: client, - } -} - -/*InstanceSetStateParams contains all the parameters to send to the API endpoint -for the instance set state operation typically these are written to a http.Request -*/ -type InstanceSetStateParams struct { - - /*DesiredState - Desired state - - */ - DesiredState string - /*Instance - Instance name - - */ - Instance string - /*Service - Service name - - */ - Service string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the instance set state params -func (o *InstanceSetStateParams) WithTimeout(timeout time.Duration) *InstanceSetStateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the instance set state params -func (o *InstanceSetStateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the instance set state params -func (o *InstanceSetStateParams) WithContext(ctx context.Context) *InstanceSetStateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the instance set state params -func (o *InstanceSetStateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the instance set state params -func (o *InstanceSetStateParams) WithHTTPClient(client *http.Client) *InstanceSetStateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the instance set state params -func (o *InstanceSetStateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithDesiredState adds the desiredState to the instance set state params -func (o *InstanceSetStateParams) WithDesiredState(desiredState string) *InstanceSetStateParams { - o.SetDesiredState(desiredState) - return o -} - -// SetDesiredState adds the desiredState to the instance set state params -func (o *InstanceSetStateParams) SetDesiredState(desiredState string) { - o.DesiredState = desiredState -} - -// WithInstance adds the instance to the instance set state params -func (o *InstanceSetStateParams) WithInstance(instance string) *InstanceSetStateParams { - o.SetInstance(instance) - return o -} - -// SetInstance adds the instance to the instance set state params -func (o *InstanceSetStateParams) SetInstance(instance string) { - o.Instance = instance -} - -// WithService adds the service to the instance set state params -func (o *InstanceSetStateParams) WithService(service string) *InstanceSetStateParams { - o.SetService(service) - return o -} - -// SetService adds the service to the instance set state params -func (o *InstanceSetStateParams) SetService(service string) { - o.Service = service -} - -// WriteToRequest writes these params to a swagger request -func (o *InstanceSetStateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param desired_state - if err := r.SetPathParam("desired_state", o.DesiredState); err != nil { - return err - } - - // path param instance - if err := r.SetPathParam("instance", o.Instance); err != nil { - return err - } - - // path param service - if err := r.SetPathParam("service", o.Service); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/client/service/instance_set_state_responses.go b/pkg/paasta_api/client/service/instance_set_state_responses.go deleted file mode 100644 index d5a8496..0000000 --- a/pkg/paasta_api/client/service/instance_set_state_responses.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// InstanceSetStateReader is a Reader for the InstanceSetState structure. -type InstanceSetStateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InstanceSetStateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewInstanceSetStateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewInstanceSetStateNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewInstanceSetStateInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewInstanceSetStateOK creates a InstanceSetStateOK with default headers values -func NewInstanceSetStateOK() *InstanceSetStateOK { - return &InstanceSetStateOK{} -} - -/*InstanceSetStateOK handles this case with default header values. - -Result of instance state change -*/ -type InstanceSetStateOK struct { -} - -func (o *InstanceSetStateOK) Error() string { - return fmt.Sprintf("[POST /services/{service}/{instance}/state/{desired_state}][%d] instanceSetStateOK ", 200) -} - -func (o *InstanceSetStateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewInstanceSetStateNotFound creates a InstanceSetStateNotFound with default headers values -func NewInstanceSetStateNotFound() *InstanceSetStateNotFound { - return &InstanceSetStateNotFound{} -} - -/*InstanceSetStateNotFound handles this case with default header values. - -Deployment key not found -*/ -type InstanceSetStateNotFound struct { -} - -func (o *InstanceSetStateNotFound) Error() string { - return fmt.Sprintf("[POST /services/{service}/{instance}/state/{desired_state}][%d] instanceSetStateNotFound ", 404) -} - -func (o *InstanceSetStateNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewInstanceSetStateInternalServerError creates a InstanceSetStateInternalServerError with default headers values -func NewInstanceSetStateInternalServerError() *InstanceSetStateInternalServerError { - return &InstanceSetStateInternalServerError{} -} - -/*InstanceSetStateInternalServerError handles this case with default header values. - -Instance failure -*/ -type InstanceSetStateInternalServerError struct { -} - -func (o *InstanceSetStateInternalServerError) Error() string { - return fmt.Sprintf("[POST /services/{service}/{instance}/state/{desired_state}][%d] instanceSetStateInternalServerError ", 500) -} - -func (o *InstanceSetStateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paasta_api/client/service/list_instances_parameters.go b/pkg/paasta_api/client/service/list_instances_parameters.go deleted file mode 100644 index e36e755..0000000 --- a/pkg/paasta_api/client/service/list_instances_parameters.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListInstancesParams creates a new ListInstancesParams object -// with the default values initialized. -func NewListInstancesParams() *ListInstancesParams { - var () - return &ListInstancesParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewListInstancesParamsWithTimeout creates a new ListInstancesParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewListInstancesParamsWithTimeout(timeout time.Duration) *ListInstancesParams { - var () - return &ListInstancesParams{ - - timeout: timeout, - } -} - -// NewListInstancesParamsWithContext creates a new ListInstancesParams object -// with the default values initialized, and the ability to set a context for a request -func NewListInstancesParamsWithContext(ctx context.Context) *ListInstancesParams { - var () - return &ListInstancesParams{ - - Context: ctx, - } -} - -// NewListInstancesParamsWithHTTPClient creates a new ListInstancesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewListInstancesParamsWithHTTPClient(client *http.Client) *ListInstancesParams { - var () - return &ListInstancesParams{ - HTTPClient: client, - } -} - -/*ListInstancesParams contains all the parameters to send to the API endpoint -for the list instances operation typically these are written to a http.Request -*/ -type ListInstancesParams struct { - - /*Service - Service name - - */ - Service string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the list instances params -func (o *ListInstancesParams) WithTimeout(timeout time.Duration) *ListInstancesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list instances params -func (o *ListInstancesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list instances params -func (o *ListInstancesParams) WithContext(ctx context.Context) *ListInstancesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list instances params -func (o *ListInstancesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list instances params -func (o *ListInstancesParams) WithHTTPClient(client *http.Client) *ListInstancesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list instances params -func (o *ListInstancesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithService adds the service to the list instances params -func (o *ListInstancesParams) WithService(service string) *ListInstancesParams { - o.SetService(service) - return o -} - -// SetService adds the service to the list instances params -func (o *ListInstancesParams) SetService(service string) { - o.Service = service -} - -// WriteToRequest writes these params to a swagger request -func (o *ListInstancesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param service - if err := r.SetPathParam("service", o.Service); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/client/service/list_instances_responses.go b/pkg/paasta_api/client/service/list_instances_responses.go deleted file mode 100644 index 0ca8f18..0000000 --- a/pkg/paasta_api/client/service/list_instances_responses.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ListInstancesReader is a Reader for the ListInstances structure. -type ListInstancesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListInstancesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListInstancesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewListInstancesOK creates a ListInstancesOK with default headers values -func NewListInstancesOK() *ListInstancesOK { - return &ListInstancesOK{} -} - -/*ListInstancesOK handles this case with default header values. - -Instances of a service -*/ -type ListInstancesOK struct { - Payload *ListInstancesOKBody -} - -func (o *ListInstancesOK) Error() string { - return fmt.Sprintf("[GET /services/{service}][%d] listInstancesOK %+v", 200, o.Payload) -} - -func (o *ListInstancesOK) GetPayload() *ListInstancesOKBody { - return o.Payload -} - -func (o *ListInstancesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(ListInstancesOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/*ListInstancesOKBody list instances o k body -swagger:model ListInstancesOKBody -*/ -type ListInstancesOKBody struct { - - // instances - Instances []string `json:"instances"` -} - -// Validate validates this list instances o k body -func (o *ListInstancesOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListInstancesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListInstancesOKBody) UnmarshalBinary(b []byte) error { - var res ListInstancesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/paasta_api/client/service/list_services_for_cluster_parameters.go b/pkg/paasta_api/client/service/list_services_for_cluster_parameters.go deleted file mode 100644 index d2c6416..0000000 --- a/pkg/paasta_api/client/service/list_services_for_cluster_parameters.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListServicesForClusterParams creates a new ListServicesForClusterParams object -// with the default values initialized. -func NewListServicesForClusterParams() *ListServicesForClusterParams { - - return &ListServicesForClusterParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewListServicesForClusterParamsWithTimeout creates a new ListServicesForClusterParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewListServicesForClusterParamsWithTimeout(timeout time.Duration) *ListServicesForClusterParams { - - return &ListServicesForClusterParams{ - - timeout: timeout, - } -} - -// NewListServicesForClusterParamsWithContext creates a new ListServicesForClusterParams object -// with the default values initialized, and the ability to set a context for a request -func NewListServicesForClusterParamsWithContext(ctx context.Context) *ListServicesForClusterParams { - - return &ListServicesForClusterParams{ - - Context: ctx, - } -} - -// NewListServicesForClusterParamsWithHTTPClient creates a new ListServicesForClusterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewListServicesForClusterParamsWithHTTPClient(client *http.Client) *ListServicesForClusterParams { - - return &ListServicesForClusterParams{ - HTTPClient: client, - } -} - -/*ListServicesForClusterParams contains all the parameters to send to the API endpoint -for the list services for cluster operation typically these are written to a http.Request -*/ -type ListServicesForClusterParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the list services for cluster params -func (o *ListServicesForClusterParams) WithTimeout(timeout time.Duration) *ListServicesForClusterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list services for cluster params -func (o *ListServicesForClusterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list services for cluster params -func (o *ListServicesForClusterParams) WithContext(ctx context.Context) *ListServicesForClusterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list services for cluster params -func (o *ListServicesForClusterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list services for cluster params -func (o *ListServicesForClusterParams) WithHTTPClient(client *http.Client) *ListServicesForClusterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list services for cluster params -func (o *ListServicesForClusterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServicesForClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/client/service/list_services_for_cluster_responses.go b/pkg/paasta_api/client/service/list_services_for_cluster_responses.go deleted file mode 100644 index d17c09b..0000000 --- a/pkg/paasta_api/client/service/list_services_for_cluster_responses.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ListServicesForClusterReader is a Reader for the ListServicesForCluster structure. -type ListServicesForClusterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServicesForClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServicesForClusterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewListServicesForClusterOK creates a ListServicesForClusterOK with default headers values -func NewListServicesForClusterOK() *ListServicesForClusterOK { - return &ListServicesForClusterOK{} -} - -/*ListServicesForClusterOK handles this case with default header values. - -Services and their instances on the current cluster -*/ -type ListServicesForClusterOK struct { - Payload *ListServicesForClusterOKBody -} - -func (o *ListServicesForClusterOK) Error() string { - return fmt.Sprintf("[GET /services][%d] listServicesForClusterOK %+v", 200, o.Payload) -} - -func (o *ListServicesForClusterOK) GetPayload() *ListServicesForClusterOKBody { - return o.Payload -} - -func (o *ListServicesForClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(ListServicesForClusterOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/*ListServicesForClusterOKBody list services for cluster o k body -swagger:model ListServicesForClusterOKBody -*/ -type ListServicesForClusterOKBody struct { - - // services - Services [][]interface{} `json:"services"` -} - -// Validate validates this list services for cluster o k body -func (o *ListServicesForClusterOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesForClusterOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesForClusterOKBody) UnmarshalBinary(b []byte) error { - var res ListServicesForClusterOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/paasta_api/client/service/service_client.go b/pkg/paasta_api/client/service/service_client.go deleted file mode 100644 index 0edf5a3..0000000 --- a/pkg/paasta_api/client/service/service_client.go +++ /dev/null @@ -1,289 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientService is the interface for Client methods -type ClientService interface { - DelayInstance(params *DelayInstanceParams) (*DelayInstanceOK, *DelayInstanceNoContent, error) - - InstanceSetState(params *InstanceSetStateParams) (*InstanceSetStateOK, error) - - ListInstances(params *ListInstancesParams) (*ListInstancesOK, error) - - ListServicesForCluster(params *ListServicesForClusterParams) (*ListServicesForClusterOK, error) - - StatusInstance(params *StatusInstanceParams) (*StatusInstanceOK, error) - - TaskInstance(params *TaskInstanceParams) (*TaskInstanceOK, error) - - TasksInstance(params *TasksInstanceParams) (*TasksInstanceOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - DelayInstance gets the possible reasons for a deployment delay for a marathon service instance -*/ -func (a *Client) DelayInstance(params *DelayInstanceParams) (*DelayInstanceOK, *DelayInstanceNoContent, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDelayInstanceParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "delay_instance", - Method: "GET", - PathPattern: "/services/{service}/{instance}/delay", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &DelayInstanceReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *DelayInstanceOK: - return value, nil, nil - case *DelayInstanceNoContent: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for service: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - InstanceSetState changes state of service name instance name -*/ -func (a *Client) InstanceSetState(params *InstanceSetStateParams) (*InstanceSetStateOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInstanceSetStateParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "instance_set_state", - Method: "POST", - PathPattern: "/services/{service}/{instance}/state/{desired_state}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &InstanceSetStateReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*InstanceSetStateOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for instance_set_state: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListInstances lists instances of service name -*/ -func (a *Client) ListInstances(params *ListInstancesParams) (*ListInstancesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListInstancesParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "list_instances", - Method: "GET", - PathPattern: "/services/{service}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ListInstancesReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*ListInstancesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for list_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServicesForCluster lists service names and service instance names on the current cluster -*/ -func (a *Client) ListServicesForCluster(params *ListServicesForClusterParams) (*ListServicesForClusterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServicesForClusterParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "list_services_for_cluster", - Method: "GET", - PathPattern: "/services", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ListServicesForClusterReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*ListServicesForClusterOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for list_services_for_cluster: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - StatusInstance gets status of service name instance name -*/ -func (a *Client) StatusInstance(params *StatusInstanceParams) (*StatusInstanceOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewStatusInstanceParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "status_instance", - Method: "GET", - PathPattern: "/services/{service}/{instance}/status", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &StatusInstanceReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*StatusInstanceOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for status_instance: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - TaskInstance gets mesos task of service name instance name by task id -*/ -func (a *Client) TaskInstance(params *TaskInstanceParams) (*TaskInstanceOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewTaskInstanceParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "task_instance", - Method: "GET", - PathPattern: "/services/{service}/{instance}/tasks/{task_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &TaskInstanceReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*TaskInstanceOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for task_instance: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - TasksInstance gets mesos tasks of service name instance name -*/ -func (a *Client) TasksInstance(params *TasksInstanceParams) (*TasksInstanceOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewTasksInstanceParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "tasks_instance", - Method: "GET", - PathPattern: "/services/{service}/{instance}/tasks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &TasksInstanceReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*TasksInstanceOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for tasks_instance: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/paasta_api/client/service/status_instance_parameters.go b/pkg/paasta_api/client/service/status_instance_parameters.go deleted file mode 100644 index c20547d..0000000 --- a/pkg/paasta_api/client/service/status_instance_parameters.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewStatusInstanceParams creates a new StatusInstanceParams object -// with the default values initialized. -func NewStatusInstanceParams() *StatusInstanceParams { - var () - return &StatusInstanceParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewStatusInstanceParamsWithTimeout creates a new StatusInstanceParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewStatusInstanceParamsWithTimeout(timeout time.Duration) *StatusInstanceParams { - var () - return &StatusInstanceParams{ - - timeout: timeout, - } -} - -// NewStatusInstanceParamsWithContext creates a new StatusInstanceParams object -// with the default values initialized, and the ability to set a context for a request -func NewStatusInstanceParamsWithContext(ctx context.Context) *StatusInstanceParams { - var () - return &StatusInstanceParams{ - - Context: ctx, - } -} - -// NewStatusInstanceParamsWithHTTPClient creates a new StatusInstanceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewStatusInstanceParamsWithHTTPClient(client *http.Client) *StatusInstanceParams { - var () - return &StatusInstanceParams{ - HTTPClient: client, - } -} - -/*StatusInstanceParams contains all the parameters to send to the API endpoint -for the status instance operation typically these are written to a http.Request -*/ -type StatusInstanceParams struct { - - /*IncludeEnvoy - Include Envoy information - - */ - IncludeEnvoy *bool - /*IncludeMesos - Include Mesos information - - */ - IncludeMesos *bool - /*IncludeSmartstack - Include Smartstack information - - */ - IncludeSmartstack *bool - /*Instance - Instance name - - */ - Instance string - /*Service - Service name - - */ - Service string - /*Verbose - Include verbose status information - - */ - Verbose *int32 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the status instance params -func (o *StatusInstanceParams) WithTimeout(timeout time.Duration) *StatusInstanceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the status instance params -func (o *StatusInstanceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the status instance params -func (o *StatusInstanceParams) WithContext(ctx context.Context) *StatusInstanceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the status instance params -func (o *StatusInstanceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the status instance params -func (o *StatusInstanceParams) WithHTTPClient(client *http.Client) *StatusInstanceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the status instance params -func (o *StatusInstanceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIncludeEnvoy adds the includeEnvoy to the status instance params -func (o *StatusInstanceParams) WithIncludeEnvoy(includeEnvoy *bool) *StatusInstanceParams { - o.SetIncludeEnvoy(includeEnvoy) - return o -} - -// SetIncludeEnvoy adds the includeEnvoy to the status instance params -func (o *StatusInstanceParams) SetIncludeEnvoy(includeEnvoy *bool) { - o.IncludeEnvoy = includeEnvoy -} - -// WithIncludeMesos adds the includeMesos to the status instance params -func (o *StatusInstanceParams) WithIncludeMesos(includeMesos *bool) *StatusInstanceParams { - o.SetIncludeMesos(includeMesos) - return o -} - -// SetIncludeMesos adds the includeMesos to the status instance params -func (o *StatusInstanceParams) SetIncludeMesos(includeMesos *bool) { - o.IncludeMesos = includeMesos -} - -// WithIncludeSmartstack adds the includeSmartstack to the status instance params -func (o *StatusInstanceParams) WithIncludeSmartstack(includeSmartstack *bool) *StatusInstanceParams { - o.SetIncludeSmartstack(includeSmartstack) - return o -} - -// SetIncludeSmartstack adds the includeSmartstack to the status instance params -func (o *StatusInstanceParams) SetIncludeSmartstack(includeSmartstack *bool) { - o.IncludeSmartstack = includeSmartstack -} - -// WithInstance adds the instance to the status instance params -func (o *StatusInstanceParams) WithInstance(instance string) *StatusInstanceParams { - o.SetInstance(instance) - return o -} - -// SetInstance adds the instance to the status instance params -func (o *StatusInstanceParams) SetInstance(instance string) { - o.Instance = instance -} - -// WithService adds the service to the status instance params -func (o *StatusInstanceParams) WithService(service string) *StatusInstanceParams { - o.SetService(service) - return o -} - -// SetService adds the service to the status instance params -func (o *StatusInstanceParams) SetService(service string) { - o.Service = service -} - -// WithVerbose adds the verbose to the status instance params -func (o *StatusInstanceParams) WithVerbose(verbose *int32) *StatusInstanceParams { - o.SetVerbose(verbose) - return o -} - -// SetVerbose adds the verbose to the status instance params -func (o *StatusInstanceParams) SetVerbose(verbose *int32) { - o.Verbose = verbose -} - -// WriteToRequest writes these params to a swagger request -func (o *StatusInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.IncludeEnvoy != nil { - - // query param include_envoy - var qrIncludeEnvoy bool - if o.IncludeEnvoy != nil { - qrIncludeEnvoy = *o.IncludeEnvoy - } - qIncludeEnvoy := swag.FormatBool(qrIncludeEnvoy) - if qIncludeEnvoy != "" { - if err := r.SetQueryParam("include_envoy", qIncludeEnvoy); err != nil { - return err - } - } - - } - - if o.IncludeMesos != nil { - - // query param include_mesos - var qrIncludeMesos bool - if o.IncludeMesos != nil { - qrIncludeMesos = *o.IncludeMesos - } - qIncludeMesos := swag.FormatBool(qrIncludeMesos) - if qIncludeMesos != "" { - if err := r.SetQueryParam("include_mesos", qIncludeMesos); err != nil { - return err - } - } - - } - - if o.IncludeSmartstack != nil { - - // query param include_smartstack - var qrIncludeSmartstack bool - if o.IncludeSmartstack != nil { - qrIncludeSmartstack = *o.IncludeSmartstack - } - qIncludeSmartstack := swag.FormatBool(qrIncludeSmartstack) - if qIncludeSmartstack != "" { - if err := r.SetQueryParam("include_smartstack", qIncludeSmartstack); err != nil { - return err - } - } - - } - - // path param instance - if err := r.SetPathParam("instance", o.Instance); err != nil { - return err - } - - // path param service - if err := r.SetPathParam("service", o.Service); err != nil { - return err - } - - if o.Verbose != nil { - - // query param verbose - var qrVerbose int32 - if o.Verbose != nil { - qrVerbose = *o.Verbose - } - qVerbose := swag.FormatInt32(qrVerbose) - if qVerbose != "" { - if err := r.SetQueryParam("verbose", qVerbose); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/client/service/status_instance_responses.go b/pkg/paasta_api/client/service/status_instance_responses.go deleted file mode 100644 index bd4acb7..0000000 --- a/pkg/paasta_api/client/service/status_instance_responses.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" -) - -// StatusInstanceReader is a Reader for the StatusInstance structure. -type StatusInstanceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *StatusInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewStatusInstanceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewStatusInstanceNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewStatusInstanceInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewStatusInstanceOK creates a StatusInstanceOK with default headers values -func NewStatusInstanceOK() *StatusInstanceOK { - return &StatusInstanceOK{} -} - -/*StatusInstanceOK handles this case with default header values. - -Detailed status of an instance -*/ -type StatusInstanceOK struct { - Payload *models.InstanceStatus -} - -func (o *StatusInstanceOK) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/status][%d] statusInstanceOK %+v", 200, o.Payload) -} - -func (o *StatusInstanceOK) GetPayload() *models.InstanceStatus { - return o.Payload -} - -func (o *StatusInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.InstanceStatus) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStatusInstanceNotFound creates a StatusInstanceNotFound with default headers values -func NewStatusInstanceNotFound() *StatusInstanceNotFound { - return &StatusInstanceNotFound{} -} - -/*StatusInstanceNotFound handles this case with default header values. - -Deployment key not found -*/ -type StatusInstanceNotFound struct { -} - -func (o *StatusInstanceNotFound) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/status][%d] statusInstanceNotFound ", 404) -} - -func (o *StatusInstanceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewStatusInstanceInternalServerError creates a StatusInstanceInternalServerError with default headers values -func NewStatusInstanceInternalServerError() *StatusInstanceInternalServerError { - return &StatusInstanceInternalServerError{} -} - -/*StatusInstanceInternalServerError handles this case with default header values. - -Instance failure -*/ -type StatusInstanceInternalServerError struct { -} - -func (o *StatusInstanceInternalServerError) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/status][%d] statusInstanceInternalServerError ", 500) -} - -func (o *StatusInstanceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paasta_api/client/service/task_instance_parameters.go b/pkg/paasta_api/client/service/task_instance_parameters.go deleted file mode 100644 index 9cada39..0000000 --- a/pkg/paasta_api/client/service/task_instance_parameters.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewTaskInstanceParams creates a new TaskInstanceParams object -// with the default values initialized. -func NewTaskInstanceParams() *TaskInstanceParams { - var () - return &TaskInstanceParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewTaskInstanceParamsWithTimeout creates a new TaskInstanceParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewTaskInstanceParamsWithTimeout(timeout time.Duration) *TaskInstanceParams { - var () - return &TaskInstanceParams{ - - timeout: timeout, - } -} - -// NewTaskInstanceParamsWithContext creates a new TaskInstanceParams object -// with the default values initialized, and the ability to set a context for a request -func NewTaskInstanceParamsWithContext(ctx context.Context) *TaskInstanceParams { - var () - return &TaskInstanceParams{ - - Context: ctx, - } -} - -// NewTaskInstanceParamsWithHTTPClient creates a new TaskInstanceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewTaskInstanceParamsWithHTTPClient(client *http.Client) *TaskInstanceParams { - var () - return &TaskInstanceParams{ - HTTPClient: client, - } -} - -/*TaskInstanceParams contains all the parameters to send to the API endpoint -for the task instance operation typically these are written to a http.Request -*/ -type TaskInstanceParams struct { - - /*Instance - Instance name - - */ - Instance string - /*Service - Service name - - */ - Service string - /*TaskID - mesos task id - - */ - TaskID string - /*Verbose - Return slave and executor for task - - */ - Verbose *bool - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the task instance params -func (o *TaskInstanceParams) WithTimeout(timeout time.Duration) *TaskInstanceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the task instance params -func (o *TaskInstanceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the task instance params -func (o *TaskInstanceParams) WithContext(ctx context.Context) *TaskInstanceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the task instance params -func (o *TaskInstanceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the task instance params -func (o *TaskInstanceParams) WithHTTPClient(client *http.Client) *TaskInstanceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the task instance params -func (o *TaskInstanceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithInstance adds the instance to the task instance params -func (o *TaskInstanceParams) WithInstance(instance string) *TaskInstanceParams { - o.SetInstance(instance) - return o -} - -// SetInstance adds the instance to the task instance params -func (o *TaskInstanceParams) SetInstance(instance string) { - o.Instance = instance -} - -// WithService adds the service to the task instance params -func (o *TaskInstanceParams) WithService(service string) *TaskInstanceParams { - o.SetService(service) - return o -} - -// SetService adds the service to the task instance params -func (o *TaskInstanceParams) SetService(service string) { - o.Service = service -} - -// WithTaskID adds the taskID to the task instance params -func (o *TaskInstanceParams) WithTaskID(taskID string) *TaskInstanceParams { - o.SetTaskID(taskID) - return o -} - -// SetTaskID adds the taskId to the task instance params -func (o *TaskInstanceParams) SetTaskID(taskID string) { - o.TaskID = taskID -} - -// WithVerbose adds the verbose to the task instance params -func (o *TaskInstanceParams) WithVerbose(verbose *bool) *TaskInstanceParams { - o.SetVerbose(verbose) - return o -} - -// SetVerbose adds the verbose to the task instance params -func (o *TaskInstanceParams) SetVerbose(verbose *bool) { - o.Verbose = verbose -} - -// WriteToRequest writes these params to a swagger request -func (o *TaskInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param instance - if err := r.SetPathParam("instance", o.Instance); err != nil { - return err - } - - // path param service - if err := r.SetPathParam("service", o.Service); err != nil { - return err - } - - // path param task_id - if err := r.SetPathParam("task_id", o.TaskID); err != nil { - return err - } - - if o.Verbose != nil { - - // query param verbose - var qrVerbose bool - if o.Verbose != nil { - qrVerbose = *o.Verbose - } - qVerbose := swag.FormatBool(qrVerbose) - if qVerbose != "" { - if err := r.SetQueryParam("verbose", qVerbose); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/client/service/task_instance_responses.go b/pkg/paasta_api/client/service/task_instance_responses.go deleted file mode 100644 index 7c98023..0000000 --- a/pkg/paasta_api/client/service/task_instance_responses.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" -) - -// TaskInstanceReader is a Reader for the TaskInstance structure. -type TaskInstanceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *TaskInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewTaskInstanceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewTaskInstanceBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewTaskInstanceNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewTaskInstanceInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewTaskInstanceOK creates a TaskInstanceOK with default headers values -func NewTaskInstanceOK() *TaskInstanceOK { - return &TaskInstanceOK{} -} - -/*TaskInstanceOK handles this case with default header values. - -Task associated with an instance with specified ID -*/ -type TaskInstanceOK struct { - Payload models.InstanceTask -} - -func (o *TaskInstanceOK) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/tasks/{task_id}][%d] taskInstanceOK %+v", 200, o.Payload) -} - -func (o *TaskInstanceOK) GetPayload() models.InstanceTask { - return o.Payload -} - -func (o *TaskInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewTaskInstanceBadRequest creates a TaskInstanceBadRequest with default headers values -func NewTaskInstanceBadRequest() *TaskInstanceBadRequest { - return &TaskInstanceBadRequest{} -} - -/*TaskInstanceBadRequest handles this case with default header values. - -Bad request -*/ -type TaskInstanceBadRequest struct { -} - -func (o *TaskInstanceBadRequest) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/tasks/{task_id}][%d] taskInstanceBadRequest ", 400) -} - -func (o *TaskInstanceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewTaskInstanceNotFound creates a TaskInstanceNotFound with default headers values -func NewTaskInstanceNotFound() *TaskInstanceNotFound { - return &TaskInstanceNotFound{} -} - -/*TaskInstanceNotFound handles this case with default header values. - -Task with ID not found -*/ -type TaskInstanceNotFound struct { -} - -func (o *TaskInstanceNotFound) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/tasks/{task_id}][%d] taskInstanceNotFound ", 404) -} - -func (o *TaskInstanceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewTaskInstanceInternalServerError creates a TaskInstanceInternalServerError with default headers values -func NewTaskInstanceInternalServerError() *TaskInstanceInternalServerError { - return &TaskInstanceInternalServerError{} -} - -/*TaskInstanceInternalServerError handles this case with default header values. - -Instance failure -*/ -type TaskInstanceInternalServerError struct { -} - -func (o *TaskInstanceInternalServerError) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/tasks/{task_id}][%d] taskInstanceInternalServerError ", 500) -} - -func (o *TaskInstanceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paasta_api/client/service/tasks_instance_parameters.go b/pkg/paasta_api/client/service/tasks_instance_parameters.go deleted file mode 100644 index fbb920f..0000000 --- a/pkg/paasta_api/client/service/tasks_instance_parameters.go +++ /dev/null @@ -1,221 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewTasksInstanceParams creates a new TasksInstanceParams object -// with the default values initialized. -func NewTasksInstanceParams() *TasksInstanceParams { - var () - return &TasksInstanceParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewTasksInstanceParamsWithTimeout creates a new TasksInstanceParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewTasksInstanceParamsWithTimeout(timeout time.Duration) *TasksInstanceParams { - var () - return &TasksInstanceParams{ - - timeout: timeout, - } -} - -// NewTasksInstanceParamsWithContext creates a new TasksInstanceParams object -// with the default values initialized, and the ability to set a context for a request -func NewTasksInstanceParamsWithContext(ctx context.Context) *TasksInstanceParams { - var () - return &TasksInstanceParams{ - - Context: ctx, - } -} - -// NewTasksInstanceParamsWithHTTPClient creates a new TasksInstanceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewTasksInstanceParamsWithHTTPClient(client *http.Client) *TasksInstanceParams { - var () - return &TasksInstanceParams{ - HTTPClient: client, - } -} - -/*TasksInstanceParams contains all the parameters to send to the API endpoint -for the tasks instance operation typically these are written to a http.Request -*/ -type TasksInstanceParams struct { - - /*Instance - Instance name - - */ - Instance string - /*Service - Service name - - */ - Service string - /*SlaveHostname - slave hostname to filter tasks by - - */ - SlaveHostname *string - /*Verbose - Return slave and executor for task - - */ - Verbose *bool - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the tasks instance params -func (o *TasksInstanceParams) WithTimeout(timeout time.Duration) *TasksInstanceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the tasks instance params -func (o *TasksInstanceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the tasks instance params -func (o *TasksInstanceParams) WithContext(ctx context.Context) *TasksInstanceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the tasks instance params -func (o *TasksInstanceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the tasks instance params -func (o *TasksInstanceParams) WithHTTPClient(client *http.Client) *TasksInstanceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the tasks instance params -func (o *TasksInstanceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithInstance adds the instance to the tasks instance params -func (o *TasksInstanceParams) WithInstance(instance string) *TasksInstanceParams { - o.SetInstance(instance) - return o -} - -// SetInstance adds the instance to the tasks instance params -func (o *TasksInstanceParams) SetInstance(instance string) { - o.Instance = instance -} - -// WithService adds the service to the tasks instance params -func (o *TasksInstanceParams) WithService(service string) *TasksInstanceParams { - o.SetService(service) - return o -} - -// SetService adds the service to the tasks instance params -func (o *TasksInstanceParams) SetService(service string) { - o.Service = service -} - -// WithSlaveHostname adds the slaveHostname to the tasks instance params -func (o *TasksInstanceParams) WithSlaveHostname(slaveHostname *string) *TasksInstanceParams { - o.SetSlaveHostname(slaveHostname) - return o -} - -// SetSlaveHostname adds the slaveHostname to the tasks instance params -func (o *TasksInstanceParams) SetSlaveHostname(slaveHostname *string) { - o.SlaveHostname = slaveHostname -} - -// WithVerbose adds the verbose to the tasks instance params -func (o *TasksInstanceParams) WithVerbose(verbose *bool) *TasksInstanceParams { - o.SetVerbose(verbose) - return o -} - -// SetVerbose adds the verbose to the tasks instance params -func (o *TasksInstanceParams) SetVerbose(verbose *bool) { - o.Verbose = verbose -} - -// WriteToRequest writes these params to a swagger request -func (o *TasksInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param instance - if err := r.SetPathParam("instance", o.Instance); err != nil { - return err - } - - // path param service - if err := r.SetPathParam("service", o.Service); err != nil { - return err - } - - if o.SlaveHostname != nil { - - // query param slave_hostname - var qrSlaveHostname string - if o.SlaveHostname != nil { - qrSlaveHostname = *o.SlaveHostname - } - qSlaveHostname := qrSlaveHostname - if qSlaveHostname != "" { - if err := r.SetQueryParam("slave_hostname", qSlaveHostname); err != nil { - return err - } - } - - } - - if o.Verbose != nil { - - // query param verbose - var qrVerbose bool - if o.Verbose != nil { - qrVerbose = *o.Verbose - } - qVerbose := swag.FormatBool(qrVerbose) - if qVerbose != "" { - if err := r.SetQueryParam("verbose", qVerbose); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/client/service/tasks_instance_responses.go b/pkg/paasta_api/client/service/tasks_instance_responses.go deleted file mode 100644 index aaacc5a..0000000 --- a/pkg/paasta_api/client/service/tasks_instance_responses.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paasta_api/models" -) - -// TasksInstanceReader is a Reader for the TasksInstance structure. -type TasksInstanceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *TasksInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewTasksInstanceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewTasksInstanceBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewTasksInstanceNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewTasksInstanceInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewTasksInstanceOK creates a TasksInstanceOK with default headers values -func NewTasksInstanceOK() *TasksInstanceOK { - return &TasksInstanceOK{} -} - -/*TasksInstanceOK handles this case with default header values. - -List of tasks associated with an instance -*/ -type TasksInstanceOK struct { - Payload models.InstanceTasks -} - -func (o *TasksInstanceOK) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/tasks][%d] tasksInstanceOK %+v", 200, o.Payload) -} - -func (o *TasksInstanceOK) GetPayload() models.InstanceTasks { - return o.Payload -} - -func (o *TasksInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewTasksInstanceBadRequest creates a TasksInstanceBadRequest with default headers values -func NewTasksInstanceBadRequest() *TasksInstanceBadRequest { - return &TasksInstanceBadRequest{} -} - -/*TasksInstanceBadRequest handles this case with default header values. - -Bad request -*/ -type TasksInstanceBadRequest struct { -} - -func (o *TasksInstanceBadRequest) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/tasks][%d] tasksInstanceBadRequest ", 400) -} - -func (o *TasksInstanceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewTasksInstanceNotFound creates a TasksInstanceNotFound with default headers values -func NewTasksInstanceNotFound() *TasksInstanceNotFound { - return &TasksInstanceNotFound{} -} - -/*TasksInstanceNotFound handles this case with default header values. - -Deployment key not found -*/ -type TasksInstanceNotFound struct { -} - -func (o *TasksInstanceNotFound) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/tasks][%d] tasksInstanceNotFound ", 404) -} - -func (o *TasksInstanceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewTasksInstanceInternalServerError creates a TasksInstanceInternalServerError with default headers values -func NewTasksInstanceInternalServerError() *TasksInstanceInternalServerError { - return &TasksInstanceInternalServerError{} -} - -/*TasksInstanceInternalServerError handles this case with default header values. - -Instance failure -*/ -type TasksInstanceInternalServerError struct { -} - -func (o *TasksInstanceInternalServerError) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/tasks][%d] tasksInstanceInternalServerError ", 500) -} - -func (o *TasksInstanceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paasta_api/models/adhoc_launch_history.go b/pkg/paasta_api/models/adhoc_launch_history.go deleted file mode 100644 index eb964a3..0000000 --- a/pkg/paasta_api/models/adhoc_launch_history.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AdhocLaunchHistory A single run -// -// swagger:model AdhocLaunchHistory -type AdhocLaunchHistory struct { - - // framework id - FrameworkID string `json:"framework_id,omitempty"` - - // when the job was launched - LaunchTime string `json:"launch_time,omitempty"` - - // id of the single run - RunID string `json:"run_id,omitempty"` -} - -// Validate validates this adhoc launch history -func (m *AdhocLaunchHistory) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AdhocLaunchHistory) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AdhocLaunchHistory) UnmarshalBinary(b []byte) error { - var res AdhocLaunchHistory - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/deploy_queue.go b/pkg/paasta_api/models/deploy_queue.go deleted file mode 100644 index bb48b42..0000000 --- a/pkg/paasta_api/models/deploy_queue.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DeployQueue Current state of the deployd queue -// -// swagger:model DeployQueue -type DeployQueue struct { - - // Service instances that are ready to be acted on by deployd - AvailableServiceInstances []*DeployQueueServiceInstance `json:"available_service_instances"` - - // Service instances that deployd is waiting to act on - UnavailableServiceInstances []*DeployQueueServiceInstance `json:"unavailable_service_instances"` -} - -// Validate validates this deploy queue -func (m *DeployQueue) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAvailableServiceInstances(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUnavailableServiceInstances(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DeployQueue) validateAvailableServiceInstances(formats strfmt.Registry) error { - - if swag.IsZero(m.AvailableServiceInstances) { // not required - return nil - } - - for i := 0; i < len(m.AvailableServiceInstances); i++ { - if swag.IsZero(m.AvailableServiceInstances[i]) { // not required - continue - } - - if m.AvailableServiceInstances[i] != nil { - if err := m.AvailableServiceInstances[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("available_service_instances" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DeployQueue) validateUnavailableServiceInstances(formats strfmt.Registry) error { - - if swag.IsZero(m.UnavailableServiceInstances) { // not required - return nil - } - - for i := 0; i < len(m.UnavailableServiceInstances); i++ { - if swag.IsZero(m.UnavailableServiceInstances[i]) { // not required - continue - } - - if m.UnavailableServiceInstances[i] != nil { - if err := m.UnavailableServiceInstances[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("unavailable_service_instances" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DeployQueue) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DeployQueue) UnmarshalBinary(b []byte) error { - var res DeployQueue - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/deploy_queue_service_instance.go b/pkg/paasta_api/models/deploy_queue_service_instance.go deleted file mode 100644 index 993a8c5..0000000 --- a/pkg/paasta_api/models/deploy_queue_service_instance.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DeployQueueServiceInstance An instance of a service in the deploy queue -// -// swagger:model DeployQueueServiceInstance -type DeployQueueServiceInstance struct { - - // Desired timestamp by which the service instance should be bounced - BounceBy float32 `json:"bounce_by,omitempty"` - - // Timestamp at which service instance was first added to the queue - BounceStartTime float32 `json:"bounce_start_time,omitempty"` - - // Timestamp at which the service instance was last added to the queue - EnqueueTime float32 `json:"enqueue_time,omitempty"` - - // Number of times deployment actions have failed on this service instance - Failures int32 `json:"failures,omitempty"` - - // Name of the instance of the service - Instance string `json:"instance,omitempty"` - - // Number of times any deployment action has been taken on this service instance - ProcessedCount int32 `json:"processed_count,omitempty"` - - // Name of the service - Service string `json:"service,omitempty"` - - // Timestamp before which no action should be taken on this service instance - WaitUntil float32 `json:"wait_until,omitempty"` - - // The process that enqueued the task - Watcher string `json:"watcher,omitempty"` -} - -// Validate validates this deploy queue service instance -func (m *DeployQueueServiceInstance) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DeployQueueServiceInstance) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DeployQueueServiceInstance) UnmarshalBinary(b []byte) error { - var res DeployQueueServiceInstance - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/envoy_backend.go b/pkg/paasta_api/models/envoy_backend.go deleted file mode 100644 index b22c1bf..0000000 --- a/pkg/paasta_api/models/envoy_backend.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// EnvoyBackend envoy backend -// -// swagger:model EnvoyBackend -type EnvoyBackend struct { - - // Address of the host on which the backend is running - Address string `json:"address,omitempty"` - - // Status of the backend in Envoy as reported by the EDS - EdsHealthStatus string `json:"eds_health_status,omitempty"` - - // Whether this backend has an associated task running - HasAssociatedTask bool `json:"has_associated_task,omitempty"` - - // Name of the host on which the backend is running - Hostname string `json:"hostname,omitempty"` - - // Port number on which the backend responds - PortValue int32 `json:"port_value,omitempty"` - - // The weight of this backend in the cluster - Weight int32 `json:"weight,omitempty"` -} - -// Validate validates this envoy backend -func (m *EnvoyBackend) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *EnvoyBackend) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EnvoyBackend) UnmarshalBinary(b []byte) error { - var res EnvoyBackend - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/envoy_location.go b/pkg/paasta_api/models/envoy_location.go deleted file mode 100644 index ff76861..0000000 --- a/pkg/paasta_api/models/envoy_location.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// EnvoyLocation envoy location -// -// swagger:model EnvoyLocation -type EnvoyLocation struct { - - // Envoy backends running in this location - Backends []*EnvoyBackend `json:"backends"` - - // Whether this backend is proxied through Casper - IsProxiedThroughCasper bool `json:"is_proxied_through_casper,omitempty"` - - // Name of the location - Name string `json:"name,omitempty"` - - // Number of running backends for the service in this location - RunningBackendsCount int32 `json:"running_backends_count,omitempty"` -} - -// Validate validates this envoy location -func (m *EnvoyLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBackends(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EnvoyLocation) validateBackends(formats strfmt.Registry) error { - - if swag.IsZero(m.Backends) { // not required - return nil - } - - for i := 0; i < len(m.Backends); i++ { - if swag.IsZero(m.Backends[i]) { // not required - continue - } - - if m.Backends[i] != nil { - if err := m.Backends[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backends" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EnvoyLocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EnvoyLocation) UnmarshalBinary(b []byte) error { - var res EnvoyLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/envoy_status.go b/pkg/paasta_api/models/envoy_status.go deleted file mode 100644 index b58fae1..0000000 --- a/pkg/paasta_api/models/envoy_status.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// EnvoyStatus envoy status -// -// swagger:model EnvoyStatus -type EnvoyStatus struct { - - // Number of backends expected to be present in each location - ExpectedBackendsPerLocation int32 `json:"expected_backends_per_location,omitempty"` - - // Locations the service is deployed - Locations []*EnvoyLocation `json:"locations"` - - // Registration name of the service in Smartstack - Registration string `json:"registration,omitempty"` -} - -// Validate validates this envoy status -func (m *EnvoyStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLocations(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EnvoyStatus) validateLocations(formats strfmt.Registry) error { - - if swag.IsZero(m.Locations) { // not required - return nil - } - - for i := 0; i < len(m.Locations); i++ { - if swag.IsZero(m.Locations[i]) { // not required - continue - } - - if m.Locations[i] != nil { - if err := m.Locations[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("locations" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EnvoyStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EnvoyStatus) UnmarshalBinary(b []byte) error { - var res EnvoyStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/float_and_error.go b/pkg/paasta_api/models/float_and_error.go deleted file mode 100644 index 659a1d6..0000000 --- a/pkg/paasta_api/models/float_and_error.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// FloatAndError float and error -// -// swagger:model FloatAndError -type FloatAndError struct { - - // error message - ErrorMessage string `json:"error_message,omitempty"` - - // value - Value float32 `json:"value,omitempty"` -} - -// Validate validates this float and error -func (m *FloatAndError) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *FloatAndError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *FloatAndError) UnmarshalBinary(b []byte) error { - var res FloatAndError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/h_p_a_metric.go b/pkg/paasta_api/models/h_p_a_metric.go deleted file mode 100644 index ba03710..0000000 --- a/pkg/paasta_api/models/h_p_a_metric.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// HPAMetric h p a metric -// -// swagger:model HPAMetric -type HPAMetric struct { - - // setpoint/target_value as specified in yelpsoa_configs - CurrentValue string `json:"current_value,omitempty"` - - // name of the metric - Name string `json:"name,omitempty"` - - // setpoint/target_value as specified in yelpsoa_configs - TargetValue string `json:"target_value,omitempty"` -} - -// Validate validates this h p a metric -func (m *HPAMetric) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *HPAMetric) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HPAMetric) UnmarshalBinary(b []byte) error { - var res HPAMetric - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/instance_delay.go b/pkg/paasta_api/models/instance_delay.go deleted file mode 100644 index d30b602..0000000 --- a/pkg/paasta_api/models/instance_delay.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// InstanceDelay instance delay -// -// swagger:model InstanceDelay -type InstanceDelay interface{} diff --git a/pkg/paasta_api/models/instance_metadata_flink.go b/pkg/paasta_api/models/instance_metadata_flink.go deleted file mode 100644 index bbebb83..0000000 --- a/pkg/paasta_api/models/instance_metadata_flink.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// InstanceMetadataFlink Flink instance metadata -// -// swagger:model InstanceMetadataFlink -type InstanceMetadataFlink interface{} diff --git a/pkg/paasta_api/models/instance_metadata_kafka_cluster.go b/pkg/paasta_api/models/instance_metadata_kafka_cluster.go deleted file mode 100644 index 7c2359d..0000000 --- a/pkg/paasta_api/models/instance_metadata_kafka_cluster.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// InstanceMetadataKafkaCluster Kafka instance metadata -// -// swagger:model InstanceMetadataKafkaCluster -type InstanceMetadataKafkaCluster interface{} diff --git a/pkg/paasta_api/models/instance_spec_kafka_cluster.go b/pkg/paasta_api/models/instance_spec_kafka_cluster.go deleted file mode 100644 index 826905b..0000000 --- a/pkg/paasta_api/models/instance_spec_kafka_cluster.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// InstanceSpecKafkaCluster Kafka instance spec -// -// swagger:model InstanceSpecKafkaCluster -type InstanceSpecKafkaCluster interface{} diff --git a/pkg/paasta_api/models/instance_status.go b/pkg/paasta_api/models/instance_status.go deleted file mode 100644 index e3ebe33..0000000 --- a/pkg/paasta_api/models/instance_status.go +++ /dev/null @@ -1,300 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// InstanceStatus instance status -// -// swagger:model InstanceStatus -type InstanceStatus struct { - - // Adhoc instance status - Adhoc InstanceStatusAdhoc `json:"adhoc,omitempty"` - - // flink - Flink *InstanceStatusFlink `json:"flink,omitempty"` - - // Git sha of a service - GitSha string `json:"git_sha,omitempty"` - - // Instance name - Instance string `json:"instance,omitempty"` - - // kafkacluster - Kafkacluster *InstanceStatusKafkacluster `json:"kafkacluster,omitempty"` - - // Kubernetes instance status - Kubernetes *InstanceStatusKubernetes `json:"kubernetes,omitempty"` - - // Marathon instance status - Marathon *InstanceStatusMarathon `json:"marathon,omitempty"` - - // Service name - Service string `json:"service,omitempty"` - - // Tron instance status - Tron *InstanceStatusTron `json:"tron,omitempty"` -} - -// Validate validates this instance status -func (m *InstanceStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAdhoc(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFlink(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKafkacluster(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKubernetes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMarathon(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTron(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InstanceStatus) validateAdhoc(formats strfmt.Registry) error { - - if swag.IsZero(m.Adhoc) { // not required - return nil - } - - if err := m.Adhoc.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("adhoc") - } - return err - } - - return nil -} - -func (m *InstanceStatus) validateFlink(formats strfmt.Registry) error { - - if swag.IsZero(m.Flink) { // not required - return nil - } - - if m.Flink != nil { - if err := m.Flink.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("flink") - } - return err - } - } - - return nil -} - -func (m *InstanceStatus) validateKafkacluster(formats strfmt.Registry) error { - - if swag.IsZero(m.Kafkacluster) { // not required - return nil - } - - if m.Kafkacluster != nil { - if err := m.Kafkacluster.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("kafkacluster") - } - return err - } - } - - return nil -} - -func (m *InstanceStatus) validateKubernetes(formats strfmt.Registry) error { - - if swag.IsZero(m.Kubernetes) { // not required - return nil - } - - if m.Kubernetes != nil { - if err := m.Kubernetes.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("kubernetes") - } - return err - } - } - - return nil -} - -func (m *InstanceStatus) validateMarathon(formats strfmt.Registry) error { - - if swag.IsZero(m.Marathon) { // not required - return nil - } - - if m.Marathon != nil { - if err := m.Marathon.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("marathon") - } - return err - } - } - - return nil -} - -func (m *InstanceStatus) validateTron(formats strfmt.Registry) error { - - if swag.IsZero(m.Tron) { // not required - return nil - } - - if m.Tron != nil { - if err := m.Tron.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tron") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InstanceStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InstanceStatus) UnmarshalBinary(b []byte) error { - var res InstanceStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// InstanceStatusFlink Nullable Flink instance status and metadata -// -// swagger:model InstanceStatusFlink -type InstanceStatusFlink struct { - - // metadata - Metadata InstanceMetadataFlink `json:"metadata,omitempty"` - - // status - Status *InstanceStatusFlink `json:"status,omitempty"` -} - -// Validate validates this instance status flink -func (m *InstanceStatusFlink) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InstanceStatusFlink) validateStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("flink" + "." + "status") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InstanceStatusFlink) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InstanceStatusFlink) UnmarshalBinary(b []byte) error { - var res InstanceStatusFlink - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// InstanceStatusKafkacluster Nullable KafkaCluster instance status and metadata -// -// swagger:model InstanceStatusKafkacluster -type InstanceStatusKafkacluster struct { - - // metadata - Metadata InstanceMetadataKafkaCluster `json:"metadata,omitempty"` - - // status - Status InstanceStatusKafkaCluster `json:"status,omitempty"` -} - -// Validate validates this instance status kafkacluster -func (m *InstanceStatusKafkacluster) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *InstanceStatusKafkacluster) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InstanceStatusKafkacluster) UnmarshalBinary(b []byte) error { - var res InstanceStatusKafkacluster - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/instance_status_adhoc.go b/pkg/paasta_api/models/instance_status_adhoc.go deleted file mode 100644 index 4dd30a9..0000000 --- a/pkg/paasta_api/models/instance_status_adhoc.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// InstanceStatusAdhoc List of runs associated with job -// -// swagger:model InstanceStatusAdhoc -type InstanceStatusAdhoc []*AdhocLaunchHistory - -// Validate validates this instance status adhoc -func (m InstanceStatusAdhoc) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/models/instance_status_flink.go b/pkg/paasta_api/models/instance_status_flink.go deleted file mode 100644 index 08b7608..0000000 --- a/pkg/paasta_api/models/instance_status_flink.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// InstanceStatusFlink Flink instance status -// -// swagger:model InstanceStatusFlink -type _InstanceStatusFlink interface{} diff --git a/pkg/paasta_api/models/instance_status_kafka_cluster.go b/pkg/paasta_api/models/instance_status_kafka_cluster.go deleted file mode 100644 index 1ce0abc..0000000 --- a/pkg/paasta_api/models/instance_status_kafka_cluster.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// InstanceStatusKafkaCluster Kafka instance status -// -// swagger:model InstanceStatusKafkaCluster -type InstanceStatusKafkaCluster interface{} diff --git a/pkg/paasta_api/models/instance_status_kubernetes.go b/pkg/paasta_api/models/instance_status_kubernetes.go deleted file mode 100644 index 8984d28..0000000 --- a/pkg/paasta_api/models/instance_status_kubernetes.go +++ /dev/null @@ -1,456 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// InstanceStatusKubernetes instance status kubernetes -// -// swagger:model InstanceStatusKubernetes -type InstanceStatusKubernetes struct { - - // The number of different running versions of the same service (0 for stopped, 1 for running and 1+ for bouncing) - // Required: true - AppCount *int32 `json:"app_count"` - - // ID of the desired version of a service instance - AppID string `json:"app_id,omitempty"` - - // autoscaling status - AutoscalingStatus *InstanceStatusKubernetesAutoscalingStatus `json:"autoscaling_status,omitempty"` - - // backoff in seconds before launching the next task - BackoffSeconds int32 `json:"backoff_seconds,omitempty"` - - // Method to transit between new and old versions of a service - // Required: true - // Enum: [brutal upthendown downthenup crossover] - BounceMethod *string `json:"bounce_method"` - - // Unix timestamp when this app was created - CreateTimestamp float32 `json:"create_timestamp,omitempty"` - - // Deploy status of a Kubernetes service - // Enum: [Running Deploying Stopped Delayed Waiting NotRunning] - DeployStatus string `json:"deploy_status,omitempty"` - - // Reason for the deploy status - DeployStatusMessage string `json:"deploy_status_message,omitempty"` - - // Desired state of a service, for Kubernetes - // Required: true - // Enum: [start stop] - DesiredState *string `json:"desired_state"` - - // Error message when a kubernetes object (Deployment/Statefulset) cannot be found - ErrorMessage string `json:"error_message,omitempty"` - - // The number of desired instances of the service - ExpectedInstanceCount int32 `json:"expected_instance_count,omitempty"` - - // The namespace this app is running - Namespace string `json:"namespace,omitempty"` - - // Pods associated to this app - Pods []*KubernetesPod `json:"pods"` - - // ReplicaSets associated to this app - Replicasets []*KubernetesReplicaSet `json:"replicasets"` - - // The number of actual running instances of the service - RunningInstanceCount int32 `json:"running_instance_count,omitempty"` - - // Status of the service in smartstack - Smartstack *SmartstackStatus `json:"smartstack,omitempty"` -} - -// Validate validates this instance status kubernetes -func (m *InstanceStatusKubernetes) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAppCount(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAutoscalingStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBounceMethod(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeployStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDesiredState(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePods(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReplicasets(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSmartstack(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InstanceStatusKubernetes) validateAppCount(formats strfmt.Registry) error { - - if err := validate.Required("app_count", "body", m.AppCount); err != nil { - return err - } - - return nil -} - -func (m *InstanceStatusKubernetes) validateAutoscalingStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.AutoscalingStatus) { // not required - return nil - } - - if m.AutoscalingStatus != nil { - if err := m.AutoscalingStatus.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("autoscaling_status") - } - return err - } - } - - return nil -} - -var instanceStatusKubernetesTypeBounceMethodPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["brutal","upthendown","downthenup","crossover"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - instanceStatusKubernetesTypeBounceMethodPropEnum = append(instanceStatusKubernetesTypeBounceMethodPropEnum, v) - } -} - -const ( - - // InstanceStatusKubernetesBounceMethodBrutal captures enum value "brutal" - InstanceStatusKubernetesBounceMethodBrutal string = "brutal" - - // InstanceStatusKubernetesBounceMethodUpthendown captures enum value "upthendown" - InstanceStatusKubernetesBounceMethodUpthendown string = "upthendown" - - // InstanceStatusKubernetesBounceMethodDownthenup captures enum value "downthenup" - InstanceStatusKubernetesBounceMethodDownthenup string = "downthenup" - - // InstanceStatusKubernetesBounceMethodCrossover captures enum value "crossover" - InstanceStatusKubernetesBounceMethodCrossover string = "crossover" -) - -// prop value enum -func (m *InstanceStatusKubernetes) validateBounceMethodEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, instanceStatusKubernetesTypeBounceMethodPropEnum); err != nil { - return err - } - return nil -} - -func (m *InstanceStatusKubernetes) validateBounceMethod(formats strfmt.Registry) error { - - if err := validate.Required("bounce_method", "body", m.BounceMethod); err != nil { - return err - } - - // value enum - if err := m.validateBounceMethodEnum("bounce_method", "body", *m.BounceMethod); err != nil { - return err - } - - return nil -} - -var instanceStatusKubernetesTypeDeployStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["Running","Deploying","Stopped","Delayed","Waiting","NotRunning"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - instanceStatusKubernetesTypeDeployStatusPropEnum = append(instanceStatusKubernetesTypeDeployStatusPropEnum, v) - } -} - -const ( - - // InstanceStatusKubernetesDeployStatusRunning captures enum value "Running" - InstanceStatusKubernetesDeployStatusRunning string = "Running" - - // InstanceStatusKubernetesDeployStatusDeploying captures enum value "Deploying" - InstanceStatusKubernetesDeployStatusDeploying string = "Deploying" - - // InstanceStatusKubernetesDeployStatusStopped captures enum value "Stopped" - InstanceStatusKubernetesDeployStatusStopped string = "Stopped" - - // InstanceStatusKubernetesDeployStatusDelayed captures enum value "Delayed" - InstanceStatusKubernetesDeployStatusDelayed string = "Delayed" - - // InstanceStatusKubernetesDeployStatusWaiting captures enum value "Waiting" - InstanceStatusKubernetesDeployStatusWaiting string = "Waiting" - - // InstanceStatusKubernetesDeployStatusNotRunning captures enum value "NotRunning" - InstanceStatusKubernetesDeployStatusNotRunning string = "NotRunning" -) - -// prop value enum -func (m *InstanceStatusKubernetes) validateDeployStatusEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, instanceStatusKubernetesTypeDeployStatusPropEnum); err != nil { - return err - } - return nil -} - -func (m *InstanceStatusKubernetes) validateDeployStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.DeployStatus) { // not required - return nil - } - - // value enum - if err := m.validateDeployStatusEnum("deploy_status", "body", m.DeployStatus); err != nil { - return err - } - - return nil -} - -var instanceStatusKubernetesTypeDesiredStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["start","stop"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - instanceStatusKubernetesTypeDesiredStatePropEnum = append(instanceStatusKubernetesTypeDesiredStatePropEnum, v) - } -} - -const ( - - // InstanceStatusKubernetesDesiredStateStart captures enum value "start" - InstanceStatusKubernetesDesiredStateStart string = "start" - - // InstanceStatusKubernetesDesiredStateStop captures enum value "stop" - InstanceStatusKubernetesDesiredStateStop string = "stop" -) - -// prop value enum -func (m *InstanceStatusKubernetes) validateDesiredStateEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, instanceStatusKubernetesTypeDesiredStatePropEnum); err != nil { - return err - } - return nil -} - -func (m *InstanceStatusKubernetes) validateDesiredState(formats strfmt.Registry) error { - - if err := validate.Required("desired_state", "body", m.DesiredState); err != nil { - return err - } - - // value enum - if err := m.validateDesiredStateEnum("desired_state", "body", *m.DesiredState); err != nil { - return err - } - - return nil -} - -func (m *InstanceStatusKubernetes) validatePods(formats strfmt.Registry) error { - - if swag.IsZero(m.Pods) { // not required - return nil - } - - for i := 0; i < len(m.Pods); i++ { - if swag.IsZero(m.Pods[i]) { // not required - continue - } - - if m.Pods[i] != nil { - if err := m.Pods[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pods" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *InstanceStatusKubernetes) validateReplicasets(formats strfmt.Registry) error { - - if swag.IsZero(m.Replicasets) { // not required - return nil - } - - for i := 0; i < len(m.Replicasets); i++ { - if swag.IsZero(m.Replicasets[i]) { // not required - continue - } - - if m.Replicasets[i] != nil { - if err := m.Replicasets[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("replicasets" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *InstanceStatusKubernetes) validateSmartstack(formats strfmt.Registry) error { - - if swag.IsZero(m.Smartstack) { // not required - return nil - } - - if m.Smartstack != nil { - if err := m.Smartstack.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("smartstack") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InstanceStatusKubernetes) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InstanceStatusKubernetes) UnmarshalBinary(b []byte) error { - var res InstanceStatusKubernetes - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// InstanceStatusKubernetesAutoscalingStatus HPA associated to this app -// -// swagger:model InstanceStatusKubernetesAutoscalingStatus -type InstanceStatusKubernetesAutoscalingStatus struct { - - // desired number of _instances as calculated by HPA - DesiredReplicas int64 `json:"desired_replicas,omitempty"` - - // timestamp of last autoscale - LastScaleTime string `json:"last_scale_time,omitempty"` - - // min_instances as specified in yelpsoa_configs - MaxInstances int64 `json:"max_instances,omitempty"` - - // Current metrics - Metrics []*HPAMetric `json:"metrics"` - - // min_instances as specified in yelpsoa_configs - MinInstances int64 `json:"min_instances,omitempty"` -} - -// Validate validates this instance status kubernetes autoscaling status -func (m *InstanceStatusKubernetesAutoscalingStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMetrics(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InstanceStatusKubernetesAutoscalingStatus) validateMetrics(formats strfmt.Registry) error { - - if swag.IsZero(m.Metrics) { // not required - return nil - } - - for i := 0; i < len(m.Metrics); i++ { - if swag.IsZero(m.Metrics[i]) { // not required - continue - } - - if m.Metrics[i] != nil { - if err := m.Metrics[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("autoscaling_status" + "." + "metrics" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InstanceStatusKubernetesAutoscalingStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InstanceStatusKubernetesAutoscalingStatus) UnmarshalBinary(b []byte) error { - var res InstanceStatusKubernetesAutoscalingStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/instance_status_marathon.go b/pkg/paasta_api/models/instance_status_marathon.go deleted file mode 100644 index 6ce4f42..0000000 --- a/pkg/paasta_api/models/instance_status_marathon.go +++ /dev/null @@ -1,390 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// InstanceStatusMarathon instance status marathon -// -// swagger:model InstanceStatusMarathon -type InstanceStatusMarathon struct { - - // The number of different running versions of the same service (0 for stopped, 1 for running and 1+ for bouncing) - // Required: true - AppCount *int32 `json:"app_count"` - - // Statuses of each app of the service - AppStatuses []*MarathonAppStatus `json:"app_statuses"` - - // Autoscaling information for the service - AutoscalingInfo *MarathonAutoscalingInfo `json:"autoscaling_info,omitempty"` - - // backoff in seconds before launching the next task - BackoffSeconds int32 `json:"backoff_seconds,omitempty"` - - // Method to transit between new and old versions of a service - // Required: true - // Enum: [brutal upthendown downthenup crossover] - BounceMethod *string `json:"bounce_method"` - - // Deploy status of a marathon service - // Enum: [Running Deploying Stopped Delayed Waiting Waiting for bounce NotRunning] - DeployStatus string `json:"deploy_status,omitempty"` - - // ID of the desired version of a service instance - DesiredAppID string `json:"desired_app_id,omitempty"` - - // Desired state of a service, for Marathon - // Required: true - // Enum: [start stop] - DesiredState *string `json:"desired_state"` - - // Status of the service in Envoy - Envoy *EnvoyStatus `json:"envoy,omitempty"` - - // Error message when a marathon job ID cannot be found - ErrorMessage string `json:"error_message,omitempty"` - - // The number of desired instances of the service - ExpectedInstanceCount int32 `json:"expected_instance_count,omitempty"` - - // Status of the service in Mesos - Mesos *MarathonMesosStatus `json:"mesos,omitempty"` - - // The number of actual running instances of the service - RunningInstanceCount int32 `json:"running_instance_count,omitempty"` - - // Status of the service in smartstack - Smartstack *SmartstackStatus `json:"smartstack,omitempty"` -} - -// Validate validates this instance status marathon -func (m *InstanceStatusMarathon) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAppCount(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAppStatuses(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAutoscalingInfo(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBounceMethod(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeployStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDesiredState(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnvoy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMesos(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSmartstack(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InstanceStatusMarathon) validateAppCount(formats strfmt.Registry) error { - - if err := validate.Required("app_count", "body", m.AppCount); err != nil { - return err - } - - return nil -} - -func (m *InstanceStatusMarathon) validateAppStatuses(formats strfmt.Registry) error { - - if swag.IsZero(m.AppStatuses) { // not required - return nil - } - - for i := 0; i < len(m.AppStatuses); i++ { - if swag.IsZero(m.AppStatuses[i]) { // not required - continue - } - - if m.AppStatuses[i] != nil { - if err := m.AppStatuses[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("app_statuses" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *InstanceStatusMarathon) validateAutoscalingInfo(formats strfmt.Registry) error { - - if swag.IsZero(m.AutoscalingInfo) { // not required - return nil - } - - if m.AutoscalingInfo != nil { - if err := m.AutoscalingInfo.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("autoscaling_info") - } - return err - } - } - - return nil -} - -var instanceStatusMarathonTypeBounceMethodPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["brutal","upthendown","downthenup","crossover"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - instanceStatusMarathonTypeBounceMethodPropEnum = append(instanceStatusMarathonTypeBounceMethodPropEnum, v) - } -} - -const ( - - // InstanceStatusMarathonBounceMethodBrutal captures enum value "brutal" - InstanceStatusMarathonBounceMethodBrutal string = "brutal" - - // InstanceStatusMarathonBounceMethodUpthendown captures enum value "upthendown" - InstanceStatusMarathonBounceMethodUpthendown string = "upthendown" - - // InstanceStatusMarathonBounceMethodDownthenup captures enum value "downthenup" - InstanceStatusMarathonBounceMethodDownthenup string = "downthenup" - - // InstanceStatusMarathonBounceMethodCrossover captures enum value "crossover" - InstanceStatusMarathonBounceMethodCrossover string = "crossover" -) - -// prop value enum -func (m *InstanceStatusMarathon) validateBounceMethodEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, instanceStatusMarathonTypeBounceMethodPropEnum); err != nil { - return err - } - return nil -} - -func (m *InstanceStatusMarathon) validateBounceMethod(formats strfmt.Registry) error { - - if err := validate.Required("bounce_method", "body", m.BounceMethod); err != nil { - return err - } - - // value enum - if err := m.validateBounceMethodEnum("bounce_method", "body", *m.BounceMethod); err != nil { - return err - } - - return nil -} - -var instanceStatusMarathonTypeDeployStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["Running","Deploying","Stopped","Delayed","Waiting","Waiting for bounce","NotRunning"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - instanceStatusMarathonTypeDeployStatusPropEnum = append(instanceStatusMarathonTypeDeployStatusPropEnum, v) - } -} - -const ( - - // InstanceStatusMarathonDeployStatusRunning captures enum value "Running" - InstanceStatusMarathonDeployStatusRunning string = "Running" - - // InstanceStatusMarathonDeployStatusDeploying captures enum value "Deploying" - InstanceStatusMarathonDeployStatusDeploying string = "Deploying" - - // InstanceStatusMarathonDeployStatusStopped captures enum value "Stopped" - InstanceStatusMarathonDeployStatusStopped string = "Stopped" - - // InstanceStatusMarathonDeployStatusDelayed captures enum value "Delayed" - InstanceStatusMarathonDeployStatusDelayed string = "Delayed" - - // InstanceStatusMarathonDeployStatusWaiting captures enum value "Waiting" - InstanceStatusMarathonDeployStatusWaiting string = "Waiting" - - // InstanceStatusMarathonDeployStatusWaitingForBounce captures enum value "Waiting for bounce" - InstanceStatusMarathonDeployStatusWaitingForBounce string = "Waiting for bounce" - - // InstanceStatusMarathonDeployStatusNotRunning captures enum value "NotRunning" - InstanceStatusMarathonDeployStatusNotRunning string = "NotRunning" -) - -// prop value enum -func (m *InstanceStatusMarathon) validateDeployStatusEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, instanceStatusMarathonTypeDeployStatusPropEnum); err != nil { - return err - } - return nil -} - -func (m *InstanceStatusMarathon) validateDeployStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.DeployStatus) { // not required - return nil - } - - // value enum - if err := m.validateDeployStatusEnum("deploy_status", "body", m.DeployStatus); err != nil { - return err - } - - return nil -} - -var instanceStatusMarathonTypeDesiredStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["start","stop"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - instanceStatusMarathonTypeDesiredStatePropEnum = append(instanceStatusMarathonTypeDesiredStatePropEnum, v) - } -} - -const ( - - // InstanceStatusMarathonDesiredStateStart captures enum value "start" - InstanceStatusMarathonDesiredStateStart string = "start" - - // InstanceStatusMarathonDesiredStateStop captures enum value "stop" - InstanceStatusMarathonDesiredStateStop string = "stop" -) - -// prop value enum -func (m *InstanceStatusMarathon) validateDesiredStateEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, instanceStatusMarathonTypeDesiredStatePropEnum); err != nil { - return err - } - return nil -} - -func (m *InstanceStatusMarathon) validateDesiredState(formats strfmt.Registry) error { - - if err := validate.Required("desired_state", "body", m.DesiredState); err != nil { - return err - } - - // value enum - if err := m.validateDesiredStateEnum("desired_state", "body", *m.DesiredState); err != nil { - return err - } - - return nil -} - -func (m *InstanceStatusMarathon) validateEnvoy(formats strfmt.Registry) error { - - if swag.IsZero(m.Envoy) { // not required - return nil - } - - if m.Envoy != nil { - if err := m.Envoy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("envoy") - } - return err - } - } - - return nil -} - -func (m *InstanceStatusMarathon) validateMesos(formats strfmt.Registry) error { - - if swag.IsZero(m.Mesos) { // not required - return nil - } - - if m.Mesos != nil { - if err := m.Mesos.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mesos") - } - return err - } - } - - return nil -} - -func (m *InstanceStatusMarathon) validateSmartstack(formats strfmt.Registry) error { - - if swag.IsZero(m.Smartstack) { // not required - return nil - } - - if m.Smartstack != nil { - if err := m.Smartstack.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("smartstack") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InstanceStatusMarathon) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InstanceStatusMarathon) UnmarshalBinary(b []byte) error { - var res InstanceStatusMarathon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/instance_status_tron.go b/pkg/paasta_api/models/instance_status_tron.go deleted file mode 100644 index dda087b..0000000 --- a/pkg/paasta_api/models/instance_status_tron.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// InstanceStatusTron instance status tron -// -// swagger:model InstanceStatusTron -type InstanceStatusTron struct { - - // The command of the action - ActionCommand string `json:"action_command,omitempty"` - - // The name of the action - ActionName string `json:"action_name,omitempty"` - - // The raw command of the action - ActionRawCommand string `json:"action_raw_command,omitempty"` - - // The start time of the action - ActionStartTime string `json:"action_start_time,omitempty"` - - // The state of the action - ActionState string `json:"action_state,omitempty"` - - // The stderr command of the action - ActionStderr string `json:"action_stderr,omitempty"` - - // The stdout command of the action - ActionStdout string `json:"action_stdout,omitempty"` - - // The name of this job - // Required: true - JobName *string `json:"job_name"` - - // The job schedule of the job - JobSchedule string `json:"job_schedule,omitempty"` - - // The status of the job - JobStatus string `json:"job_status,omitempty"` - - // The dashboard url of the job - // Required: true - JobURL *string `json:"job_url"` -} - -// Validate validates this instance status tron -func (m *InstanceStatusTron) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateJobName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateJobURL(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InstanceStatusTron) validateJobName(formats strfmt.Registry) error { - - if err := validate.Required("job_name", "body", m.JobName); err != nil { - return err - } - - return nil -} - -func (m *InstanceStatusTron) validateJobURL(formats strfmt.Registry) error { - - if err := validate.Required("job_url", "body", m.JobURL); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InstanceStatusTron) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InstanceStatusTron) UnmarshalBinary(b []byte) error { - var res InstanceStatusTron - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/instance_task.go b/pkg/paasta_api/models/instance_task.go deleted file mode 100644 index b7cfd25..0000000 --- a/pkg/paasta_api/models/instance_task.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// InstanceTask instance task -// -// swagger:model InstanceTask -type InstanceTask interface{} diff --git a/pkg/paasta_api/models/instance_tasks.go b/pkg/paasta_api/models/instance_tasks.go deleted file mode 100644 index 3f29281..0000000 --- a/pkg/paasta_api/models/instance_tasks.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" -) - -// InstanceTasks List of tasks associated with instance -// -// swagger:model InstanceTasks -type InstanceTasks []InstanceTask - -// Validate validates this instance tasks -func (m InstanceTasks) Validate(formats strfmt.Registry) error { - return nil -} diff --git a/pkg/paasta_api/models/integer_and_error.go b/pkg/paasta_api/models/integer_and_error.go deleted file mode 100644 index 61636f3..0000000 --- a/pkg/paasta_api/models/integer_and_error.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// IntegerAndError integer and error -// -// swagger:model IntegerAndError -type IntegerAndError struct { - - // error message - ErrorMessage string `json:"error_message,omitempty"` - - // value - Value int32 `json:"value,omitempty"` -} - -// Validate validates this integer and error -func (m *IntegerAndError) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *IntegerAndError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IntegerAndError) UnmarshalBinary(b []byte) error { - var res IntegerAndError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/kubernetes_container.go b/pkg/paasta_api/models/kubernetes_container.go deleted file mode 100644 index 5b3a66b..0000000 --- a/pkg/paasta_api/models/kubernetes_container.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// KubernetesContainer kubernetes container -// -// swagger:model KubernetesContainer -type KubernetesContainer struct { - - // Name of the container - Name string `json:"name,omitempty"` - - // Stdout and stderr tail of the container - TailLines *TaskTailLines `json:"tail_lines,omitempty"` -} - -// Validate validates this kubernetes container -func (m *KubernetesContainer) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTailLines(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *KubernetesContainer) validateTailLines(formats strfmt.Registry) error { - - if swag.IsZero(m.TailLines) { // not required - return nil - } - - if m.TailLines != nil { - if err := m.TailLines.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tail_lines") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *KubernetesContainer) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *KubernetesContainer) UnmarshalBinary(b []byte) error { - var res KubernetesContainer - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/kubernetes_pod.go b/pkg/paasta_api/models/kubernetes_pod.go deleted file mode 100644 index 648f35d..0000000 --- a/pkg/paasta_api/models/kubernetes_pod.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// KubernetesPod kubernetes pod -// -// swagger:model KubernetesPod -type KubernetesPod struct { - - // containers - Containers []*KubernetesContainer `json:"containers"` - - // Time at which the pod was deployed - DeployedTimestamp float32 `json:"deployed_timestamp,omitempty"` - - // name of the pod's host - Host string `json:"host,omitempty"` - - // long message explaining the pod's state - Message *string `json:"message,omitempty"` - - // name of the pod in Kubernetes - Name string `json:"name,omitempty"` - - // The status of the pod - Phase string `json:"phase,omitempty"` - - // Whether or not the pod is ready (i.e. all containers up) - Ready bool `json:"ready,omitempty"` - - // short message explaining the pod's state - Reason *string `json:"reason,omitempty"` -} - -// Validate validates this kubernetes pod -func (m *KubernetesPod) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContainers(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *KubernetesPod) validateContainers(formats strfmt.Registry) error { - - if swag.IsZero(m.Containers) { // not required - return nil - } - - for i := 0; i < len(m.Containers); i++ { - if swag.IsZero(m.Containers[i]) { // not required - continue - } - - if m.Containers[i] != nil { - if err := m.Containers[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("containers" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *KubernetesPod) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *KubernetesPod) UnmarshalBinary(b []byte) error { - var res KubernetesPod - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/kubernetes_replica_set.go b/pkg/paasta_api/models/kubernetes_replica_set.go deleted file mode 100644 index 015b9e4..0000000 --- a/pkg/paasta_api/models/kubernetes_replica_set.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// KubernetesReplicaSet kubernetes replica set -// -// swagger:model KubernetesReplicaSet -type KubernetesReplicaSet struct { - - // Time at which the replicaset was created - CreateTimestamp float32 `json:"create_timestamp,omitempty"` - - // name of the replicaset in Kubernetes - Name string `json:"name,omitempty"` - - // number of ready replicas for the replicaset - ReadyReplicas int32 `json:"ready_replicas,omitempty"` - - // number of desired replicas for the replicaset - Replicas int32 `json:"replicas,omitempty"` -} - -// Validate validates this kubernetes replica set -func (m *KubernetesReplicaSet) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *KubernetesReplicaSet) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *KubernetesReplicaSet) UnmarshalBinary(b []byte) error { - var res KubernetesReplicaSet - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/marathon_app_status.go b/pkg/paasta_api/models/marathon_app_status.go deleted file mode 100644 index e04b0bc..0000000 --- a/pkg/paasta_api/models/marathon_app_status.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MarathonAppStatus marathon app status -// -// swagger:model MarathonAppStatus -type MarathonAppStatus struct { - - // Backoff in seconds before launching next task - BackoffSeconds int32 `json:"backoff_seconds,omitempty"` - - // Unix timestamp when this app was created - CreateTimestamp float32 `json:"create_timestamp,omitempty"` - - // Marathon dashboard URL for this app - DashboardURL string `json:"dashboard_url,omitempty"` - - // Deploy status of this app - DeployStatus string `json:"deploy_status,omitempty"` - - // Tasks associated to this app - Tasks []*MarathonTask `json:"tasks"` - - // Number of healthy tasks for this app - TasksHealthy int32 `json:"tasks_healthy,omitempty"` - - // Number running tasks for this app - TasksRunning int32 `json:"tasks_running,omitempty"` - - // Number of staged tasks for this app - TasksStaged int32 `json:"tasks_staged,omitempty"` - - // Total number of tasks for this app - TasksTotal int32 `json:"tasks_total,omitempty"` - - // Mapping of reason offer was refused to the number of times that type of refusal was seen - UnusedOfferReasonCounts interface{} `json:"unused_offer_reason_counts,omitempty"` -} - -// Validate validates this marathon app status -func (m *MarathonAppStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTasks(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MarathonAppStatus) validateTasks(formats strfmt.Registry) error { - - if swag.IsZero(m.Tasks) { // not required - return nil - } - - for i := 0; i < len(m.Tasks); i++ { - if swag.IsZero(m.Tasks[i]) { // not required - continue - } - - if m.Tasks[i] != nil { - if err := m.Tasks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tasks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MarathonAppStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MarathonAppStatus) UnmarshalBinary(b []byte) error { - var res MarathonAppStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/marathon_autoscaling_info.go b/pkg/paasta_api/models/marathon_autoscaling_info.go deleted file mode 100644 index cfe69c0..0000000 --- a/pkg/paasta_api/models/marathon_autoscaling_info.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MarathonAutoscalingInfo marathon autoscaling info -// -// swagger:model MarathonAutoscalingInfo -type MarathonAutoscalingInfo struct { - - // The number of instances of the service currently running - CurrentInstances int32 `json:"current_instances,omitempty"` - - // The current utilization of the instances' allocated resources - CurrentUtilization float32 `json:"current_utilization,omitempty"` - - // The maximum number of instances that the autoscaler will scale to - MaxInstances int32 `json:"max_instances,omitempty"` - - // The minimum number of instances that the autoscaler will scale to - MinInstances int32 `json:"min_instances,omitempty"` - - // The autoscaler's current target number of instances of this service to run - TargetInstances int32 `json:"target_instances,omitempty"` -} - -// Validate validates this marathon autoscaling info -func (m *MarathonAutoscalingInfo) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MarathonAutoscalingInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MarathonAutoscalingInfo) UnmarshalBinary(b []byte) error { - var res MarathonAutoscalingInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/marathon_dashboard.go b/pkg/paasta_api/models/marathon_dashboard.go deleted file mode 100644 index 090d427..0000000 --- a/pkg/paasta_api/models/marathon_dashboard.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MarathonDashboard A list of Marathon service, instance, and shard url for one or more clusters -// -// swagger:model MarathonDashboard -type MarathonDashboard map[string]MarathonDashboardCluster - -// Validate validates this marathon dashboard -func (m MarathonDashboard) Validate(formats strfmt.Registry) error { - var res []error - - for k := range m { - - if err := validate.Required(k, "body", m[k]); err != nil { - return err - } - - if err := m[k].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(k) - } - return err - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/models/marathon_dashboard_cluster.go b/pkg/paasta_api/models/marathon_dashboard_cluster.go deleted file mode 100644 index c72ca00..0000000 --- a/pkg/paasta_api/models/marathon_dashboard_cluster.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MarathonDashboardCluster List of all the MarathonDashboardItems for a cluster -// -// swagger:model MarathonDashboardCluster -type MarathonDashboardCluster []*MarathonDashboardItem - -// Validate validates this marathon dashboard cluster -func (m MarathonDashboardCluster) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/models/marathon_dashboard_item.go b/pkg/paasta_api/models/marathon_dashboard_item.go deleted file mode 100644 index 7a3d453..0000000 --- a/pkg/paasta_api/models/marathon_dashboard_item.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MarathonDashboardItem Marathon service, instance, and shard url -// -// swagger:model MarathonDashboardItem -type MarathonDashboardItem struct { - - // Instance name - Instance string `json:"instance,omitempty"` - - // Service name - Service string `json:"service,omitempty"` - - // Marathon Shard URL - ShardURL string `json:"shard_url,omitempty"` -} - -// Validate validates this marathon dashboard item -func (m *MarathonDashboardItem) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MarathonDashboardItem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MarathonDashboardItem) UnmarshalBinary(b []byte) error { - var res MarathonDashboardItem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/marathon_mesos_nonrunning_task.go b/pkg/paasta_api/models/marathon_mesos_nonrunning_task.go deleted file mode 100644 index 79f6711..0000000 --- a/pkg/paasta_api/models/marathon_mesos_nonrunning_task.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MarathonMesosNonrunningTask marathon mesos nonrunning task -// -// swagger:model MarathonMesosNonrunningTask -type MarathonMesosNonrunningTask struct { - - // The unix timestamp at which the task was deployed - DeployedTimestamp float32 `json:"deployed_timestamp,omitempty"` - - // Name of the Mesos agent on which this task is running - Hostname string `json:"hostname,omitempty"` - - // The ID of the task in Mesos - ID string `json:"id,omitempty"` - - // The current state of the task - State string `json:"state,omitempty"` - - // Stdout and stderr tail of the task - TailLines *TaskTailLines `json:"tail_lines,omitempty"` -} - -// Validate validates this marathon mesos nonrunning task -func (m *MarathonMesosNonrunningTask) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTailLines(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MarathonMesosNonrunningTask) validateTailLines(formats strfmt.Registry) error { - - if swag.IsZero(m.TailLines) { // not required - return nil - } - - if m.TailLines != nil { - if err := m.TailLines.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tail_lines") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MarathonMesosNonrunningTask) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MarathonMesosNonrunningTask) UnmarshalBinary(b []byte) error { - var res MarathonMesosNonrunningTask - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/marathon_mesos_running_task.go b/pkg/paasta_api/models/marathon_mesos_running_task.go deleted file mode 100644 index 0f0f2b1..0000000 --- a/pkg/paasta_api/models/marathon_mesos_running_task.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MarathonMesosRunningTask marathon mesos running task -// -// swagger:model MarathonMesosRunningTask -type MarathonMesosRunningTask struct { - - // The portion of a CPU that the task can use - CPUShares *FloatAndError `json:"cpu_shares,omitempty"` - - // The number of seconds of CPU time the task has used - CPUUsedSeconds *FloatAndError `json:"cpu_used_seconds,omitempty"` - - // The unix timestamp at which the task was deployed - DeployedTimestamp float32 `json:"deployed_timestamp,omitempty"` - - // The duration over which the task has been running in seconds - DurationSeconds int32 `json:"duration_seconds,omitempty"` - - // Name of the Mesos agent on which this task is running - Hostname string `json:"hostname,omitempty"` - - // The ID of the task in Mesos - ID string `json:"id,omitempty"` - - // The maximum amount of memory the task is allowed to use - MemLimit *IntegerAndError `json:"mem_limit,omitempty"` - - // The tasks's resident set size - Rss *IntegerAndError `json:"rss,omitempty"` - - // Stdout and stderr tail of the task - TailLines *TaskTailLines `json:"tail_lines,omitempty"` -} - -// Validate validates this marathon mesos running task -func (m *MarathonMesosRunningTask) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCPUShares(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCPUUsedSeconds(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMemLimit(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRss(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTailLines(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MarathonMesosRunningTask) validateCPUShares(formats strfmt.Registry) error { - - if swag.IsZero(m.CPUShares) { // not required - return nil - } - - if m.CPUShares != nil { - if err := m.CPUShares.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cpu_shares") - } - return err - } - } - - return nil -} - -func (m *MarathonMesosRunningTask) validateCPUUsedSeconds(formats strfmt.Registry) error { - - if swag.IsZero(m.CPUUsedSeconds) { // not required - return nil - } - - if m.CPUUsedSeconds != nil { - if err := m.CPUUsedSeconds.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cpu_used_seconds") - } - return err - } - } - - return nil -} - -func (m *MarathonMesosRunningTask) validateMemLimit(formats strfmt.Registry) error { - - if swag.IsZero(m.MemLimit) { // not required - return nil - } - - if m.MemLimit != nil { - if err := m.MemLimit.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mem_limit") - } - return err - } - } - - return nil -} - -func (m *MarathonMesosRunningTask) validateRss(formats strfmt.Registry) error { - - if swag.IsZero(m.Rss) { // not required - return nil - } - - if m.Rss != nil { - if err := m.Rss.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rss") - } - return err - } - } - - return nil -} - -func (m *MarathonMesosRunningTask) validateTailLines(formats strfmt.Registry) error { - - if swag.IsZero(m.TailLines) { // not required - return nil - } - - if m.TailLines != nil { - if err := m.TailLines.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tail_lines") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MarathonMesosRunningTask) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MarathonMesosRunningTask) UnmarshalBinary(b []byte) error { - var res MarathonMesosRunningTask - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/marathon_mesos_status.go b/pkg/paasta_api/models/marathon_mesos_status.go deleted file mode 100644 index 2fcffac..0000000 --- a/pkg/paasta_api/models/marathon_mesos_status.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MarathonMesosStatus marathon mesos status -// -// swagger:model MarathonMesosStatus -type MarathonMesosStatus struct { - - // Error message when Mesos tasks cannot be queried - ErrorMessage string `json:"error_message,omitempty"` - - // Non-running tasks associated to this service - NonRunningTasks []*MarathonMesosNonrunningTask `json:"non_running_tasks"` - - // The number of running Mesos tasks associated to this service - RunningTaskCount int32 `json:"running_task_count,omitempty"` - - // Currently running tasks associated to this service - RunningTasks []*MarathonMesosRunningTask `json:"running_tasks"` -} - -// Validate validates this marathon mesos status -func (m *MarathonMesosStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateNonRunningTasks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRunningTasks(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MarathonMesosStatus) validateNonRunningTasks(formats strfmt.Registry) error { - - if swag.IsZero(m.NonRunningTasks) { // not required - return nil - } - - for i := 0; i < len(m.NonRunningTasks); i++ { - if swag.IsZero(m.NonRunningTasks[i]) { // not required - continue - } - - if m.NonRunningTasks[i] != nil { - if err := m.NonRunningTasks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("non_running_tasks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *MarathonMesosStatus) validateRunningTasks(formats strfmt.Registry) error { - - if swag.IsZero(m.RunningTasks) { // not required - return nil - } - - for i := 0; i < len(m.RunningTasks); i++ { - if swag.IsZero(m.RunningTasks[i]) { // not required - continue - } - - if m.RunningTasks[i] != nil { - if err := m.RunningTasks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("running_tasks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MarathonMesosStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MarathonMesosStatus) UnmarshalBinary(b []byte) error { - var res MarathonMesosStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/marathon_task.go b/pkg/paasta_api/models/marathon_task.go deleted file mode 100644 index 903c1f0..0000000 --- a/pkg/paasta_api/models/marathon_task.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MarathonTask marathon task -// -// swagger:model MarathonTask -type MarathonTask struct { - - // Time at which the task was deployed - DeployedTimestamp float32 `json:"deployed_timestamp,omitempty"` - - // Name of the host on which the task is running - Host string `json:"host,omitempty"` - - // ID of the task in Mesos - ID string `json:"id,omitempty"` - - // Whether Marathon thinks the task is healthy - IsHealthy bool `json:"is_healthy,omitempty"` - - // Port on which the task is listening - Port int32 `json:"port,omitempty"` -} - -// Validate validates this marathon task -func (m *MarathonTask) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MarathonTask) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MarathonTask) UnmarshalBinary(b []byte) error { - var res MarathonTask - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/meta_status.go b/pkg/paasta_api/models/meta_status.go deleted file mode 100644 index 3257987..0000000 --- a/pkg/paasta_api/models/meta_status.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MetaStatus Result of `paasta metastatus` command -// -// swagger:model MetaStatus -type MetaStatus struct { - - // Exit code from `paasta metastatus` command - ExitCode int64 `json:"exit_code,omitempty"` - - // Output from `paasta metastatus` command - Output string `json:"output,omitempty"` -} - -// Validate validates this meta status -func (m *MetaStatus) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MetaStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MetaStatus) UnmarshalBinary(b []byte) error { - var res MetaStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/resource.go b/pkg/paasta_api/models/resource.go deleted file mode 100644 index aa529c6..0000000 --- a/pkg/paasta_api/models/resource.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Resource resource -// -// swagger:model Resource -type Resource []*ResourceItem - -// Validate validates this resource -func (m Resource) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paasta_api/models/resource_item.go b/pkg/paasta_api/models/resource_item.go deleted file mode 100644 index b63b20b..0000000 --- a/pkg/paasta_api/models/resource_item.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResourceItem resource item -// -// swagger:model ResourceItem -type ResourceItem struct { - - // cpus - Cpus *ResourceValue `json:"cpus,omitempty"` - - // disk - Disk *ResourceValue `json:"disk,omitempty"` - - // groupings - Groupings interface{} `json:"groupings,omitempty"` - - // mem - Mem *ResourceValue `json:"mem,omitempty"` -} - -// Validate validates this resource item -func (m *ResourceItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCpus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDisk(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMem(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResourceItem) validateCpus(formats strfmt.Registry) error { - - if swag.IsZero(m.Cpus) { // not required - return nil - } - - if m.Cpus != nil { - if err := m.Cpus.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cpus") - } - return err - } - } - - return nil -} - -func (m *ResourceItem) validateDisk(formats strfmt.Registry) error { - - if swag.IsZero(m.Disk) { // not required - return nil - } - - if m.Disk != nil { - if err := m.Disk.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("disk") - } - return err - } - } - - return nil -} - -func (m *ResourceItem) validateMem(formats strfmt.Registry) error { - - if swag.IsZero(m.Mem) { // not required - return nil - } - - if m.Mem != nil { - if err := m.Mem.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mem") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ResourceItem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResourceItem) UnmarshalBinary(b []byte) error { - var res ResourceItem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/resource_value.go b/pkg/paasta_api/models/resource_value.go deleted file mode 100644 index 4569060..0000000 --- a/pkg/paasta_api/models/resource_value.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResourceValue resource value -// -// swagger:model ResourceValue -type ResourceValue struct { - - // free - Free float64 `json:"free,omitempty"` - - // total - Total float64 `json:"total,omitempty"` - - // used - Used float64 `json:"used,omitempty"` -} - -// Validate validates this resource value -func (m *ResourceValue) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ResourceValue) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResourceValue) UnmarshalBinary(b []byte) error { - var res ResourceValue - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/smartstack_backend.go b/pkg/paasta_api/models/smartstack_backend.go deleted file mode 100644 index 74301d4..0000000 --- a/pkg/paasta_api/models/smartstack_backend.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SmartstackBackend smartstack backend -// -// swagger:model SmartstackBackend -type SmartstackBackend struct { - - // Check code reported by HAProxy - CheckCode string `json:"check_code,omitempty"` - - // Duration in ms of the last health check performed by HAProxy - CheckDuration int32 `json:"check_duration,omitempty"` - - // Status of last health check of the backend - CheckStatus string `json:"check_status,omitempty"` - - // Whether this backend has an associated task running - HasAssociatedTask bool `json:"has_associated_task,omitempty"` - - // Name of the host on which the backend is running - Hostname string `json:"hostname,omitempty"` - - // Seconds since last change in backend status - LastChange int32 `json:"last_change,omitempty"` - - // Port number on which the backend responds - Port int32 `json:"port,omitempty"` - - // Status of the backend in HAProxy - Status string `json:"status,omitempty"` -} - -// Validate validates this smartstack backend -func (m *SmartstackBackend) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SmartstackBackend) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SmartstackBackend) UnmarshalBinary(b []byte) error { - var res SmartstackBackend - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/smartstack_location.go b/pkg/paasta_api/models/smartstack_location.go deleted file mode 100644 index fdc8b13..0000000 --- a/pkg/paasta_api/models/smartstack_location.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SmartstackLocation smartstack location -// -// swagger:model SmartstackLocation -type SmartstackLocation struct { - - // Smartstack backends running in this location - Backends []*SmartstackBackend `json:"backends"` - - // Name of the location - Name string `json:"name,omitempty"` - - // Number of running backends for the service in this location - RunningBackendsCount int32 `json:"running_backends_count,omitempty"` -} - -// Validate validates this smartstack location -func (m *SmartstackLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBackends(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SmartstackLocation) validateBackends(formats strfmt.Registry) error { - - if swag.IsZero(m.Backends) { // not required - return nil - } - - for i := 0; i < len(m.Backends); i++ { - if swag.IsZero(m.Backends[i]) { // not required - continue - } - - if m.Backends[i] != nil { - if err := m.Backends[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backends" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SmartstackLocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SmartstackLocation) UnmarshalBinary(b []byte) error { - var res SmartstackLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/smartstack_status.go b/pkg/paasta_api/models/smartstack_status.go deleted file mode 100644 index 15f963e..0000000 --- a/pkg/paasta_api/models/smartstack_status.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SmartstackStatus smartstack status -// -// swagger:model SmartstackStatus -type SmartstackStatus struct { - - // Number of backends expected to be present in each location - ExpectedBackendsPerLocation int32 `json:"expected_backends_per_location,omitempty"` - - // Locations the service is deployed - Locations []*SmartstackLocation `json:"locations"` - - // Registration name of the service in Smartstack - Registration string `json:"registration,omitempty"` -} - -// Validate validates this smartstack status -func (m *SmartstackStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLocations(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SmartstackStatus) validateLocations(formats strfmt.Registry) error { - - if swag.IsZero(m.Locations) { // not required - return nil - } - - for i := 0; i < len(m.Locations); i++ { - if swag.IsZero(m.Locations[i]) { // not required - continue - } - - if m.Locations[i] != nil { - if err := m.Locations[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("locations" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SmartstackStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SmartstackStatus) UnmarshalBinary(b []byte) error { - var res SmartstackStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paasta_api/models/task_tail_lines.go b/pkg/paasta_api/models/task_tail_lines.go deleted file mode 100644 index 1166d9d..0000000 --- a/pkg/paasta_api/models/task_tail_lines.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// TaskTailLines task tail lines -// -// swagger:model TaskTailLines -type TaskTailLines struct { - - // Error message when fetching tail lines fails - ErrorMessage string `json:"error_message,omitempty"` - - // The requested number of lines from the task's stderr - Stderr []string `json:"stderr"` - - // The requested number of lines from the task's stdout - Stdout []string `json:"stdout"` -} - -// Validate validates this task tail lines -func (m *TaskTailLines) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *TaskTailLines) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TaskTailLines) UnmarshalBinary(b []byte) error { - var res TaskTailLines - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} From 9f77d7bbc968fa785bb26bf0e46f8c6f182a5a89 Mon Sep 17 00:00:00 2001 From: Maksym Melnychok Date: Tue, 17 Nov 2020 04:21:24 -0800 Subject: [PATCH 38/38] reduce diff --- go.mod | 14 +++--- go.sum | 139 ++++++++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 121 insertions(+), 32 deletions(-) diff --git a/go.mod b/go.mod index 20cd02e..6c634c0 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,7 @@ module github.com/Yelp/paasta-tools-go require ( github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754 + github.com/fatih/structs v1.1.0 github.com/go-logr/zapr v0.1.1 // indirect github.com/go-openapi/errors v0.19.4 github.com/go-openapi/runtime v0.19.15 @@ -9,28 +10,31 @@ require ( github.com/go-openapi/swag v0.19.5 github.com/go-openapi/validate v0.19.8 github.com/gogo/protobuf v1.2.1 // indirect - github.com/google/go-cmp v0.3.1 // indirect + github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 // indirect + github.com/hashicorp/golang-lru v0.5.3 // indirect github.com/imdario/mergo v0.3.8 // indirect - github.com/json-iterator/go v1.1.8 // indirect - github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381 + github.com/logrusorgru/aurora v2.0.3+incompatible github.com/mitchellh/mapstructure v1.2.2 github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 github.com/openzipkin/zipkin-go v0.2.2 + github.com/pkg/errors v0.8.1 github.com/pmezard/go-difflib v1.0.0 + github.com/prometheus/client_golang v1.3.0 // indirect github.com/spf13/pflag v1.0.3 github.com/stretchr/testify v1.4.0 github.com/subosito/gotenv v1.2.0 - github.yelpcorp.com/go-packages/monk v0.0.0-20200713102923-aa075ebbb2e7 go.uber.org/zap v1.13.0 // indirect golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 // indirect golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 - golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect gopkg.in/yaml.v2 v2.2.4 k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible k8s.io/klog v1.0.0 + k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a // indirect + k8s.io/kubernetes v1.14.0 k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 // indirect sigs.k8s.io/controller-runtime v0.2.2 ) diff --git a/go.sum b/go.sum index 140bf55..db3cc16 100644 --- a/go.sum +++ b/go.sum @@ -2,22 +2,35 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= git.apache.org/thrift.git v0.0.0-20171203172758-327ebb6c2b6d h1:RsHq5kCWkxgbqyQPWB8OWNU/CRStjE/vusovT2bGKOw= git.apache.org/thrift.git v0.0.0-20171203172758-327ebb6c2b6d/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/appscode/jsonpatch v2.0.1+incompatible h1:Ksl+gGquV3TeYmiZPBsDNauiyloE7sg9OMUWKr5Ctmg= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -29,13 +42,20 @@ github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3 github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= @@ -53,11 +73,13 @@ github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQH github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= github.com/go-openapi/errors v0.19.4 h1:fSGwO1tSYHFu70NKaWJt5Qh0qoBRtCm/mXS1yhf+0W0= github.com/go-openapi/errors v0.19.4/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= @@ -75,6 +97,7 @@ github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= github.com/go-openapi/runtime v0.19.15 h1:2GIefxs9Rx1vCDNghRtypRq+ig8KSLrjHbAYI/gCLCM= github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= +github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= @@ -87,6 +110,8 @@ github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6 github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= github.com/go-openapi/strfmt v0.19.5 h1:0utjKrw+BAh8s57XE9Xz8DUBsVvPmRUB6styvl9wWIM= github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87 h1:zP3nY8Tk2E6RTkqGYrarZXuzh+ffyLDljLxCy1iJw80= +github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= @@ -106,48 +131,58 @@ github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= -github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/mux v1.6.2 h1:Pgr17XVTNXAk3q/r4CpKzC5xBM/qW1uVLV+IhRZpIIk= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= +github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381 h1:bqDmpDG49ZRnB5PcgP0RXtQvnMSgIF14M7CBd2shtXs= -github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= +github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8= +github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a h1:TpvdAwDAt1K4ANVOfcihouRdvP+MgAfDWwBuct4l6ZY= +github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -164,14 +199,19 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OH github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/openzipkin/zipkin-go v0.2.2 h1:nY8Hti+WKaP0cRsSeQ026wU03QsM762XBeCXBb9NAWI= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= @@ -179,19 +219,38 @@ github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7ir github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0 h1:miYCvYqFXtl/J9FIy8eNpBfYthAEFg+Ys0XyUVEcDsc= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0 h1:ElTg5tNp4DqfV7UQjDqv2+RJlNzsDtvNAWccbItceIE= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -199,6 +258,7 @@ github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -206,11 +266,12 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= -github.yelpcorp.com/go-packages/monk v0.0.0-20200713102923-aa075ebbb2e7 h1:+Y4wW5yXg8cojHAyKdZMKq6XwRTbzlYnIOx18Jpz0YA= -github.yelpcorp.com/go-packages/monk v0.0.0-20200713102923-aa075ebbb2e7/go.mod h1:r68sHLqP79UXr8iRyAKicKDOMKYrwJJgbSDRi5p3clo= +github.yelpcorp.com/go-packages/monk v0.0.0-20200623102145-af41f6e5224d h1:qbyNnu67PWuQdko5nu0gnIx3fPIvyLAqSkNEmmOqqPk= +github.yelpcorp.com/go-packages/monk v0.0.0-20200623102145-af41f6e5224d/go.mod h1:r68sHLqP79UXr8iRyAKicKDOMKYrwJJgbSDRi5p3clo= +github.yelpcorp.com/go-packages/monk v0.0.0-20200701154824-364e86298c97 h1:mIZ1VQFzxme/ooSDhcl24UvJq0IOy42c+ONzj/YwOx8= +github.yelpcorp.com/go-packages/monk v0.0.0-20200701154824-364e86298c97/go.mod h1:r68sHLqP79UXr8iRyAKicKDOMKYrwJJgbSDRi5p3clo= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.2 h1:jxcFYjlkl8xaERsgLo+RNquI0epW6zuy/ZRQs6jnrFA= @@ -221,12 +282,12 @@ go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -235,13 +296,16 @@ golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 h1:ulvT7fqt0yHWzpJwI57MezWnYDVpCAYBVuYst/L+fAY= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= @@ -251,7 +315,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 h1:eDrdRpKgkcCqKZQwyZRyeFZgfqt37SL7Kv3tok06cKE= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= @@ -262,14 +325,20 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f h1:68K/z8GLUxV76xGSqwTWw2gyk/jwn79LUL43rES2g8o= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= @@ -279,33 +348,30 @@ golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqG golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.0.1 h1:xyiBuvkD2g5n7cYzx6u2sxQvsAy4QJsZFCzGVdzOXZ0= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/grpc v1.20.0 h1:DlsSIrgEBuZAUFJcta2B5i/lzeHHbnfkNFAfFXLVFYQ= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= @@ -313,16 +379,29 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +k8s.io/api v0.0.0-20190202010724-74b699b93c15 h1:AoUGjnJ3PJMFz+Rkp4lx3X+6mPUnY1MESJhbUSGX+pc= +k8s.io/api v0.0.0-20190202010724-74b699b93c15/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= +k8s.io/api v0.0.0-20190313235455-40a48860b5ab h1:DG9A67baNpoeweOy2spF1OWHhnVY5KR7/Ek/+U1lVZc= +k8s.io/api v0.0.0-20190313235455-40a48860b5ab/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b h1:aBGgKJUM9Hk/3AE8WaZIApnTxG35kbuQba2w+SXqezo= k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8 h1:q1Qvjzs/iEdXF6A1a8H3AKVFDzJNcJn3nXMs6R6qFtA= k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= +k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c h1:02KEBFny6M5VWKj6Y8Ns27epjefTqLJXD4fvqP5tGFg= +k8s.io/apimachinery v0.0.0-20190216013122-f05b8decd79c/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= +k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1 h1:IS7K02iBkQXpCeieSiyJjGoLSdVOv2DbPaWHJ+ZtgKg= +k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d h1:Jmdtdt1ZnoGfWWIIik61Z7nKYgO3J+swQJtPYsP9wHA= k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= +k8s.io/client-go v11.0.0+incompatible h1:LBbX2+lOwY9flffWlJM7f1Ct8V2SRNiMRDFeiwnJo9o= +k8s.io/client-go v11.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible h1:U5Bt+dab9K8qaUmXINrkXO135kA11/i5Kg1RUydgaMQ= k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= +k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v0.2.0 h1:0ElL0OHzF3N+OhoJTL0uca20SxtYt4X4+bzHeqrB83c= +k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= @@ -330,12 +409,18 @@ k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.1.0 h1:X3+Mru/L3jy4BI4vcAYkHvL6PyU+QBsuhEqwlI4mgkA= k8s.io/klog/v2 v2.1.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= +k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= +k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= +k8s.io/kubernetes v1.14.0 h1:6T2iAEoOYQnzQb3WvPlUkcczEEXZ7+YPlAO8olwujRw= +k8s.io/kubernetes v1.14.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 h1:p0Ai3qVtkbCG/Af26dBmU0E1W58NID3hSSh7cMyylpM= k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +sigs.k8s.io/controller-runtime v0.1.10 h1:amLOmcekVdnsD1uIpmgRqfTbQWJ2qxvQkcdeFhcotn4= +sigs.k8s.io/controller-runtime v0.1.10/go.mod h1:HFAYoOh6XMV+jKF1UjFwrknPbowfyHEHHRdJMf2jMX8= sigs.k8s.io/controller-runtime v0.2.2 h1:JT/vJJhUjjL9NZNwnm8AXmqCBUXSCFKmTaNjwDi28N0= sigs.k8s.io/controller-runtime v0.2.2/go.mod h1:9dyohw3ZtoXQuV1e766PHUn+cmrRCIcBh6XIMFNMZ+I= -sigs.k8s.io/testing_frameworks v0.1.1 h1:cP2l8fkA3O9vekpy5Ks8mmA0NW/F7yBdXf8brkWhVrs= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/testing_frameworks v0.1.1/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9qL6ht1zEr/U= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=