Documentation
¶
Index ¶
- Variables
- func JsonIfYaml(source []byte, filename string) ([]byte, error)
- func LoadKubernetesResource(jsonData []byte) (runtime.Object, error)
- func LoadKubernetesResourceFromFile(path string) (runtime.Object, error)
- type OSClient
- func (osClient *OSClient) Delete(ns string, label string) error
- func (osClient *OSClient) GetDC(ns string, dcName string) (osappsv1.DeploymentConfig, error)
- func (osClient *OSClient) GetPod(ns string, dc string) (v1.Pod, error)
- func (osClient *OSClient) ProcessTemplate(tmpl *v12.Template, params map[string]string, TemplateDefaultOpts TemplateOpt) ([]runtime.RawExtension, error)
- func (osClient *OSClient) UpdateDC(ns string, dc *osappsv1.DeploymentConfig) error
- type OSClientInterface
- type OSClientInterfaceMock
- func (mock *OSClientInterfaceMock) Delete(ns string, label string) error
- func (mock *OSClientInterfaceMock) DeleteCalls() []struct{ ... }
- func (mock *OSClientInterfaceMock) GetDC(ns string, dcName string) (appsv1.DeploymentConfig, error)
- func (mock *OSClientInterfaceMock) GetDCCalls() []struct{ ... }
- func (mock *OSClientInterfaceMock) GetPod(ns string, dc string) (v1.Pod, error)
- func (mock *OSClientInterfaceMock) GetPodCalls() []struct{ ... }
- func (mock *OSClientInterfaceMock) ProcessTemplate(in1 *tmplv1.Template, in2 map[string]string, in3 TemplateOpt) ([]runtime.RawExtension, error)
- func (mock *OSClientInterfaceMock) ProcessTemplateCalls() []struct{ ... }
- func (mock *OSClientInterfaceMock) UpdateDC(ns string, dc *appsv1.DeploymentConfig) error
- func (mock *OSClientInterfaceMock) UpdateDCCalls() []struct{ ... }
- type Template
- type TemplateHandler
- type TemplateOpt
Constants ¶
This section is empty.
Variables ¶
View Source
var (
TemplateDefaultOpts = TemplateOpt{
ApiVersion: "v1",
ApiMimetype: "application/json",
ApiPath: "/apis",
ApiGroup: "template.openshift.io",
ApiResource: "processedtemplates",
}
)
Functions ¶
Types ¶
type OSClient ¶
type OSClient struct {
TmplHandler TemplateHandler
// contains filtered or unexported fields
}
func NewOSClient ¶
func NewOSClient(kubeClient kubernetes.Interface, routeClient routev1.RouteV1Interface, dcClient appsv1.AppsV1Interface, tmpl TemplateHandler) (*OSClient, error)
func (*OSClient) ProcessTemplate ¶
func (osClient *OSClient) ProcessTemplate(tmpl *v12.Template, params map[string]string, TemplateDefaultOpts TemplateOpt) ([]runtime.RawExtension, error)
type OSClientInterface ¶
type OSClientInterface interface {
GetDC(ns string, dcName string) (v14.DeploymentConfig, error)
UpdateDC(ns string, dc *v14.DeploymentConfig) error
GetPod(ns string, dc string) (v1.Pod, error)
Delete(ns string, label string) error
ProcessTemplate(*v1template.Template, map[string]string, TemplateOpt) ([]runtime.RawExtension, error)
}
type OSClientInterfaceMock ¶
type OSClientInterfaceMock struct {
// DeleteFunc mocks the Delete method.
DeleteFunc func(ns string, label string) error
// GetDCFunc mocks the GetDC method.
GetDCFunc func(ns string, dcName string) (appsv1.DeploymentConfig, error)
// GetPodFunc mocks the GetPod method.
GetPodFunc func(ns string, dc string) (v1.Pod, error)
// ProcessTemplateFunc mocks the ProcessTemplate method.
ProcessTemplateFunc func(in1 *tmplv1.Template, in2 map[string]string, in3 TemplateOpt) ([]runtime.RawExtension, error)
// UpdateDCFunc mocks the UpdateDC method.
UpdateDCFunc func(ns string, dc *appsv1.DeploymentConfig) error
// contains filtered or unexported fields
}
OSClientInterfaceMock is a mock implementation of OSClientInterface.
func TestSomethingThatUsesOSClientInterface(t *testing.T) {
// make and configure a mocked OSClientInterface
mockedOSClientInterface := &OSClientInterfaceMock{
DeleteFunc: func(ns string, label string) error {
panic("mock out the Delete method")
},
GetDCFunc: func(ns string, dcName string) (v1.DeploymentConfig, error) {
panic("mock out the GetDC method")
},
GetPodFunc: func(ns string, dc string) (v1.Pod, error) {
panic("mock out the GetPod method")
},
ProcessTemplateFunc: func(in1 *v1.Template, in2 map[string]string, in3 TemplateOpt) ([]runtime.RawExtension, error) {
panic("mock out the ProcessTemplate method")
},
UpdateDCFunc: func(ns string, dc *v1.DeploymentConfig) error {
panic("mock out the UpdateDC method")
},
}
// use mockedOSClientInterface in code that requires OSClientInterface
// and then make assertions.
}
func (*OSClientInterfaceMock) Delete ¶
func (mock *OSClientInterfaceMock) Delete(ns string, label string) error
Delete calls DeleteFunc.
func (*OSClientInterfaceMock) DeleteCalls ¶
func (mock *OSClientInterfaceMock) DeleteCalls() []struct { Ns string Label string }
DeleteCalls gets all the calls that were made to Delete. Check the length with:
len(mockedOSClientInterface.DeleteCalls())
func (*OSClientInterfaceMock) GetDC ¶
func (mock *OSClientInterfaceMock) GetDC(ns string, dcName string) (appsv1.DeploymentConfig, error)
GetDC calls GetDCFunc.
func (*OSClientInterfaceMock) GetDCCalls ¶
func (mock *OSClientInterfaceMock) GetDCCalls() []struct { Ns string DcName string }
GetDCCalls gets all the calls that were made to GetDC. Check the length with:
len(mockedOSClientInterface.GetDCCalls())
func (*OSClientInterfaceMock) GetPod ¶
func (mock *OSClientInterfaceMock) GetPod(ns string, dc string) (v1.Pod, error)
GetPod calls GetPodFunc.
func (*OSClientInterfaceMock) GetPodCalls ¶
func (mock *OSClientInterfaceMock) GetPodCalls() []struct { Ns string Dc string }
GetPodCalls gets all the calls that were made to GetPod. Check the length with:
len(mockedOSClientInterface.GetPodCalls())
func (*OSClientInterfaceMock) ProcessTemplate ¶
func (mock *OSClientInterfaceMock) ProcessTemplate(in1 *tmplv1.Template, in2 map[string]string, in3 TemplateOpt) ([]runtime.RawExtension, error)
ProcessTemplate calls ProcessTemplateFunc.
func (*OSClientInterfaceMock) ProcessTemplateCalls ¶
func (mock *OSClientInterfaceMock) ProcessTemplateCalls() []struct { In1 *tmplv1.Template In2 map[string]string In3 TemplateOpt }
ProcessTemplateCalls gets all the calls that were made to ProcessTemplate. Check the length with:
len(mockedOSClientInterface.ProcessTemplateCalls())
func (*OSClientInterfaceMock) UpdateDC ¶
func (mock *OSClientInterfaceMock) UpdateDC(ns string, dc *appsv1.DeploymentConfig) error
UpdateDC calls UpdateDCFunc.
func (*OSClientInterfaceMock) UpdateDCCalls ¶
func (mock *OSClientInterfaceMock) UpdateDCCalls() []struct { Ns string Dc *appsv1.DeploymentConfig }
UpdateDCCalls gets all the calls that were made to UpdateDC. Check the length with:
len(mockedOSClientInterface.UpdateDCCalls())
type Template ¶
func NewTemplate ¶
func (*Template) FillParams ¶
func (template *Template) FillParams(tmpl *v1template.Template, params map[string]string)
func (*Template) Process ¶
func (template *Template) Process(tmpl *v1template.Template, params map[string]string, opts TemplateOpt) ([]runtime.RawExtension, error)
type TemplateHandler ¶
type TemplateHandler interface {
Process(tmpl *v1template.Template, params map[string]string, opts TemplateOpt) ([]runtime.RawExtension, error)
FillParams(tmpl *v1template.Template, params map[string]string)
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.