Documentation
¶
Index ¶
Constants ¶
View Source
const ( RoleProjectAdmin int = 1 RoleDeveloper int = 2 RoleGuest int = 3 )
Harbor project role IDs.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
// EnsureProject ensures a Harbor project with the given name exists.
EnsureProject(ctx context.Context, projectName string) error
// ReconcileProjectMembers synchronizes the Harbor project membership to match
// the desired list of members. It adds missing members, updates roles that
// have changed, and removes members that are no longer desired.
ReconcileProjectMembers(ctx context.Context, projectName string, desired []ProjectMember) error
// EnsureRobotAccount ensures a robot account exists for the given project.
// Returns the credentials and whether the robot was newly created.
// If the robot already exists, created is false and credentials are nil.
EnsureRobotAccount(ctx context.Context, projectName string, robotName string) (creds *RobotCredentials, created bool, err error)
}
Client defines the operations needed for workspace Harbor integration.
type ProjectMember ¶ added in v0.8.7
ProjectMember represents a desired Harbor project member.
type RobotCredentials ¶
type RobotCredentials struct {
Name string // full robot name, e.g. robot$workspace-mynamespace
Secret string // the token/password
}
RobotCredentials holds the credentials returned by Harbor for a robot account.
Click to show internal directories.
Click to hide internal directories.