@@ -24,10 +24,10 @@ type InstancesV2 struct {
2424
2525// InstanceExists checks whether the provided Kubernetes node exists as instance
2626// in Oxide.
27- func (c * InstancesV2 ) InstanceExists (ctx context.Context , node * v1.Node ) (bool , error ) {
27+ func (i * InstancesV2 ) InstanceExists (ctx context.Context , node * v1.Node ) (bool , error ) {
2828 instanceID := strings .TrimPrefix (node .Spec .ProviderID , "oxide://" )
2929
30- if _ , err := c .client .InstanceView (ctx , oxide.InstanceViewParams {
30+ if _ , err := i .client .InstanceView (ctx , oxide.InstanceViewParams {
3131 Instance : oxide .NameOrId (instanceID ),
3232 }); err != nil {
3333 if strings .Contains (err .Error (), "NotFound" ) {
@@ -42,7 +42,7 @@ func (c *InstancesV2) InstanceExists(ctx context.Context, node *v1.Node) (bool,
4242
4343// InstanceMetadata populates the metadata for the provided node, notably
4444// setting its provider ID.
45- func (c * InstancesV2 ) InstanceMetadata (ctx context.Context , node * v1.Node ) (* cloudprovider.InstanceMetadata , error ) {
45+ func (i * InstancesV2 ) InstanceMetadata (ctx context.Context , node * v1.Node ) (* cloudprovider.InstanceMetadata , error ) {
4646 var (
4747 err error
4848 instance * oxide.Instance
@@ -52,15 +52,15 @@ func (c *InstancesV2) InstanceMetadata(ctx context.Context, node *v1.Node) (*clo
5252 if node .Spec .ProviderID != "" {
5353 instanceID = strings .TrimPrefix (node .Spec .ProviderID , "oxide://" )
5454
55- instance , err = c .client .InstanceView (ctx , oxide.InstanceViewParams {
55+ instance , err = i .client .InstanceView (ctx , oxide.InstanceViewParams {
5656 Instance : oxide .NameOrId (instanceID ),
5757 })
5858 if err != nil {
5959 return nil , fmt .Errorf ("failed viewing oxide instance by id: %v" , err )
6060 }
6161 } else {
62- instance , err = c .client .InstanceView (ctx , oxide.InstanceViewParams {
63- Project : oxide .NameOrId (c .project ),
62+ instance , err = i .client .InstanceView (ctx , oxide.InstanceViewParams {
63+ Project : oxide .NameOrId (i .project ),
6464 Instance : oxide .NameOrId (node .GetName ()),
6565 })
6666 if err != nil {
@@ -70,14 +70,14 @@ func (c *InstancesV2) InstanceMetadata(ctx context.Context, node *v1.Node) (*clo
7070 instanceID = instance .Id
7171 }
7272
73- nics , err := c .client .InstanceNetworkInterfaceList (ctx , oxide.InstanceNetworkInterfaceListParams {
73+ nics , err := i .client .InstanceNetworkInterfaceList (ctx , oxide.InstanceNetworkInterfaceListParams {
7474 Instance : oxide .NameOrId (instanceID ),
7575 })
7676 if err != nil {
7777 return nil , fmt .Errorf ("failed listing instance network interfaces: %v" , err )
7878 }
7979
80- externalIPs , err := c .client .InstanceExternalIpList (ctx , oxide.InstanceExternalIpListParams {
80+ externalIPs , err := i .client .InstanceExternalIpList (ctx , oxide.InstanceExternalIpListParams {
8181 Instance : oxide .NameOrId (instanceID ),
8282 })
8383 if err != nil {
@@ -116,10 +116,10 @@ func (c *InstancesV2) InstanceMetadata(ctx context.Context, node *v1.Node) (*clo
116116}
117117
118118// InstanceShutdown checks whether the provided node is shut down in Oxide.
119- func (c * InstancesV2 ) InstanceShutdown (ctx context.Context , node * v1.Node ) (bool , error ) {
119+ func (i * InstancesV2 ) InstanceShutdown (ctx context.Context , node * v1.Node ) (bool , error ) {
120120 instanceID := strings .TrimPrefix (node .Spec .ProviderID , "oxide://" )
121121
122- instance , err := c .client .InstanceView (ctx , oxide.InstanceViewParams {
122+ instance , err := i .client .InstanceView (ctx , oxide.InstanceViewParams {
123123 Instance : oxide .NameOrId (instanceID ),
124124 })
125125 if err != nil {
0 commit comments