Documentation ¶
Index ¶
- func NewReconcilerClient(httpClient *http.Client, log logrus.FieldLogger, cfg *Config) *client
- func NewReconcilerError(failures *[]reconcilerApi.Failure, format string, args ...interface{}) kebError.ErrorReporter
- func PrettyFailures(response *reconcilerApi.HTTPClusterResponse) string
- type Client
- type Config
- type FakeClient
- func (c *FakeClient) ApplyClusterConfig(cluster reconcilerApi.Cluster) (*reconcilerApi.HTTPClusterResponse, error)
- func (c *FakeClient) ChangeClusterState(clusterName string, clusterVersion int64, desiredState reconcilerApi.Status)
- func (c *FakeClient) ClusterExists(id string) bool
- func (c *FakeClient) DeleteCluster(clusterName string) error
- func (c *FakeClient) GetCluster(clusterName string, configVersion int64) (*reconcilerApi.HTTPClusterResponse, error)
- func (c *FakeClient) GetLatestCluster(clusterName string) (*reconcilerApi.HTTPClusterResponse, error)
- func (c *FakeClient) GetStatusChange(clusterName, offset string) ([]*reconcilerApi.StatusChange, error)
- func (c *FakeClient) IsBeingDeleted(id string) bool
- func (c *FakeClient) LastClusterConfig(runtimeID string) (*reconcilerApi.Cluster, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewReconcilerClient ¶
func NewReconcilerClient(httpClient *http.Client, log logrus.FieldLogger, cfg *Config) *client
func NewReconcilerError ¶
func NewReconcilerError(failures *[]reconcilerApi.Failure, format string, args ...interface{}) kebError.ErrorReporter
func PrettyFailures ¶
func PrettyFailures(response *reconcilerApi.HTTPClusterResponse) string
Types ¶
type Client ¶
type Client interface { ApplyClusterConfig(cluster reconcilerApi.Cluster) (*reconcilerApi.HTTPClusterResponse, error) DeleteCluster(clusterName string) error GetCluster(clusterName string, configVersion int64) (*reconcilerApi.HTTPClusterResponse, error) GetLatestCluster(clusterName string) (*reconcilerApi.HTTPClusterResponse, error) GetStatusChange(clusterName, offset string) ([]*reconcilerApi.StatusChange, error) }
type FakeClient ¶
type FakeClient struct {
// contains filtered or unexported fields
}
FakeClient is simulating API and db transactions in Reconciler Inventory
- registeredCluster is representation of 'inventory_clusters' table each unique clusterVersion should be a separate record
- registeredCluster.clusterConfigs is representation of `inventory_cluster_configs` table and it is a map[configVersion]Cluster; it stores different clusterConfigs for the same cluster
- registeredCluster.clusterStates is a map[configVersion]State; it simulates returning the status of given cluster in given configVersion
- registeredCluster.statusChanges is representation of 'inventory_cluster_config_statuses' table and it is a slice of *StatusChange; it contains all status changes for the cluster
calling ApplyClusterConfig method on already existing cluster results in adding a new ClusterConfig
func NewFakeClient ¶
func NewFakeClient() *FakeClient
func (*FakeClient) ApplyClusterConfig ¶
func (c *FakeClient) ApplyClusterConfig(cluster reconcilerApi.Cluster) (*reconcilerApi.HTTPClusterResponse, error)
POST /v1/clusters
func (*FakeClient) ChangeClusterState ¶
func (c *FakeClient) ChangeClusterState(clusterName string, clusterVersion int64, desiredState reconcilerApi.Status)
func (*FakeClient) ClusterExists ¶
func (c *FakeClient) ClusterExists(id string) bool
func (*FakeClient) DeleteCluster ¶
func (c *FakeClient) DeleteCluster(clusterName string) error
DELETE /v1/clusters/{clusterName}
func (*FakeClient) GetCluster ¶
func (c *FakeClient) GetCluster(clusterName string, configVersion int64) (*reconcilerApi.HTTPClusterResponse, error)
GET /v1/clusters/{clusterName}/configs/{configVersion}/status
func (*FakeClient) GetLatestCluster ¶
func (c *FakeClient) GetLatestCluster(clusterName string) (*reconcilerApi.HTTPClusterResponse, error)
GET v1/clusters/{clusterName}/status
func (*FakeClient) GetStatusChange ¶
func (c *FakeClient) GetStatusChange(clusterName, offset string) ([]*reconcilerApi.StatusChange, error)
GET v1/clusters/{clusterName}/statusChanges/{offset} offset is parsed to time.Duration
func (*FakeClient) IsBeingDeleted ¶
func (c *FakeClient) IsBeingDeleted(id string) bool
func (*FakeClient) LastClusterConfig ¶
func (c *FakeClient) LastClusterConfig(runtimeID string) (*reconcilerApi.Cluster, error)
Click to show internal directories.
Click to hide internal directories.