Documentation ¶
Index ¶
- Constants
- func DefaultNamespaceValidator(namespace string) bool
- func NsNameGen(jobs jenkins.JobsParameters) string
- type Client
- func (k *Client) CloneIngresses(dstNamespace string, projects []string) (*CloneIngressResponse, error)
- func (k *Client) CreateConfigMap(data *CloneIngressResponse, projectJobMap map[string]string, ...) error
- func (k *Client) CreateCronjob(namespace string, stable bool, deleteSecret string) error
- func (k *Client) CreateNamespace(namespace string, stable bool) error
- func (k *Client) DeleteNamespace(namespace string) error
- func (k *Client) GetConfigMap(namespace, cmName string) (*CloneIngressResponse, map[string]string, error)
- func (k *Client) NamespaceAlreadyCreated(namespace string) bool
- func (k *Client) NamespaceManagedList() (nslist []MyNameSpace, err error)
- func (k *Client) NsConstraintReqs() error
- func (k *Client) UnderMaxNsLimit() (bool, error)
- func (k *Client) UnderMaxStableNsLimit() (bool, error)
- type CloneIngressResponse
- type MyNameSpace
Constants ¶
const ( JobsLabelConfigmap = "jobs" DeleteSecret = "delete_secret" )
Variables ¶
This section is empty.
Functions ¶
func DefaultNamespaceValidator ¶
DefaultNamespaceValidator is a function that change the namespace adding a prefix
func NsNameGen ¶
func NsNameGen(jobs jenkins.JobsParameters) string
NsNameGen is the function that return the unique namespace
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
KubernetesClient is a struct that inherits all the capabilities of a needed kubernetes datas
func NewKubernetesClient ¶
NewKubernetesClient initialize the Client struct
func (*Client) CloneIngresses ¶
func (k *Client) CloneIngresses(dstNamespace string, projects []string) (*CloneIngressResponse, error)
CloneIngresses will clone ingresses from a source namespace
func (*Client) CreateConfigMap ¶
func (k *Client) CreateConfigMap(data *CloneIngressResponse, projectJobMap map[string]string, deleteSecret string) error
CreateConfigMap is a function that allow to create a configMap in a namespace with a specific content
func (*Client) CreateCronjob ¶
CreateCronjob will create the seppuku cronjob for self-killing task
func (*Client) CreateNamespace ¶
CreateNamespace will create a kubernetes namespace adding stable labels
func (*Client) DeleteNamespace ¶
DeleteNamespace if a function useful to delete namespace
func (*Client) GetConfigMap ¶
func (k *Client) GetConfigMap(namespace, cmName string) (*CloneIngressResponse, map[string]string, error)
GetConfigMap is a function that allow to fetch the data in a configmap, with error
func (*Client) NamespaceAlreadyCreated ¶
NamespaceAlreadyCreated check if the namespace is already created or not
func (*Client) NamespaceManagedList ¶
func (k *Client) NamespaceManagedList() (nslist []MyNameSpace, err error)
NamespaceManagedList will list all kubernetes namespace handled by one
func (*Client) NsConstraintReqs ¶
NsConstraintReqs check the ns constraints
func (*Client) UnderMaxNsLimit ¶
UnderMaxNsLimit check the ns number limits
func (*Client) UnderMaxStableNsLimit ¶
UnderMaxStableNsLimit check the number of stable ns
type CloneIngressResponse ¶
type CloneIngressResponse struct { ProjectsWithDetails utils.StatusPerProject `json:"projects_with_details" yaml:"projects_with_details"` NamespaceCreated string `json:"namespace_created" yaml:"namespace_created"` }
CloneIngressResponse give the response from cloneIngress
func EnrichCloneIngressResp ¶
func EnrichCloneIngressResp(jobStatus jenkins.JobsStatuses, cloneIngressResp *CloneIngressResponse, jobParams *jenkins.JobsParameters) *CloneIngressResponse
jobStatuses :: {jobName: status} jobParams :: { stable? : ... , CommitPerProject : { projectName: { ...Commit ... }}} cloneIngressResp :: {projects_with_details : { projectName: { jobName : ... , CSVRefs : ... } } }
type MyNameSpace ¶
type MyNameSpace struct { Name string `json:"name" yaml:"name"` Stable bool `json:"stable" yaml:"stable"` Status string `json:"status" yaml:"status"` }
MyNameSpace describe the namespace informations needed