services

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URL_AZUREDEVOPS_ENVIRONMENT           = "https://dev.azure.com/{organization}/{project}/_apis/distributedtask/environments?api-version=6.1-preview.1"
	URL_AZUREDEVOPS_SERVICE_ENDPOINT_GET  = "https://dev.azure.com/{organization}/{project}/_apis/serviceendpoint/endpoints?api-version=7.1-preview.4"
	URL_AZUREDEVOPS_SERVICE_ENDPOINT_POST = "https://dev.azure.com/{organization}/_apis/serviceendpoint/endpoints?api-version=7.1-preview.4"
	URL_AZUREDEVOPS_PROJECTS              = "https://dev.azure.com/{organization}/_apis/projects?api-version=7.1-preview.4"
	URL_AZUREDEVOPS_ENVIRONMENT_RESOURCE  = "" /* 144-byte string literal not displayed */
	KUBERNETES_DEFAULT_CONTEXT_NAME       = "default"
)

Variables

This section is empty.

Functions

func IgnoreResourceNotFoundError

func IgnoreResourceNotFoundError(err error) error

Types

type AzDevOps

type AzDevOps struct {
	Pat          string
	Organization string
}

func (*AzDevOps) CreateEnvironment

func (az *AzDevOps) CreateEnvironment(project, name string) (*AzDevopsEnvironmentInstance, error)

func (*AzDevOps) CreateResourceEnvironment

func (az *AzDevOps) CreateResourceEnvironment(name, projectName, namespace, serviceEndpointId string, environmentId int) error

func (*AzDevOps) CreateServiceEndpoint

func (az *AzDevOps) CreateServiceEndpoint(projectId, name, description, kubeconfig string) (*AzDevopsServiceEndpoint, error)

func (*AzDevOps) FindEnvironment

func (az *AzDevOps) FindEnvironment(project, name string) (*AzDevopsEnvironmentInstance, error)

func (*AzDevOps) FindProject

func (az *AzDevOps) FindProject(name string) (*AzDevOpsProject, error)

func (*AzDevOps) FindServiceEndpoint

func (az *AzDevOps) FindServiceEndpoint(project, name string) (*AzDevopsServiceEndpoint, error)

type AzDevOpsProject

type AzDevOpsProject struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type AzDevOpsProjectList

type AzDevOpsProjectList struct {
	Count int               `json:"count"`
	Value []AzDevOpsProject `json:"value"`
}

type AzDevopsEnvironmentInstance

type AzDevopsEnvironmentInstance struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

type AzDevopsEnvironmentInstanceList

type AzDevopsEnvironmentInstanceList struct {
	Count int                           `json:"count"`
	Value []AzDevopsEnvironmentInstance `json:"value"`
}

type AzDevopsProjectReference

type AzDevopsProjectReference struct {
	Id   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

type AzDevopsServiceEndpoint

type AzDevopsServiceEndpoint struct {
	Id                                 string                               `json:"id,omitempty"`
	Name                               string                               `json:"name"`
	Type                               string                               `json:"type"`
	URL                                string                               `json:"url,omitempty"`
	Description                        string                               `json:"description,omitempty"`
	Data                               map[string]interface{}               `json:"data,omitempty"`
	Authorization                      AzDevopsServiceEndpointAuthorization `json:"authorization"`
	AzServiceEndpointProjectReferences []AzServiceEndpointProjectReferences `json:"serviceEndpointProjectReferences"`
	IsShared                           bool                                 `json:"isShared,omitempty"`
}

type AzDevopsServiceEndpointAuthorization

type AzDevopsServiceEndpointAuthorization struct {
	Parameters AzDevopsServiceEndpointParameters `json:"parameters"`
	Scheme     string                            `json:"scheme"`
}

type AzDevopsServiceEndpointList

type AzDevopsServiceEndpointList struct {
	Count int                       `json:"count"`
	Value []AzDevopsServiceEndpoint `json:"value"`
}

type AzDevopsServiceEndpointParameters

type AzDevopsServiceEndpointParameters struct {
	ClusterContext string `json:"clusterContext"`
	KubeConfig     string `json:"kubeConfig"`
}

type AzServiceEndpointProjectReferences

type AzServiceEndpointProjectReferences struct {
	Description                 string                   `json:"description,omitempty"`
	Name                        string                   `json:"name,omitempty"`
	AzureDevopsProjectReference AzDevopsProjectReference `json:"projectReference,omitempty"`
}

type Error

type Error string

type Kubernetes

type Kubernetes struct {
	Config *rest.Config
}

func (*Kubernetes) CreateKubeconfig

func (k *Kubernetes) CreateKubeconfig(serviceAccountName, namespaceName, token string) (string, error)

func (*Kubernetes) CreateNamespace

func (k *Kubernetes) CreateNamespace(ctx context.Context, namespaceName string) (*v1.Namespace, error)

func (*Kubernetes) CreateSecret added in v0.0.3

func (k *Kubernetes) CreateSecret(ctx context.Context, namespace, name, serviceAccountName string) (*v1.Secret, error)

func (*Kubernetes) CreateServiceAccount

func (k *Kubernetes) CreateServiceAccount(ctx context.Context, namespaceName, serviceAccountName string) (*v1.ServiceAccount, error)

func (*Kubernetes) GetNamespace

func (k *Kubernetes) GetNamespace(ctx context.Context, namespaceName string) (*v1.Namespace, error)

func (*Kubernetes) GetSecret

func (k *Kubernetes) GetSecret(ctx context.Context, namespace, secretName string) (*v1.Secret, error)

func (*Kubernetes) GetServiceAccount

func (k *Kubernetes) GetServiceAccount(ctx context.Context, namespace, serviceAccountName string) (*v1.ServiceAccount, error)

func (*Kubernetes) UpdateNamespaceLabels

func (k *Kubernetes) UpdateNamespaceLabels(ctx context.Context, namespaceName string, labels map[string]string) error

type ResourceNotFoundError

type ResourceNotFoundError struct {
	// contains filtered or unexported fields
}

func (*ResourceNotFoundError) Error

func (e *ResourceNotFoundError) Error() string

Jump to

Keyboard shortcuts

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