k8s

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package k8s provides Kubernetes API access for the krci CLI.

Index

Constants

View Source
const (
	QualityGateTypeAutotests = "autotests"
	QualityGateTypeManual    = "manual"
)

Quality gate type constants.

View Source
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

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.

func (*ProjectService) Get

func (s *ProjectService) Get(ctx context.Context, name string) (*Project, error)

Get returns a single Codebase by name.

func (*ProjectService) List

func (s *ProjectService) List(ctx context.Context) ([]Project, error)

List returns all Codebases in the configured namespace.

type QualityGate

type QualityGate struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL