Documentation ¶
Overview ¶
Package utils provides utils.
Package utils provides utils.
Package utils provides utils.
Index ¶
- func AddUserToProject(client *harborcli.HarborAPI, userID string, projectID int32, role int64) error
- func CheckHarborUserExist(client *harborcli.HarborAPI, userID string) (bool, error)
- func CheckProjectMemberExist(client *harborcli.HarborAPI, userID string, projectID int64) (bool, error)
- func CheckUserReady(ctx context.Context, client *kubernetes.Clientset, userID string) (bool, error)
- func CopyArtifact(client *harborcli.HarborAPI, projectName string, destRepo string, src string) error
- func CreateConfigMap(ctx context.Context, client *kubernetes.Clientset, ns string, cm *v1.ConfigMap) (*v1.ConfigMap, error)
- func CreateHarborProject(client *harborcli.HarborAPI, name string, isPublic string, limit *int64) error
- func CreateHarborUser(client *harborcli.HarborAPI, userID string, passwd string, realName string, ...) error
- func CreateK8sDockerRegistrySecret(client *kubernetes.Clientset, ns string, registry string, username string, ...) error
- func CreateNamespace(ctx context.Context, client *kubernetes.Clientset, ns string) error
- func CreateNetworkPolicy(ctx context.Context, client *kubernetes.Clientset, ns string) error
- func CreateReplicationPolicy(client *harborcli.HarborAPI, namespace string, repo string, tag string, ...) error
- func CreateUserRoleBindingWithEdit(ctx context.Context, client *kubernetes.Clientset, ns, userID string) error
- func DeleteArtifact(client *harborcli.HarborAPI, projectName string, repo string, reference string) error
- func DeleteReplicationPolicy(client *harborcli.HarborAPI, policyID int64) error
- func DeleteRepository(client *harborcli.HarborAPI, projectName string, repo string) error
- func GenerateConfigMap(name string, generateName string, labels map[string]string, ...) *v1.ConfigMap
- func GetChartrepoRepoCharts(client *harborcli.HarborAPI, repo string) ([]*models.ChartInfoEntry, error)
- func GetChartrepoRepoChartsName(client *harborcli.HarborAPI, repo string, name string) (models.ChartVersions, error)
- func GetChartrepoRepoChartsNameVersion(client *harborcli.HarborAPI, repo string, name string, version string) (*models.ChartVersionDetails, error)
- func GetConfigMapList(client *kubernetes.Clientset, ns string, labelSelector string) (*v1.ConfigMapList, error)
- func GetContainerLog(ctx context.Context, client *kubernetes.Clientset, userID string, ...) (io.ReadCloser, error)
- func GetEnvDefault(env, defaultValue string) string
- func GetHarborClient(host string, basepath string, schemes []string) *harborcli.HarborAPI
- func GetKubernetesClient() (*kubernetes.Clientset, error)
- func GetPodList(client *kubernetes.Clientset, labelSelector string, ns string) (*[]v1.Pod, error)
- func GetPodStatus(client *kubernetes.Clientset, labelSelector string, ns string) (v1.PodPhase, error)
- func GetPolicyExecution(client *harborcli.HarborAPI, policyID int64) (*models.ReplicationExecution, error)
- func GetProjectIDByName(client *harborcli.HarborAPI, projectName string) (int32, error)
- func GetProjectRepositories(client *harborcli.HarborAPI, projectName string, filter *string) ([]*models.Repository, error)
- func GetProjectRepositoryArtifacts(client *harborcli.HarborAPI, projectName string, repoName string) ([]*models.Artifact, error)
- func GetRegistries(client *harborcli.HarborAPI) ([]*models.Registry, error)
- func GetReplicationExecution(client *harborcli.HarborAPI, policyID int64) (*models.ReplicationExecution, error)
- func GetReplicationPolicies(client *harborcli.HarborAPI) ([]*models.ReplicationPolicy, error)
- func GetReplicationPolicyByID(client *harborcli.HarborAPI, policyID int64) (*models.ReplicationPolicy, error)
- func GetReplicationPolicyIDByName(client *harborcli.HarborAPI, policyName string) (int64, error)
- func GetRepository(client *harborcli.HarborAPI, projectName string, repo string) (*models.Repository, error)
- func GetRuntimeLocation() string
- func GetServiceList(client *kubernetes.Clientset, labelSelector string, ns string) (*[]v1.Service, error)
- func GetSpecifyInvolvedObjectEventList(client *kubernetes.Clientset, involvedObjectName string, ns string) (*[]v1.Event, error)
- func MarkUserAsReady(ctx context.Context, client *kubernetes.Clientset, userID string) error
- func PostChartrepoRepoCharts(client *harborcli.HarborAPI, repo string, chart runtime.NamedReadCloser) error
- func RandCode(n int) string
- func RandStr(strlen int) string
- func RunReplicationExecution(client *harborcli.HarborAPI, policyID int64) error
- func StopReplicationExecution(client *harborcli.HarborAPI, executionID int64) error
- func UpdateConfigMap(ctx context.Context, client *kubernetes.Clientset, ns string, cm *v1.ConfigMap) (*v1.ConfigMap, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddUserToProject ¶
func AddUserToProject(client *harborcli.HarborAPI, userID string, projectID int32, role int64) error
AddUserToProject 在project中给用户设置权限
func CheckHarborUserExist ¶
CheckHarborUserExist 判断harbor用户是否被创建
func CheckProjectMemberExist ¶
func CheckProjectMemberExist(client *harborcli.HarborAPI, userID string, projectID int64) (bool, error)
CheckProjectMemberExist 判断用户是否是project的member
func CheckUserReady ¶
func CopyArtifact ¶
func CopyArtifact(client *harborcli.HarborAPI, projectName string, destRepo string, src string) error
CopyArtifact copy artifact 到其他repo
func CreateConfigMap ¶
func CreateHarborProject ¶
func CreateHarborProject(client *harborcli.HarborAPI, name string, isPublic string, limit *int64) error
CreateHarborProject 创建用户自己的project
func CreateHarborUser ¶
func CreateHarborUser(client *harborcli.HarborAPI, userID string, passwd string, realName string, email string) error
CreateHarborUser 创建harbor用户
func CreateNamespace ¶
func CreateNetworkPolicy ¶
CreateNetworkPolicy TODO: check all networking policy
func CreateReplicationPolicy ¶
func CreateReplicationPolicy(client *harborcli.HarborAPI, namespace string, repo string, tag string, name string, registryID int64) error
CreateReplicationPolicy 创建replication policy
func DeleteArtifact ¶
func DeleteArtifact(client *harborcli.HarborAPI, projectName string, repo string, reference string) error
DeleteArtifact 删除artifact
func DeleteReplicationPolicy ¶
DeleteReplicationPolicy 删除指定的replication policy
func DeleteRepository ¶
DeleteRepository 删除project下的repo
func GenerateConfigMap ¶
func GetChartrepoRepoCharts ¶
func GetConfigMapList ¶
func GetConfigMapList(client *kubernetes.Clientset, ns string, labelSelector string) (*v1.ConfigMapList, error)
func GetContainerLog ¶
func GetEnvDefault ¶
func GetHarborClient ¶
func GetKubernetesClient ¶
func GetKubernetesClient() (*kubernetes.Clientset, error)
func GetPodList ¶
func GetPodStatus ¶
func GetPolicyExecution ¶
func GetPolicyExecution(client *harborcli.HarborAPI, policyID int64) (*models.ReplicationExecution, error)
GetPolicyExecution 获取指定的replication policy的execution
func GetProjectIDByName ¶
GetProjectIDByName 通过project的名字获得ID
func GetProjectRepositories ¶
func GetProjectRepositories(client *harborcli.HarborAPI, projectName string, filter *string) ([]*models.Repository, error)
GetProjectRepositories 获取project下的所有repo
func GetProjectRepositoryArtifacts ¶
func GetProjectRepositoryArtifacts(client *harborcli.HarborAPI, projectName string, repoName string) ([]*models.Artifact, error)
GetProjectRepositoryArtifacts 获取repo下面所有的artifacts
func GetRegistries ¶
GetRegistries 获取所有的
func GetReplicationExecution ¶
func GetReplicationExecution(client *harborcli.HarborAPI, policyID int64) (*models.ReplicationExecution, error)
GetReplicationExecution 获取指定的replication policy的execution
func GetReplicationPolicies ¶
func GetReplicationPolicies(client *harborcli.HarborAPI) ([]*models.ReplicationPolicy, error)
GetReplicationPolicies 获取所有的replication policy
func GetReplicationPolicyByID ¶
func GetReplicationPolicyByID(client *harborcli.HarborAPI, policyID int64) (*models.ReplicationPolicy, error)
GetReplicationPolicyByID 通过ID获取指定的replication policy
func GetReplicationPolicyIDByName ¶
GetReplicationPolicyIDByName 通过policy的名字获取policy ID
func GetRepository ¶
func GetRepository(client *harborcli.HarborAPI, projectName string, repo string) (*models.Repository, error)
GetRepository 获取project下的所有repo
func GetRuntimeLocation ¶
func GetRuntimeLocation() string
func GetServiceList ¶
func MarkUserAsReady ¶
func PostChartrepoRepoCharts ¶
func RunReplicationExecution ¶
RunReplicationExecution 执行指定的replication policy
func StopReplicationExecution ¶
StopReplicationExecution 停止指定policy的execution
Types ¶
This section is empty.