Documentation
¶
Overview ¶
Package k8s provides Kubernetes API access for the krci CLI.
Index ¶
Constants ¶
const ( QualityGateTypeAutotests = "autotests" QualityGateTypeManual = "manual" )
Quality gate type constants.
const ( StatusCreated = "created" StatusInProgress = "in_progress" StatusFailed = "failed" )
Status constants shared across KubeRocketCI CRD resources.
Variables ¶
This section is empty.
Functions ¶
func NewDynamicClient ¶
func NewDynamicClient(cfg ClientConfig) (dynamic.Interface, error)
NewDynamicClient creates a dynamic Kubernetes client using the provided config. The OIDC token is fetched via TokenFunc at creation time.
Types ¶
type ClientConfig ¶
type ClientConfig struct {
APIServer string
CAData string
TokenFunc func(ctx context.Context) (string, error)
}
ClientConfig holds connection parameters for the Kubernetes API server. All values are stored in krci config — no kubeconfig file dependency.
type Deployment ¶
type Deployment struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Applications []string `json:"applications"`
StageNames []string `json:"stages"`
Description string `json:"description,omitempty"`
Status string `json:"status"`
Available bool `json:"available"`
}
Deployment represents a KubeRocketCI CDPipeline resource.
type DeploymentDetail ¶
type DeploymentDetail struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Applications []string `json:"applications"`
Description string `json:"description,omitempty"`
Status string `json:"status"`
Available bool `json:"available"`
Stages []Stage `json:"stages"`
}
DeploymentDetail represents a CDPipeline with its associated Stages.
type DeploymentService ¶
type DeploymentService struct {
// contains filtered or unexported fields
}
DeploymentService provides access to CDPipeline and Stage resources.
func NewDeploymentService ¶
func NewDeploymentService(client dynamic.Interface, namespace string) *DeploymentService
NewDeploymentService creates a DeploymentService for the given namespace.
func (*DeploymentService) Get ¶
func (s *DeploymentService) Get(ctx context.Context, name string) (*DeploymentDetail, error)
Get returns a single CDPipeline with its Stages sorted by order.
func (*DeploymentService) List ¶
func (s *DeploymentService) List(ctx context.Context) ([]Deployment, error)
List returns all CDPipelines with their stage names ordered by spec.order.
type Project ¶
type Project struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Type string `json:"type"`
Language string `json:"language"`
BuildTool string `json:"buildTool"`
Framework string `json:"framework,omitempty"`
GitServer string `json:"gitServer"`
GitURL string `json:"gitUrl,omitempty"`
Status string `json:"status"`
Available bool `json:"available"`
}
Project represents a KubeRocketCI Codebase resource.
type ProjectService ¶
type ProjectService struct {
// contains filtered or unexported fields
}
ProjectService provides access to Codebase resources.
func NewProjectService ¶
func NewProjectService(client dynamic.Interface, namespace string) *ProjectService
NewProjectService creates a ProjectService for the given namespace.
type QualityGate ¶
QualityGate represents a quality gate step within a Stage.
type Stage ¶
type Stage struct {
Name string `json:"name"`
Order int64 `json:"order"`
TriggerType string `json:"triggerType"`
QualityGates []QualityGate `json:"qualityGates"`
Namespace string `json:"namespace"`
ClusterName string `json:"clusterName,omitempty"`
Description string `json:"description,omitempty"`
Status string `json:"status"`
Available bool `json:"available"`
}
Stage represents a KubeRocketCI Stage resource belonging to a CDPipeline.