Documentation
¶
Index ¶
- Constants
- func ParseResourceID(resourceID string) (azure.Resource, error)
- type Client
- func (c *Client) AssignUserMSI(userAssignedMSIID string, node *corev1.Node) error
- func (c *Client) GetUserMSIs(node *corev1.Node) ([]string, error)
- func (c *Client) RemoveUserMSI(userAssignedMSIID string, node *corev1.Node) error
- func (c *Client) UpdateUserMSI(addUserAssignedMSIIDs []string, removeUserAssignedMSIIDs []string, ...) error
- type ClientInt
- type IdentityHolder
- type IdentityInfo
- type VMClient
- type VMClientInt
- type VMSSClient
- type VMSSClientInt
Constants ¶
const ( VMResourceType = "virtualMachines" VMSSResourceType = "virtualMachineScaleSets" )
Variables ¶
This section is empty.
Functions ¶
func ParseResourceID ¶
ParseResourceID is a slightly modified version of https://github.com/Azure/go-autorest/blob/528b76fd0ebec0682f3e3da7c808cd472b999615/autorest/azure/azure.go#L175 The modification here is to support a nested resource such as is the case for a node resource in a vmss.
Types ¶
type Client ¶
type Client struct { VMClient VMClientInt VMSSClient VMSSClientInt ExtClient compute.VirtualMachineExtensionsClient Config config.AzureConfig }
Client is a cloud provider client
func NewCloudProvider ¶
NewCloudProvider returns a azure cloud provider client
func (*Client) AssignUserMSI ¶
AssignUserMSI - Use the underlying cloud api call and add the given user assigned MSI to the vm
func (*Client) GetUserMSIs ¶
GetUserMSIs will return a list of all identities on the node
func (*Client) RemoveUserMSI ¶
RemoveUserMSI - Use the underlying cloud api calls and remove the given user assigned MSI from the vm.
type ClientInt ¶
type ClientInt interface { RemoveUserMSI(userAssignedMSIID string, node *corev1.Node) error AssignUserMSI(userAssignedMSIID string, node *corev1.Node) error UpdateUserMSI(addUserAssignedMSIIDs []string, removeUserAssignedMSIIDs []string, node *corev1.Node) error GetUserMSIs(node *corev1.Node) ([]string, error) }
ClientInt client interface
type IdentityHolder ¶
type IdentityHolder interface { IdentityInfo() IdentityInfo ResetIdentity() IdentityInfo }
IdentityHolder represents a resource that contains an Identity object This is used to be able to generically intract with multiple resource types (e.g. VirtualMachine and VirtualMachineScaleSet) which each contain an identity.
type IdentityInfo ¶
type IdentityInfo interface { AppendUserIdentity(id string) bool RemoveUserIdentity(id string) error GetUserIdentityList() []string }
IdentityInfo is used to interact with different implementations of Azure compute identities. This is needed because different Azure resource types (e.g. VirtualMachine and VirtualMachineScaleSet) have different identity types. This abstracts those differences.
type VMClient ¶
type VMClient struct {
// contains filtered or unexported fields
}
func NewVirtualMachinesClient ¶
func NewVirtualMachinesClient(config config.AzureConfig, spt *adal.ServicePrincipalToken) (c *VMClient, e error)
func (*VMClient) CreateOrUpdate ¶
type VMClientInt ¶
type VMClientInt interface { CreateOrUpdate(rg string, nodeName string, vm compute.VirtualMachine) error Get(rgName string, nodeName string) (compute.VirtualMachine, error) }
type VMSSClient ¶
type VMSSClient struct {
// contains filtered or unexported fields
}
VMSSClient is used to interact with Azure virtual machine scale sets.
func NewVMSSClient ¶
func NewVMSSClient(config config.AzureConfig, spt *adal.ServicePrincipalToken) (c *VMSSClient, e error)
NewVMSSClient creates a new vmss client.
func (*VMSSClient) CreateOrUpdate ¶
func (c *VMSSClient) CreateOrUpdate(rg string, vmssName string, vm compute.VirtualMachineScaleSet) error
CreateOrUpdate creates a new vmss, or if the vmss already exists it updates the existing one. This is used by "cloudprovider" to *update* add/remove identities from an already existing vmss.
func (*VMSSClient) Get ¶
func (c *VMSSClient) Get(rgName string, vmssName string) (ret compute.VirtualMachineScaleSet, err error)
Get gets the passed in vmss.
type VMSSClientInt ¶
type VMSSClientInt interface { CreateOrUpdate(rg, name string, vm compute.VirtualMachineScaleSet) error Get(rgName, name string) (compute.VirtualMachineScaleSet, error) }
VMSSClientInt is the interface used by "cloudprovider" for interacting with Azure vmss