Documentation
¶
Index ¶
- Variables
- func CheckHarborLogin(registry string) error
- func LogDebug(format string, args ...interface{})
- func LogError(format string, args ...interface{})
- func LogFatal(format string, args ...interface{})
- func LogInfo(format string, args ...interface{})
- func LogWarning(format string, args ...interface{})
- func MirrorArtifacts(manifest *ArtifactManifest, cacheDir, targetRegistry string, ...) error
- func NewDynactlKeychain() authn.Keychain
- func PullArtifacts(manifest *ArtifactManifest, outputDir string, options PullOptions) error
- func PullManifestFromRegistry(reference, outputDir string) error
- func SaveRegistryCredential(registry string, cred RegistryCredential) error
- func SetLogLevel(verbosity int)
- type ArtifactManifest
- type Artifacts
- type Chart
- type Component
- type ContainerResourceSummary
- type DeploymentResourceSummary
- type KubernetesChecker
- func (kc *KubernetesChecker) CheckClusterRBAC() (string, error)
- func (kc *KubernetesChecker) CheckKubernetesVersion() (string, error)
- func (kc *KubernetesChecker) CheckNamespaceRBAC(namespace string) (string, error)
- func (kc *KubernetesChecker) CheckResources(outputFormat string) (string, error)
- func (kc *KubernetesChecker) CheckStorageCapacity() (string, error)
- func (kc *KubernetesChecker) CheckStorageClassesCompatibility() (string, error)
- func (kc *KubernetesChecker) GetNodeResourceUsage(nodeName string) (*NodeResourceUsage, error)
- func (kc *KubernetesChecker) ListDeploymentResourceSummaries(namespace string) ([]DeploymentResourceSummary, error)
- func (kc *KubernetesChecker) ListNodeInstanceTypes() (map[string]string, error)
- type LogLevel
- type MirrorOptions
- type NodeResourceUsage
- type PullOptions
- type PullResult
- type RegistryCredential
- type SPOC
Constants ¶
This section is empty.
Variables ¶
var ( // CurrentLogLevel is the current logging level CurrentLogLevel = LogLevelInfo // LogOutput is the output writer for logs LogOutput io.Writer = os.Stdout )
Functions ¶
func CheckHarborLogin ¶
CheckHarborLogin checks if the user is logged into Harbor
func LogFatal ¶
func LogFatal(format string, args ...interface{})
LogFatal logs a fatal error and exits
func LogWarning ¶
func LogWarning(format string, args ...interface{})
LogWarning logs a warning message
func MirrorArtifacts ¶
func MirrorArtifacts(manifest *ArtifactManifest, cacheDir, targetRegistry string, options MirrorOptions) error
MirrorArtifacts pushes selected artifacts from the local cache into a target registry. Currently only container images are supported.
func NewDynactlKeychain ¶
NewDynactlKeychain returns an authn.Keychain that prefers Docker credentials but falls back to dynactl's credential store.
func PullArtifacts ¶
func PullArtifacts(manifest *ArtifactManifest, outputDir string, options PullOptions) error
PullArtifacts pulls all artifacts specified in the manifest from Harbor
func PullManifestFromRegistry ¶
PullManifestFromRegistry pulls a manifest artifact into the specified directory using the ORAS Go SDK.
func SaveRegistryCredential ¶
func SaveRegistryCredential(registry string, cred RegistryCredential) error
SaveRegistryCredential stores credentials for a registry in the dynactl credential store.
func SetLogLevel ¶
func SetLogLevel(verbosity int)
SetLogLevel sets the current logging level based on verbosity
Types ¶
type ArtifactManifest ¶
type ArtifactManifest struct {
CustomerID string `json:"customer_id"`
CustomerName string `json:"customer_name"`
ReleaseVersion string `json:"release_version"`
OnboardingDate string `json:"onboarding_date"`
LicenseGeneratedAt *string `json:"license_generated_at"`
LicenseExpiry *string `json:"license_expiry"`
MaxUsers *int `json:"max_users"`
SPOC SPOC `json:"spoc"`
Artifacts Artifacts `json:"artifacts"`
Images []string `json:"images"` // Array of OCI URIs
Models []string `json:"models"` // Array of OCI URIs
Charts []Chart `json:"charts"`
}
ArtifactManifest represents the structure of the manifest file
func LoadManifest ¶
func LoadManifest(filename string) (*ArtifactManifest, error)
LoadManifest loads and parses the manifest file
type Artifacts ¶
type Artifacts struct {
ChartsRoot string `json:"charts_root"`
ImagesRoot string `json:"images_root"`
ModelsRoot string `json:"models_root"`
}
Artifacts represents the root paths for different artifact types
type Chart ¶
type Chart struct {
Name string `json:"name"`
Version string `json:"version"`
AppVersion string `json:"appVersion"`
Filename string `json:"filename"`
HarborPath string `json:"harbor_path"`
SHA256 string `json:"sha256"`
SizeBytes int64 `json:"size_bytes"`
}
Chart represents a Helm chart with additional metadata
type Component ¶
type Component struct {
Name string
Type string
URI string
Tag string
Digest string
MediaType string
}
Component represents a unified artifact component for processing
type ContainerResourceSummary ¶
type ContainerResourceSummary struct {
Name string
RequestsCPU string
RequestsMemory string
RequestsGPU string
LimitsCPU string
LimitsMemory string
LimitsGPU string
}
ContainerResourceSummary holds resource info for a container
type DeploymentResourceSummary ¶
type DeploymentResourceSummary struct {
Name string
Pods int32
Containers []ContainerResourceSummary
}
DeploymentResourceSummary holds resource info for a deployment
type KubernetesChecker ¶
type KubernetesChecker struct {
// contains filtered or unexported fields
}
KubernetesChecker handles Kubernetes cluster checks
func NewKubernetesChecker ¶
func NewKubernetesChecker() (*KubernetesChecker, error)
NewKubernetesChecker creates a new Kubernetes checker
func (*KubernetesChecker) CheckClusterRBAC ¶
func (kc *KubernetesChecker) CheckClusterRBAC() (string, error)
CheckClusterRBAC checks cluster-level RBAC permissions using SelfSubjectAccessReview
func (*KubernetesChecker) CheckKubernetesVersion ¶
func (kc *KubernetesChecker) CheckKubernetesVersion() (string, error)
CheckKubernetesVersion returns the Kubernetes cluster server version
func (*KubernetesChecker) CheckNamespaceRBAC ¶
func (kc *KubernetesChecker) CheckNamespaceRBAC(namespace string) (string, error)
CheckNamespaceRBAC checks RBAC permissions in the specified namespace using SelfSubjectAccessReview
func (*KubernetesChecker) CheckResources ¶
func (kc *KubernetesChecker) CheckResources(outputFormat string) (string, error)
CheckResources checks available CPU and memory resources
func (*KubernetesChecker) CheckStorageCapacity ¶
func (kc *KubernetesChecker) CheckStorageCapacity() (string, error)
CheckStorageCapacity checks available storage capacity
func (*KubernetesChecker) CheckStorageClassesCompatibility ¶
func (kc *KubernetesChecker) CheckStorageClassesCompatibility() (string, error)
CheckStorageClassesCompatibility checks StorageClasses for common database compatibility
func (*KubernetesChecker) GetNodeResourceUsage ¶
func (kc *KubernetesChecker) GetNodeResourceUsage(nodeName string) (*NodeResourceUsage, error)
GetNodeResourceUsage calculates resource usage percentages for a specific node
func (*KubernetesChecker) ListDeploymentResourceSummaries ¶
func (kc *KubernetesChecker) ListDeploymentResourceSummaries(namespace string) ([]DeploymentResourceSummary, error)
ListDeploymentResourceSummaries lists deployments and summarizes container resource requests/limits
func (*KubernetesChecker) ListNodeInstanceTypes ¶
func (kc *KubernetesChecker) ListNodeInstanceTypes() (map[string]string, error)
ListNodeInstanceTypes returns a mapping of node name to instance type label
type LogLevel ¶
type LogLevel int
LogLevel represents the logging level
func LogLevelFromString ¶
LogLevelFromString converts a string to a LogLevel
type MirrorOptions ¶
MirrorOptions describes which artifact categories to mirror.
func MirrorOptionsFromPull ¶
func MirrorOptionsFromPull(opts PullOptions) MirrorOptions
MirrorOptionsFromPull converts pull options to mirror options.
func NormalizeMirrorOptions ¶
func NormalizeMirrorOptions(opts MirrorOptions) MirrorOptions
NormalizeMirrorOptions ensures at least one artifact category is included.
type NodeResourceUsage ¶
type NodeResourceUsage struct {
Name string
CPURequests float64
CPULimits float64
MemoryRequests float64
MemoryLimits float64
GPURequests int64
GPULimits int64
CPUAllocatable float64
MemoryAllocatable float64
GPUAllocatable int64
CPURequestsPercent float64
CPULimitsPercent float64
MemoryRequestsPercent float64
MemoryLimitsPercent float64
}
NodeResourceUsage holds resource usage information for a node
type PullOptions ¶
PullOptions controls which artifact categories are processed.
func NormalizePullOptions ¶
func NormalizePullOptions(opts PullOptions) PullOptions
NormalizePullOptions enables all artifact categories if none are explicitly selected.
type PullResult ¶
type PullResult struct {
TotalArtifacts int
SuccessCount int
FailedCount int
Duration time.Duration
Errors []string
}
PullResult represents the result of pulling artifacts
type RegistryCredential ¶
type RegistryCredential struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
IdentityToken string `json:"identity_token,omitempty"`
AccessToken string `json:"access_token,omitempty"`
}
RegistryCredential represents the persisted credential fields for a registry.
func GetRegistryCredential ¶
func GetRegistryCredential(registry string) (RegistryCredential, bool, error)
GetRegistryCredential retrieves a credential from the dynactl credential store.