Documentation ¶
Index ¶
- Variables
- func NamesEquate(instance *Instance) error
- type GetRequest
- type GetTemplatesRequest
- type Instance
- type Item
- type ItemStatus
- type ItemStatuses
- type Metadata
- type Server
- func (server *Server) Apply(ctx context.Context, pbInstance *pb.Instance) (*pb.Instance, error)
- func (server *Server) Delete(ctx context.Context, pbInstance *pb.Instance) (*pb.Instance, error)
- func (server *Server) Get(ctx context.Context, getOptions *pb.GetOptions) (*pb.InstanceList, error)
- func (server *Server) GetTemplates(ctx context.Context, _ *pb.Empty) (*pb.InstanceList, error)
Constants ¶
This section is empty.
Variables ¶
var ( // InstanceNameMismatchError indicates a request's Instance.Name and OldInstance.Name do not match InstanceNameMismatchError = status.Error(codes.FailedPrecondition, "Instance.Name and OldInstance.Name do not match") )
Functions ¶
func NamesEquate ¶
NamesEquate ensures Instance Name and OldInstance Name are the same
Types ¶
type GetRequest ¶
type GetRequest struct { *pb.GetOptions *pb.InstanceList // contains filtered or unexported fields }
GetRequest represents a get request
func NewGetRequest ¶
func NewGetRequest(getOptions *pb.GetOptions, server *Server) *GetRequest
NewGetRequest returns an instantiated GetRequest
type GetTemplatesRequest ¶
type GetTemplatesRequest struct { *pb.InstanceList // contains filtered or unexported fields }
GetTemplatesRequest represents a get request
func NewGetTemplatesRequest ¶
func NewGetTemplatesRequest(server *Server) *GetTemplatesRequest
NewGetTemplatesRequest returns an instantiated GetTemplatesRequest
func (*GetTemplatesRequest) Run ¶
func (request *GetTemplatesRequest) Run() error
Run runs the GetTemplatesRequest
type Instance ¶
type Instance struct { *pb.Instance InstanceDir string InstanceFile string // contains filtered or unexported fields }
Instance represents an overlay Instance
func NewInstance ¶
NewInstance returns an instantiated Instance
func (*Instance) KustomizeBuild ¶
KustomizeBuild runs `kustomize build <dir>` to validate that it succeeds
func (*Instance) LoadStatuses ¶
LoadStatuses loads status information from Kubernetes into the Instance struct
type Item ¶
type Item struct { Kind string `yaml:"kind"` Metadata Metadata `yaml:"metadata"` Labels map[string]string `yaml:"labels"` Status ItemStatus `yaml:"status"` }
Item represents a Kubernetes Object
type ItemStatus ¶
type ItemStatus struct { AvailableReplicas int32 `yaml:"availableReplicas"` ReadyReplicas int32 `yaml:"readyReplicas"` DesiredReplicas int32 `yaml:"replicas"` UpdatedReplicas int32 `yaml:"updatedReplicas"` }
ItemStatus respresents the status of a Kubernetes Object
type ItemStatuses ¶
type ItemStatuses struct {
Items []Item `yaml:"items"`
}
ItemStatuses represents a list of ItemStatuses
type Server ¶
type Server struct { InstancesDir string TemplatesDir string StateStore state.Engine EnableKustomizeBuild bool EnableKubectl bool }
Server is the interface for interacting with Instances
func NewInstancesServer ¶
func NewInstancesServer(instancesDir, templatesDir string, stateStore state.Engine, enableKustomizeBuild, enableKubectl bool) *Server
NewInstancesServer returns an instantiated InstanceServer
func (*Server) Apply ¶
Apply adds/updates the given Instance, applies it to Kubernetes if desired, and commits the changes, rolling back as necessary
func (*Server) Get ¶
func (server *Server) Get(ctx context.Context, getOptions *pb.GetOptions) (*pb.InstanceList, error)
Get returns Instance(s) from the State Store, optionally with status information from Kubernetes
func (*Server) GetTemplates ¶
GetTemplates returns a list of Instance templates from the State Store