statushelper

package
v0.0.0-...-4729a3b Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package statushelper provides helper functions for checking the status of various agent functionalities like IAM roles, package versions etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAgentEnabledAndRunning

func CheckAgentEnabledAndRunning(ctx context.Context, agentName string, osType string, exec commandlineexecutor.Execute) (isEnabled bool, isRunning bool, err error)

CheckAgentEnabledAndRunning returns the status of the agent service.

Returns a tuple as (isEnabled, isRunning, error).

func CheckIAMRoles

func CheckIAMRoles(ctx context.Context, projectID string, requiredRoles []string) error

CheckIAMRoles checks if the required IAM roles are present.

func KernelVersion

func KernelVersion(ctx context.Context, osType string, exec commandlineexecutor.Execute) (*spb.KernelVersion, error)

KernelVersion returns the kernel version data for the system.

func LatestVersionArtifactRegistry

func LatestVersionArtifactRegistry(ctx context.Context, arClient ARClientInterface, projectName string, repositoryLocation string, repositoryName string, packageName string) (string, error)

LatestVersionArtifactRegistry returns latest version of the agent package from artifact registry.

func PrintStatus

func PrintStatus(ctx context.Context, status *spb.AgentStatus, compact bool)

PrintStatus prints the status of the agent and the configured services to the console with appropriate formatting and coloring.

Types

type ARClientInterface

type ARClientInterface interface {
	ListVersions(ctx context.Context, req *arpb.ListVersionsRequest, opts ...gax.CallOption) VersionIterator
}

ARClientInterface is an interface for the Google Artifact Registry client.

type ArtifactRegistryClient

type ArtifactRegistryClient struct {
	Client *artifactregistry.Client
}

ArtifactRegistryClient is a wrapper for the Google Artifact Registry client.

func (*ArtifactRegistryClient) ListVersions

func (arClient *ArtifactRegistryClient) ListVersions(ctx context.Context, req *arpb.ListVersionsRequest, opts ...gax.CallOption) VersionIterator

ListVersions lists the versions of a package in Artifact Registry.

type VersionIterator

type VersionIterator interface {
	Next() (*arpb.Version, error)
}

VersionIterator is an interface for the Google Artifact Registry client.

Jump to

Keyboard shortcuts

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