azureclient

package
v0.0.0-...-96c8292 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(opts *Options) (*Client, error)

func (*Client) ConfigurePrivateDNS

func (c *Client) ConfigurePrivateDNS(
	ctx context.Context,
	privateEndpoint *armnetwork.PrivateEndpoint,
	clusterResourceGroupName,
	networkResourceGroupName,
	vnetName,
	storageAccountName string,
) error

ConfigurePrivateDNS creates a private DNS zone, a record set (A) and a private DNS zone group for the given private endpoint. It also links the DNS zone with the given VNet by creating a virtual network link.

Returns an error on failure.

func (*Client) CreatePrivateEndpoint

func (c *Client) CreatePrivateEndpoint(
	ctx context.Context,
	opts *PrivateEndpointCreateOptions,
) (*armnetwork.PrivateEndpoint, error)

func (*Client) DeletePrivateEndpoint

func (c *Client) DeletePrivateEndpoint(ctx context.Context, resourceGroupName, privateEndpointName string) error

func (*Client) DestroyPrivateDNS

func (c *Client) DestroyPrivateDNS(ctx context.Context, resourceGroupName, privateEndpointName, vnetName, storageAccountName string) error

DestroyPrivateDNS unlinks the private zone from the vnet.

It is meant to be used as a clean-up for ConfigurePrivateDNS. It will not undo everything ConfigurePrivateDNS does because it's difficult to know whether they are used by other components. We remove the resources we know for sure that the registry is the only one using.

func (*Client) GetSubnetsByVNet

func (c *Client) GetSubnetsByVNet(ctx context.Context, resourceGroupName, vnetName string) (armnetwork.Subnet, error)

func (*Client) GetVNetByTag

func (c *Client) GetVNetByTag(ctx context.Context, resourceGroupName, tagKey string, tagValues ...string) (armnetwork.VirtualNetwork, error)

func (*Client) IsStorageAccountPrivate

func (c *Client) IsStorageAccountPrivate(ctx context.Context, resourceGroupName, accountName string) bool

IsStorageAccountPrivate gets a storage account and returns true if public network access is disabled, or false if public network access is enabled. Public network access is enabled by default in Azure. In case of any unexpected behaviour this function will return false.

func (*Client) PrivateEndpointExists

func (c *Client) PrivateEndpointExists(ctx context.Context, resourceGroupName, privateEndpointName string) (bool, error)

func (*Client) UpdateStorageAccountNetworkAccess

func (c *Client) UpdateStorageAccountNetworkAccess(ctx context.Context, resourceGroupName, accountName string, allowPublicAccess bool) error

type Doer

type Doer interface {
	Do(req *http.Request) (*http.Response, error)
}

type Options

type Options struct {
	Environment        autorestazure.Environment
	TenantID           string
	ClientID           string
	ClientSecret       string
	FederatedTokenFile string
	SubscriptionID     string
	TagSet             map[string]*string
	HTTPClient         Doer
	Creds              azcore.TokenCredential
}

type PrivateEndpointCreateOptions

type PrivateEndpointCreateOptions struct {
	Location            string
	VNetName            string
	SubnetName          string
	PrivateEndpointName string
	// The resource group name where the vnet and subnet are.
	NetworkResourceGroupName string
	// The name of an existing storage account
	StorageAccountName string
	// The resource group name used by the cluster. This is where the
	// the storage account will be in.
	ClusterResourceGroupName string
}

Jump to

Keyboard shortcuts

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