eksawshelper

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Overview

eksawshelper contains helper functions for accessing the AWS EKS API directly. This package exists to break cyclic dependencies between eks and kubectl.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClusterArnByNameAndRegion added in v0.6.5

func GetClusterArnByNameAndRegion(eksClusterName string, region string) (string, error)

GetClusterArnByNameAndRegion looks up the EKS Cluster ARN using the region and EKS Cluster Name. For instances where we don't have the EKS Cluster ARN, such as within the Fargate Profile resource.

func GetClusterByArn

func GetClusterByArn(eksClusterArn string) (*eks.Cluster, error)

GetClusterByArn returns the EKS Cluster object that corresponds to the given ARN.

func GetClusterNameFromArn

func GetClusterNameFromArn(eksClusterArnString string) (string, error)

GetClusterNameFromArn extracts the EKS cluster name given the ARN for the cluster.

func GetDockerLoginToken added in v0.7.7

func GetDockerLoginToken(region string) (string, error)

GetDockerLoginToken retrieves an authorization token that can be used to access ECR via the docker APIs. The return token can directly be used as a HTTP authorization header for basic auth.

func GetKubernetesTokenForCluster

func GetKubernetesTokenForCluster(clusterID string) (*token.Token, string, error)

func GetRegionFromArn

func GetRegionFromArn(eksClusterArnString string) (string, error)

GetRegionFromArn extracts the AWS region that the EKS cluster is in from the ARN of the EKS cluster.

func NewAuthenticatedSession

func NewAuthenticatedSession(region string) (*session.Session, error)

NewAuthenticatedSession gets an AWS Session, checking that the user has credentials properly configured in their environment.

func NewECRClient added in v0.7.7

func NewECRClient(region string) (*ecr.ECR, error)

NewECRClient creates an AWS SDK client to access ECR API.

func NewEksClient

func NewEksClient(region string) (*eks.EKS, error)

NewEksClient creates an EKS client.

func TagExistsInRepo added in v0.7.7

func TagExistsInRepo(token, repoDomain, repoPath, tag string) (bool, error)

TagExistsInRepo queries the ECR repository docker API to see if the given tag exists for the given ECR repository.

Types

type CredentialsError

type CredentialsError struct {
	UnderlyingErr error
}

CredentialsError is an error that occurs because AWS credentials can't be found.

func (CredentialsError) Error

func (err CredentialsError) Error() string

type ECRManifestFetchError added in v0.7.7

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

ECRManifestFetchError is an error that occurs when retrieving information about a given tag in an ECR repository.

func (ECRManifestFetchError) Error added in v0.7.7

func (err ECRManifestFetchError) Error() string

Jump to

Keyboard shortcuts

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