mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-12-15 16:09:39 -05:00
go: remove unused parameters
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
parent
822d7823f8
commit
0036b24266
106 changed files with 320 additions and 323 deletions
|
|
@ -25,14 +25,14 @@ type stubScaleSetsAPI struct {
|
|||
pager *stubVMSSPager
|
||||
}
|
||||
|
||||
func (a *stubScaleSetsAPI) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string,
|
||||
options *armcompute.VirtualMachineScaleSetsClientGetOptions,
|
||||
func (a *stubScaleSetsAPI) Get(_ context.Context, _, _ string,
|
||||
_ *armcompute.VirtualMachineScaleSetsClientGetOptions,
|
||||
) (armcompute.VirtualMachineScaleSetsClientGetResponse, error) {
|
||||
return a.scaleSet, a.getErr
|
||||
}
|
||||
|
||||
func (a *stubScaleSetsAPI) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters armcompute.VirtualMachineScaleSetUpdate,
|
||||
options *armcompute.VirtualMachineScaleSetsClientBeginUpdateOptions,
|
||||
func (a *stubScaleSetsAPI) BeginUpdate(_ context.Context, _, _ string, _ armcompute.VirtualMachineScaleSetUpdate,
|
||||
_ *armcompute.VirtualMachineScaleSetsClientBeginUpdateOptions,
|
||||
) (*runtime.Poller[armcompute.VirtualMachineScaleSetsClientUpdateResponse], error) {
|
||||
poller, err := runtime.NewPoller(nil, runtime.NewPipeline("", "", runtime.PipelineOptions{}, nil), &runtime.NewPollerOptions[armcompute.VirtualMachineScaleSetsClientUpdateResponse]{
|
||||
Handler: &stubPoller[armcompute.VirtualMachineScaleSetsClientUpdateResponse]{
|
||||
|
|
@ -46,8 +46,8 @@ func (a *stubScaleSetsAPI) BeginUpdate(ctx context.Context, resourceGroupName st
|
|||
return poller, a.updateErr
|
||||
}
|
||||
|
||||
func (a *stubScaleSetsAPI) BeginDeleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs armcompute.VirtualMachineScaleSetVMInstanceRequiredIDs,
|
||||
options *armcompute.VirtualMachineScaleSetsClientBeginDeleteInstancesOptions,
|
||||
func (a *stubScaleSetsAPI) BeginDeleteInstances(_ context.Context, _, _ string, _ armcompute.VirtualMachineScaleSetVMInstanceRequiredIDs,
|
||||
_ *armcompute.VirtualMachineScaleSetsClientBeginDeleteInstancesOptions,
|
||||
) (*runtime.Poller[armcompute.VirtualMachineScaleSetsClientDeleteInstancesResponse], error) {
|
||||
poller, err := runtime.NewPoller(nil, runtime.NewPipeline("", "", runtime.PipelineOptions{}, nil), &runtime.NewPollerOptions[armcompute.VirtualMachineScaleSetsClientDeleteInstancesResponse]{
|
||||
Handler: &stubPoller[armcompute.VirtualMachineScaleSetsClientDeleteInstancesResponse]{
|
||||
|
|
@ -61,7 +61,7 @@ func (a *stubScaleSetsAPI) BeginDeleteInstances(ctx context.Context, resourceGro
|
|||
return poller, a.deleteErr
|
||||
}
|
||||
|
||||
func (a *stubScaleSetsAPI) NewListPager(resourceGroupName string, options *armcompute.VirtualMachineScaleSetsClientListOptions,
|
||||
func (a *stubScaleSetsAPI) NewListPager(_ string, _ *armcompute.VirtualMachineScaleSetsClientListOptions,
|
||||
) *runtime.Pager[armcompute.VirtualMachineScaleSetsClientListResponse] {
|
||||
return runtime.NewPager(runtime.PagingHandler[armcompute.VirtualMachineScaleSetsClientListResponse]{
|
||||
More: a.pager.moreFunc(),
|
||||
|
|
@ -77,20 +77,20 @@ type stubvirtualMachineScaleSetVMsAPI struct {
|
|||
pager *stubVMSSVMPager
|
||||
}
|
||||
|
||||
func (a *stubvirtualMachineScaleSetVMsAPI) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string,
|
||||
options *armcompute.VirtualMachineScaleSetVMsClientGetOptions,
|
||||
func (a *stubvirtualMachineScaleSetVMsAPI) Get(_ context.Context, _, _, _ string,
|
||||
_ *armcompute.VirtualMachineScaleSetVMsClientGetOptions,
|
||||
) (armcompute.VirtualMachineScaleSetVMsClientGetResponse, error) {
|
||||
return a.scaleSetVM, a.getErr
|
||||
}
|
||||
|
||||
func (a *stubvirtualMachineScaleSetVMsAPI) GetInstanceView(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string,
|
||||
options *armcompute.VirtualMachineScaleSetVMsClientGetInstanceViewOptions,
|
||||
func (a *stubvirtualMachineScaleSetVMsAPI) GetInstanceView(_ context.Context, _, _, _ string,
|
||||
_ *armcompute.VirtualMachineScaleSetVMsClientGetInstanceViewOptions,
|
||||
) (armcompute.VirtualMachineScaleSetVMsClientGetInstanceViewResponse, error) {
|
||||
return a.instanceView, a.instanceViewErr
|
||||
}
|
||||
|
||||
func (a *stubvirtualMachineScaleSetVMsAPI) NewListPager(resourceGroupName string, virtualMachineScaleSetName string,
|
||||
options *armcompute.VirtualMachineScaleSetVMsClientListOptions,
|
||||
func (a *stubvirtualMachineScaleSetVMsAPI) NewListPager(_, _ string,
|
||||
_ *armcompute.VirtualMachineScaleSetVMsClientListOptions,
|
||||
) *runtime.Pager[armcompute.VirtualMachineScaleSetVMsClientListResponse] {
|
||||
return runtime.NewPager(runtime.PagingHandler[armcompute.VirtualMachineScaleSetVMsClientListResponse]{
|
||||
More: a.pager.moreFunc(),
|
||||
|
|
@ -112,7 +112,7 @@ func (p *stubPoller[T]) Poll(context.Context) (*http.Response, error) {
|
|||
return nil, p.pollErr
|
||||
}
|
||||
|
||||
func (p *stubPoller[T]) Result(ctx context.Context, out *T) error {
|
||||
func (p *stubPoller[T]) Result(_ context.Context, out *T) error {
|
||||
*out = p.result
|
||||
return p.resultErr
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func (c *Client) GetNodeImage(ctx context.Context, providerID string) (string, e
|
|||
}
|
||||
|
||||
// GetScalingGroupID returns the scaling group ID of the node.
|
||||
func (c *Client) GetScalingGroupID(ctx context.Context, providerID string) (string, error) {
|
||||
func (c *Client) GetScalingGroupID(_ context.Context, providerID string) (string, error) {
|
||||
subscriptionID, resourceGroup, scaleSet, _, err := scaleSetInformationFromProviderID(providerID)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
@ -146,7 +146,7 @@ func (h *capacityPollingHandler) Poll(ctx context.Context) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (h *capacityPollingHandler) Result(ctx context.Context, out *int64) error {
|
||||
func (h *capacityPollingHandler) Result(_ context.Context, out *int64) error {
|
||||
if !h.done {
|
||||
return fmt.Errorf("failed to scale up")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,37 +22,37 @@ const (
|
|||
type Client struct{}
|
||||
|
||||
// GetNodeImage retrieves the image currently used by a node.
|
||||
func (c *Client) GetNodeImage(ctx context.Context, providerID string) (string, error) {
|
||||
func (c *Client) GetNodeImage(_ context.Context, _ string) (string, error) {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
// GetScalingGroupID retrieves the scaling group that a node is part of.
|
||||
func (c *Client) GetScalingGroupID(ctx context.Context, providerID string) (string, error) {
|
||||
func (c *Client) GetScalingGroupID(_ context.Context, _ string) (string, error) {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
// CreateNode creates a new node inside a specified scaling group at the CSP and returns its future name and provider id.
|
||||
func (c *Client) CreateNode(ctx context.Context, scalingGroupID string) (nodeName, providerID string, err error) {
|
||||
func (c *Client) CreateNode(_ context.Context, _ string) (nodeName, _ string, err error) {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
// DeleteNode starts the termination of the node at the CSP.
|
||||
func (c *Client) DeleteNode(ctx context.Context, providerID string) error {
|
||||
func (c *Client) DeleteNode(_ context.Context, _ string) error {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
// GetNodeState retrieves the state of a pending node from a CSP.
|
||||
func (c *Client) GetNodeState(ctx context.Context, providerID string) (updatev1alpha1.CSPNodeState, error) {
|
||||
func (c *Client) GetNodeState(_ context.Context, _ string) (updatev1alpha1.CSPNodeState, error) {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
// SetScalingGroupImage sets the image to be used by newly created nodes in a scaling group.
|
||||
func (c *Client) SetScalingGroupImage(ctx context.Context, scalingGroupID, image string) error {
|
||||
func (c *Client) SetScalingGroupImage(_ context.Context, _, _ string) error {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
// GetScalingGroupImage retrieves the image currently used by a scaling group.
|
||||
func (c *Client) GetScalingGroupImage(ctx context.Context, scalingGroupID string) (string, error) {
|
||||
func (c *Client) GetScalingGroupImage(_ context.Context, _ string) (string, error) {
|
||||
return "unsupportedCSP", nil
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ func (c *Client) GetAutoscalingGroupName(scalingGroupID string) (string, error)
|
|||
}
|
||||
|
||||
// ListScalingGroups retrieves a list of scaling groups for the cluster.
|
||||
func (c *Client) ListScalingGroups(ctx context.Context, uid string) (controlPlaneGroupIDs []string, workerGroupIDs []string, err error) {
|
||||
func (c *Client) ListScalingGroups(_ context.Context, _ string) (controlPlaneGroupIDs []string, workerGroupIDs []string, err error) {
|
||||
return []string{controlPlanesID}, []string{workersID}, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ func (a stubProjectAPI) Close() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (a stubProjectAPI) Get(ctx context.Context, req *computepb.GetProjectRequest,
|
||||
opts ...gax.CallOption,
|
||||
func (a stubProjectAPI) Get(_ context.Context, _ *computepb.GetProjectRequest,
|
||||
_ ...gax.CallOption,
|
||||
) (*computepb.Project, error) {
|
||||
return a.project, a.getErr
|
||||
}
|
||||
|
|
@ -40,8 +40,8 @@ func (a stubInstanceAPI) Close() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (a stubInstanceAPI) Get(ctx context.Context, req *computepb.GetInstanceRequest,
|
||||
opts ...gax.CallOption,
|
||||
func (a stubInstanceAPI) Get(_ context.Context, _ *computepb.GetInstanceRequest,
|
||||
_ ...gax.CallOption,
|
||||
) (*computepb.Instance, error) {
|
||||
return a.instance, a.getErr
|
||||
}
|
||||
|
|
@ -57,14 +57,14 @@ func (a stubInstanceTemplateAPI) Close() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (a stubInstanceTemplateAPI) Get(ctx context.Context, req *computepb.GetInstanceTemplateRequest,
|
||||
opts ...gax.CallOption,
|
||||
func (a stubInstanceTemplateAPI) Get(_ context.Context, _ *computepb.GetInstanceTemplateRequest,
|
||||
_ ...gax.CallOption,
|
||||
) (*computepb.InstanceTemplate, error) {
|
||||
return a.template, a.getErr
|
||||
}
|
||||
|
||||
func (a stubInstanceTemplateAPI) Delete(ctx context.Context, req *computepb.DeleteInstanceTemplateRequest,
|
||||
opts ...gax.CallOption,
|
||||
func (a stubInstanceTemplateAPI) Delete(_ context.Context, _ *computepb.DeleteInstanceTemplateRequest,
|
||||
_ ...gax.CallOption,
|
||||
) (Operation, error) {
|
||||
return &stubOperation{
|
||||
&computepb.Operation{
|
||||
|
|
@ -73,8 +73,8 @@ func (a stubInstanceTemplateAPI) Delete(ctx context.Context, req *computepb.Dele
|
|||
}, a.deleteErr
|
||||
}
|
||||
|
||||
func (a stubInstanceTemplateAPI) Insert(ctx context.Context, req *computepb.InsertInstanceTemplateRequest,
|
||||
opts ...gax.CallOption,
|
||||
func (a stubInstanceTemplateAPI) Insert(_ context.Context, _ *computepb.InsertInstanceTemplateRequest,
|
||||
_ ...gax.CallOption,
|
||||
) (Operation, error) {
|
||||
return &stubOperation{
|
||||
&computepb.Operation{
|
||||
|
|
@ -96,14 +96,14 @@ func (a stubInstanceGroupManagersAPI) Close() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (a stubInstanceGroupManagersAPI) Get(ctx context.Context, req *computepb.GetInstanceGroupManagerRequest,
|
||||
opts ...gax.CallOption,
|
||||
func (a stubInstanceGroupManagersAPI) Get(_ context.Context, _ *computepb.GetInstanceGroupManagerRequest,
|
||||
_ ...gax.CallOption,
|
||||
) (*computepb.InstanceGroupManager, error) {
|
||||
return a.instanceGroupManager, a.getErr
|
||||
}
|
||||
|
||||
func (a stubInstanceGroupManagersAPI) AggregatedList(ctx context.Context, req *computepb.AggregatedListInstanceGroupManagersRequest,
|
||||
opts ...gax.CallOption,
|
||||
func (a stubInstanceGroupManagersAPI) AggregatedList(_ context.Context, _ *computepb.AggregatedListInstanceGroupManagersRequest,
|
||||
_ ...gax.CallOption,
|
||||
) InstanceGroupManagerScopedListIterator {
|
||||
return &stubInstanceGroupManagerScopedListIterator{
|
||||
pairs: []compute.InstanceGroupManagersScopedListPair{
|
||||
|
|
@ -120,8 +120,8 @@ func (a stubInstanceGroupManagersAPI) AggregatedList(ctx context.Context, req *c
|
|||
}
|
||||
}
|
||||
|
||||
func (a stubInstanceGroupManagersAPI) SetInstanceTemplate(ctx context.Context, req *computepb.SetInstanceTemplateInstanceGroupManagerRequest,
|
||||
opts ...gax.CallOption,
|
||||
func (a stubInstanceGroupManagersAPI) SetInstanceTemplate(_ context.Context, _ *computepb.SetInstanceTemplateInstanceGroupManagerRequest,
|
||||
_ ...gax.CallOption,
|
||||
) (Operation, error) {
|
||||
return &stubOperation{
|
||||
&computepb.Operation{
|
||||
|
|
@ -130,8 +130,8 @@ func (a stubInstanceGroupManagersAPI) SetInstanceTemplate(ctx context.Context, r
|
|||
}, a.setInstanceTemplateErr
|
||||
}
|
||||
|
||||
func (a stubInstanceGroupManagersAPI) CreateInstances(ctx context.Context, req *computepb.CreateInstancesInstanceGroupManagerRequest,
|
||||
opts ...gax.CallOption,
|
||||
func (a stubInstanceGroupManagersAPI) CreateInstances(_ context.Context, _ *computepb.CreateInstancesInstanceGroupManagerRequest,
|
||||
_ ...gax.CallOption,
|
||||
) (Operation, error) {
|
||||
return &stubOperation{
|
||||
&computepb.Operation{
|
||||
|
|
@ -140,8 +140,8 @@ func (a stubInstanceGroupManagersAPI) CreateInstances(ctx context.Context, req *
|
|||
}, a.createInstancesErr
|
||||
}
|
||||
|
||||
func (a stubInstanceGroupManagersAPI) DeleteInstances(ctx context.Context, req *computepb.DeleteInstancesInstanceGroupManagerRequest,
|
||||
opts ...gax.CallOption,
|
||||
func (a stubInstanceGroupManagersAPI) DeleteInstances(_ context.Context, _ *computepb.DeleteInstancesInstanceGroupManagerRequest,
|
||||
_ ...gax.CallOption,
|
||||
) (Operation, error) {
|
||||
if a.deleteInstancesErr != nil {
|
||||
return nil, a.deleteInstancesErr
|
||||
|
|
@ -162,8 +162,8 @@ func (a stubDiskAPI) Close() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (a stubDiskAPI) Get(ctx context.Context, req *computepb.GetDiskRequest,
|
||||
opts ...gax.CallOption,
|
||||
func (a stubDiskAPI) Get(_ context.Context, _ *computepb.GetDiskRequest,
|
||||
_ ...gax.CallOption,
|
||||
) (*computepb.Disk, error) {
|
||||
return a.disk, a.getErr
|
||||
}
|
||||
|
|
@ -180,7 +180,7 @@ func (o *stubOperation) Done() bool {
|
|||
return true
|
||||
}
|
||||
|
||||
func (o *stubOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
|
||||
func (o *stubOperation) Wait(_ context.Context, _ ...gax.CallOption) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,6 +73,6 @@ type stubRng struct {
|
|||
result int
|
||||
}
|
||||
|
||||
func (r *stubRng) Intn(n int) int {
|
||||
func (r *stubRng) Intn(_ int) int {
|
||||
return r.result
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue