Skip to content

Commit ea7df00

Browse files
committed
Run hack/update-gofmt.sh
1 parent 82512f2 commit ea7df00

File tree

406 files changed

+802
-1038
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

406 files changed

+802
-1038
lines changed

channels/pkg/channels/addons_test.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func Test_Replacement(t *testing.T) {
9393
New *ChannelVersion
9494
Replaces bool
9595
}{
96-
//Test ManifestHash Changes
96+
// Test ManifestHash Changes
9797
{
9898
Old: &ChannelVersion{Id: "a", ManifestHash: hash1},
9999
New: &ChannelVersion{Id: "a", ManifestHash: hash1},
@@ -319,7 +319,6 @@ func Test_NeedsRollingUpdate(t *testing.T) {
319319
}
320320

321321
}
322-
323322
}
324323

325324
func Test_InstallPKI(t *testing.T) {
@@ -348,7 +347,7 @@ func Test_InstallPKI(t *testing.T) {
348347
t.Errorf("unexpected error: %v", err)
349348
}
350349

351-
//Two consecutive calls should work since multiple CP nodes can update at the same time
350+
// Two consecutive calls should work since multiple CP nodes can update at the same time
352351
err = addon.installPKI(ctx, fakek8s, fakecm)
353352
if err != nil {
354353
t.Errorf("unexpected error: %v", err)
@@ -358,5 +357,4 @@ func Test_InstallPKI(t *testing.T) {
358357
if err != nil {
359358
t.Errorf("unexpected error: %v", err)
360359
}
361-
362360
}

channels/pkg/channels/apply.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func Apply(data []byte) error {
4242
}()
4343

4444
localManifestFile := path.Join(tmpDir, "manifest.yaml")
45-
if err := os.WriteFile(localManifestFile, data, 0600); err != nil {
45+
if err := os.WriteFile(localManifestFile, data, 0o600); err != nil {
4646
return fmt.Errorf("error writing temp file: %v", err)
4747
}
4848

channels/pkg/channels/channel_version.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ func (c *Channel) GetInstalledVersion(ctx context.Context, k8sClient kubernetes.
156156
}
157157

158158
func (c *Channel) IsPKIInstalled(ctx context.Context, k8sClient kubernetes.Interface, cmClient certmanager.Interface) (bool, error) {
159-
160159
_, err := k8sClient.CoreV1().Secrets("kube-system").Get(ctx, c.Name+"-ca", metav1.GetOptions{})
161160
if errors.IsNotFound(err) {
162161
return false, nil
@@ -174,12 +173,12 @@ func (c *Channel) IsPKIInstalled(ctx context.Context, k8sClient kubernetes.Inter
174173
}
175174

176175
return true, nil
177-
178176
}
179177

180178
type annotationPatch struct {
181179
Metadata annotationPatchMetadata `json:"metadata,omitempty"`
182180
}
181+
183182
type annotationPatchMetadata struct {
184183
Annotations map[string]string `json:"annotations,omitempty"`
185184
}

channels/pkg/channels/channel_version_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,4 @@ func Test_IsPKIInstalled(t *testing.T) {
7676
if !isInstalled {
7777
t.Error("claims PKI is not installed when it is")
7878
}
79-
8079
}

channels/pkg/cmd/get_addons.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ import (
4545
"k8s.io/kops/util/pkg/tables"
4646
)
4747

48-
type GetAddonsOptions struct {
49-
}
48+
type GetAddonsOptions struct{}
5049

5150
func NewCmdGetAddons(f Factory, out io.Writer) *cobra.Command {
5251
var options GetAddonsOptions

channels/pkg/cmd/root.go

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package cmd
1919
import (
2020
goflag "flag"
2121
"fmt"
22-
2322
"io"
2423

2524
"github.com/spf13/cobra"

cloudmock/aws/mockautoscaling/attach.go

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func (m *MockAutoscaling) AttachLoadBalancersWithContext(aws.Context, *autoscali
4646
klog.Fatalf("Not implemented")
4747
return nil, nil
4848
}
49+
4950
func (m *MockAutoscaling) AttachLoadBalancersRequest(*autoscaling.AttachLoadBalancersInput) (*request.Request, *autoscaling.AttachLoadBalancersOutput) {
5051
klog.Fatalf("Not implemented")
5152
return nil, nil

cloudmock/aws/mockautoscaling/group.go

+2
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ func (m *MockAutoscaling) DescribeAutoScalingGroupsWithContext(aws.Context, *aut
283283
klog.Fatalf("Not implemented")
284284
return nil, nil
285285
}
286+
286287
func (m *MockAutoscaling) DescribeAutoScalingGroupsRequest(*autoscaling.DescribeAutoScalingGroupsInput) (*request.Request, *autoscaling.DescribeAutoScalingGroupsOutput) {
287288
klog.Fatalf("Not implemented")
288289
return nil, nil
@@ -332,6 +333,7 @@ func (m *MockAutoscaling) DeleteAutoScalingGroupWithContext(aws.Context, *autosc
332333
klog.Fatalf("Not implemented")
333334
return nil, nil
334335
}
336+
335337
func (m *MockAutoscaling) DeleteAutoScalingGroupRequest(*autoscaling.DeleteAutoScalingGroupInput) (*request.Request, *autoscaling.DeleteAutoScalingGroupOutput) {
336338
klog.Fatalf("Not implemented")
337339
return nil, nil

cloudmock/aws/mockec2/address.go

+2
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,11 @@ func (m *MockEC2) DescribeAddresses(request *ec2.DescribeAddressesInput) (*ec2.D
173173
func (m *MockEC2) ReleaseAddressRequest(*ec2.ReleaseAddressInput) (*request.Request, *ec2.ReleaseAddressOutput) {
174174
panic("Not implemented")
175175
}
176+
176177
func (m *MockEC2) ReleaseAddressWithContext(aws.Context, *ec2.ReleaseAddressInput, ...request.Option) (*ec2.ReleaseAddressOutput, error) {
177178
panic("Not implemented")
178179
}
180+
179181
func (m *MockEC2) ReleaseAddress(request *ec2.ReleaseAddressInput) (*ec2.ReleaseAddressOutput, error) {
180182
m.mutex.Lock()
181183
defer m.mutex.Unlock()

cloudmock/aws/mockec2/dhcpoptions.go

+6
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ func (m *MockEC2) DescribeDhcpOptions(request *ec2.DescribeDhcpOptionsInput) (*e
7979
func (m *MockEC2) DescribeDhcpOptionsWithContext(aws.Context, *ec2.DescribeDhcpOptionsInput, ...request.Option) (*ec2.DescribeDhcpOptionsOutput, error) {
8080
panic("Not implemented")
8181
}
82+
8283
func (m *MockEC2) DescribeDhcpOptionsRequest(*ec2.DescribeDhcpOptionsInput) (*request.Request, *ec2.DescribeDhcpOptionsOutput) {
8384
panic("Not implemented")
8485
}
@@ -108,9 +109,11 @@ func (m *MockEC2) AssociateDhcpOptions(request *ec2.AssociateDhcpOptionsInput) (
108109

109110
return response, nil
110111
}
112+
111113
func (m *MockEC2) AssociateDhcpOptionsWithContext(aws.Context, *ec2.AssociateDhcpOptionsInput, ...request.Option) (*ec2.AssociateDhcpOptionsOutput, error) {
112114
panic("Not implemented")
113115
}
116+
114117
func (m *MockEC2) AssociateDhcpOptionsRequest(*ec2.AssociateDhcpOptionsInput) (*request.Request, *ec2.AssociateDhcpOptionsOutput) {
115118
panic("Not implemented")
116119
}
@@ -154,9 +157,11 @@ func (m *MockEC2) CreateDhcpOptions(request *ec2.CreateDhcpOptionsInput) (*ec2.C
154157
copy.Tags = m.getTags(ec2.ResourceTypeDhcpOptions, *dhcpOptions.DhcpOptionsId)
155158
return &ec2.CreateDhcpOptionsOutput{DhcpOptions: &copy}, nil
156159
}
160+
157161
func (m *MockEC2) CreateDhcpOptionsWithContext(aws.Context, *ec2.CreateDhcpOptionsInput, ...request.Option) (*ec2.CreateDhcpOptionsOutput, error) {
158162
panic("Not implemented")
159163
}
164+
160165
func (m *MockEC2) CreateDhcpOptionsRequest(*ec2.CreateDhcpOptionsInput) (*request.Request, *ec2.CreateDhcpOptionsOutput) {
161166
panic("Not implemented")
162167
}
@@ -180,6 +185,7 @@ func (m *MockEC2) DeleteDhcpOptions(request *ec2.DeleteDhcpOptionsInput) (*ec2.D
180185
func (m *MockEC2) DeleteDhcpOptionsWithContext(aws.Context, *ec2.DeleteDhcpOptionsInput, ...request.Option) (*ec2.DeleteDhcpOptionsOutput, error) {
181186
panic("Not implemented")
182187
}
188+
183189
func (m *MockEC2) DeleteDhcpOptionsRequest(*ec2.DeleteDhcpOptionsInput) (*request.Request, *ec2.DeleteDhcpOptionsOutput) {
184190
panic("Not implemented")
185191
}

cloudmock/aws/mockec2/egressonlyinternetgateways.go

+2
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ func (m *MockEC2) DescribeEgressOnlyInternetGateways(request *ec2.DescribeEgress
163163

164164
return response, nil
165165
}
166+
166167
func (m *MockEC2) DeleteEgressOnlyInternetGateway(request *ec2.DeleteEgressOnlyInternetGatewayInput) (*ec2.DeleteEgressOnlyInternetGatewayOutput, error) {
167168
m.mutex.Lock()
168169
defer m.mutex.Unlock()
@@ -182,6 +183,7 @@ func (m *MockEC2) DeleteEgressOnlyInternetGateway(request *ec2.DeleteEgressOnlyI
182183
func (m *MockEC2) DeleteEgressOnlyInternetGatewayWithContext(aws.Context, *ec2.DeleteEgressOnlyInternetGatewayInput, ...request.Option) (*ec2.DeleteEgressOnlyInternetGatewayOutput, error) {
183184
panic("Not implemented")
184185
}
186+
185187
func (m *MockEC2) DeleteEgressOnlyInternetGatewayRequest(*ec2.DeleteEgressOnlyInternetGatewayInput) (*request.Request, *ec2.DeleteEgressOnlyInternetGatewayOutput) {
186188
panic("Not implemented")
187189
}

cloudmock/aws/mockec2/images.go

+7
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,19 @@ import (
2929
func (m *MockEC2) DescribeImageAttributeRequest(*ec2.DescribeImageAttributeInput) (*request.Request, *ec2.DescribeImageAttributeOutput) {
3030
panic("Not implemented")
3131
}
32+
3233
func (m *MockEC2) DescribeImageAttributeWithContext(aws.Context, *ec2.DescribeImageAttributeInput, ...request.Option) (*ec2.DescribeImageAttributeOutput, error) {
3334
panic("Not implemented")
3435
}
36+
3537
func (m *MockEC2) DescribeImageAttribute(*ec2.DescribeImageAttributeInput) (*ec2.DescribeImageAttributeOutput, error) {
3638
panic("Not implemented")
3739
}
40+
3841
func (m *MockEC2) DescribeImagesRequest(*ec2.DescribeImagesInput) (*request.Request, *ec2.DescribeImagesOutput) {
3942
panic("Not implemented")
4043
}
44+
4145
func (m *MockEC2) DescribeImagesWithContext(aws.Context, *ec2.DescribeImagesInput, ...request.Option) (*ec2.DescribeImagesOutput, error) {
4246
panic("Not implemented")
4347
}
@@ -70,12 +74,15 @@ func (m *MockEC2) DescribeImages(request *ec2.DescribeImagesInput) (*ec2.Describ
7074

7175
return response, nil
7276
}
77+
7378
func (m *MockEC2) DescribeImportImageTasksRequest(*ec2.DescribeImportImageTasksInput) (*request.Request, *ec2.DescribeImportImageTasksOutput) {
7479
panic("Not implemented")
7580
}
81+
7682
func (m *MockEC2) DescribeImportImageTasksWithContext(aws.Context, *ec2.DescribeImportImageTasksInput, ...request.Option) (*ec2.DescribeImportImageTasksOutput, error) {
7783
panic("Not implemented")
7884
}
85+
7986
func (m *MockEC2) DescribeImportImageTasks(*ec2.DescribeImportImageTasksInput) (*ec2.DescribeImportImageTasksOutput, error) {
8087
panic("Not implemented")
8188
}

cloudmock/aws/mockec2/instances.go

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func (m *MockEC2) DescribeInstances(*ec2.DescribeInstancesInput) (*ec2.DescribeI
3131
func (m *MockEC2) DescribeInstancesWithContext(aws.Context, *ec2.DescribeInstancesInput, ...request.Option) (*ec2.DescribeInstancesOutput, error) {
3232
panic("Not implemented")
3333
}
34+
3435
func (m *MockEC2) DescribeInstancesRequest(*ec2.DescribeInstancesInput) (*request.Request, *ec2.DescribeInstancesOutput) {
3536
panic("Not implemented")
3637
}
@@ -46,6 +47,7 @@ func (m *MockEC2) DescribeInstancesPages(request *ec2.DescribeInstancesInput, ca
4647

4748
return nil
4849
}
50+
4951
func (m *MockEC2) DescribeInstancesPagesWithContext(aws.Context, *ec2.DescribeInstancesInput, func(*ec2.DescribeInstancesOutput, bool) bool, ...request.Option) error {
5052
panic("Not implemented")
5153
}

cloudmock/aws/mockec2/internetgateways.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ func (m *MockEC2) AttachInternetGateway(request *ec2.AttachInternetGatewayInput)
174174
}
175175

176176
return nil, fmt.Errorf("InternetGateway not found")
177-
178177
}
179178

180179
func (m *MockEC2) AttachInternetGatewayWithContext(aws.Context, *ec2.AttachInternetGatewayInput, ...request.Option) (*ec2.AttachInternetGatewayOutput, error) {
181180
panic("Not implemented")
182181
}
182+
183183
func (m *MockEC2) AttachInternetGatewayRequest(*ec2.AttachInternetGatewayInput) (*request.Request, *ec2.AttachInternetGatewayOutput) {
184184
panic("Not implemented")
185185
}
@@ -215,6 +215,7 @@ func (m *MockEC2) DetachInternetGateway(request *ec2.DetachInternetGatewayInput)
215215
func (m *MockEC2) DetachInternetGatewayWithContext(aws.Context, *ec2.DetachInternetGatewayInput, ...request.Option) (*ec2.DetachInternetGatewayOutput, error) {
216216
panic("Not implemented")
217217
}
218+
218219
func (m *MockEC2) DetachInternetGatewayRequest(*ec2.DetachInternetGatewayInput) (*request.Request, *ec2.DetachInternetGatewayOutput) {
219220
panic("Not implemented")
220221
}
@@ -238,6 +239,7 @@ func (m *MockEC2) DeleteInternetGateway(request *ec2.DeleteInternetGatewayInput)
238239
func (m *MockEC2) DeleteInternetGatewayWithContext(aws.Context, *ec2.DeleteInternetGatewayInput, ...request.Option) (*ec2.DeleteInternetGatewayOutput, error) {
239240
panic("Not implemented")
240241
}
242+
241243
func (m *MockEC2) DeleteInternetGatewayRequest(*ec2.DeleteInternetGatewayInput) (*request.Request, *ec2.DeleteInternetGatewayOutput) {
242244
panic("Not implemented")
243245
}

cloudmock/aws/mockec2/keypairs.go

+8
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,19 @@ import (
3030
func (m *MockEC2) DescribeKeyPairsRequest(*ec2.DescribeKeyPairsInput) (*request.Request, *ec2.DescribeKeyPairsOutput) {
3131
panic("MockEC2 DescribeKeyPairsRequest not implemented")
3232
}
33+
3334
func (m *MockEC2) DescribeKeyPairsWithContext(aws.Context, *ec2.DescribeKeyPairsInput, ...request.Option) (*ec2.DescribeKeyPairsOutput, error) {
3435
panic("Not implemented")
3536
}
37+
3638
func (m *MockEC2) ImportKeyPairRequest(*ec2.ImportKeyPairInput) (*request.Request, *ec2.ImportKeyPairOutput) {
3739
panic("MockEC2 ImportKeyPairRequest not implemented")
3840
}
41+
3942
func (m *MockEC2) ImportKeyPairWithContext(aws.Context, *ec2.ImportKeyPairInput, ...request.Option) (*ec2.ImportKeyPairOutput, error) {
4043
panic("Not implemented")
4144
}
45+
4246
func (m *MockEC2) ImportKeyPair(request *ec2.ImportKeyPairInput) (*ec2.ImportKeyPairOutput, error) {
4347
m.mutex.Lock()
4448
defer m.mutex.Unlock()
@@ -71,12 +75,15 @@ func (m *MockEC2) ImportKeyPair(request *ec2.ImportKeyPairInput) (*ec2.ImportKey
7175

7276
return response, nil
7377
}
78+
7479
func (m *MockEC2) CreateKeyPairRequest(*ec2.CreateKeyPairInput) (*request.Request, *ec2.CreateKeyPairOutput) {
7580
panic("MockEC2 CreateKeyPairRequest not implemented")
7681
}
82+
7783
func (m *MockEC2) CreateKeyPairWithContext(aws.Context, *ec2.CreateKeyPairInput, ...request.Option) (*ec2.CreateKeyPairOutput, error) {
7884
panic("Not implemented")
7985
}
86+
8087
func (m *MockEC2) CreateKeyPair(*ec2.CreateKeyPairInput) (*ec2.CreateKeyPairOutput, error) {
8188
panic("MockEC2 CreateKeyPair not implemented")
8289
}
@@ -164,6 +171,7 @@ func (m *MockEC2) DeleteKeyPair(request *ec2.DeleteKeyPairInput) (*ec2.DeleteKey
164171
func (m *MockEC2) DeleteKeyPairWithContext(aws.Context, *ec2.DeleteKeyPairInput, ...request.Option) (*ec2.DeleteKeyPairOutput, error) {
165172
panic("Not implemented")
166173
}
174+
167175
func (m *MockEC2) DeleteKeyPairRequest(*ec2.DeleteKeyPairInput) (*request.Request, *ec2.DeleteKeyPairOutput) {
168176
panic("Not implemented")
169177
}

cloudmock/aws/mockec2/natgateway.go

+6
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,15 @@ func (m *MockEC2) WaitUntilNatGatewayAvailable(request *ec2.DescribeNatGatewaysI
9797

9898
return nil
9999
}
100+
100101
func (m *MockEC2) WaitUntilNatGatewayAvailableWithContext(aws.Context, *ec2.DescribeNatGatewaysInput, ...request.WaiterOption) error {
101102
panic("Not implemented")
102103
}
103104

104105
func (m *MockEC2) CreateNatGatewayWithContext(aws.Context, *ec2.CreateNatGatewayInput, ...request.Option) (*ec2.CreateNatGatewayOutput, error) {
105106
panic("Not implemented")
106107
}
108+
107109
func (m *MockEC2) CreateNatGatewayRequest(*ec2.CreateNatGatewayInput) (*request.Request, *ec2.CreateNatGatewayOutput) {
108110
panic("Not implemented")
109111
}
@@ -160,16 +162,19 @@ func (m *MockEC2) DescribeNatGateways(request *ec2.DescribeNatGatewaysInput) (*e
160162

161163
return response, nil
162164
}
165+
163166
func (m *MockEC2) DescribeNatGatewaysWithContext(aws.Context, *ec2.DescribeNatGatewaysInput, ...request.Option) (*ec2.DescribeNatGatewaysOutput, error) {
164167
panic("Not implemented")
165168
}
169+
166170
func (m *MockEC2) DescribeNatGatewaysRequest(*ec2.DescribeNatGatewaysInput) (*request.Request, *ec2.DescribeNatGatewaysOutput) {
167171
panic("Not implemented")
168172
}
169173

170174
func (m *MockEC2) DescribeNatGatewaysPages(*ec2.DescribeNatGatewaysInput, func(*ec2.DescribeNatGatewaysOutput, bool) bool) error {
171175
panic("Not implemented")
172176
}
177+
173178
func (m *MockEC2) DescribeNatGatewaysPagesWithContext(aws.Context, *ec2.DescribeNatGatewaysInput, func(*ec2.DescribeNatGatewaysOutput, bool) bool, ...request.Option) error {
174179
panic("Not implemented")
175180
}
@@ -193,6 +198,7 @@ func (m *MockEC2) DeleteNatGateway(request *ec2.DeleteNatGatewayInput) (*ec2.Del
193198
func (m *MockEC2) DeleteNatGatewayWithContext(aws.Context, *ec2.DeleteNatGatewayInput, ...request.Option) (*ec2.DeleteNatGatewayOutput, error) {
194199
panic("Not implemented")
195200
}
201+
196202
func (m *MockEC2) DeleteNatGatewayRequest(*ec2.DeleteNatGatewayInput) (*request.Request, *ec2.DeleteNatGatewayOutput) {
197203
panic("Not implemented")
198204
}

cloudmock/aws/mockec2/routetable.go

+5
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ func (m *MockEC2) CreateRouteTableWithId(request *ec2.CreateRouteTableInput, id
137137
func (m *MockEC2) CreateRouteTableWithContext(aws.Context, *ec2.CreateRouteTableInput, ...request.Option) (*ec2.CreateRouteTableOutput, error) {
138138
panic("Not implemented")
139139
}
140+
140141
func (m *MockEC2) CreateRouteTableRequest(*ec2.CreateRouteTableInput) (*request.Request, *ec2.CreateRouteTableOutput) {
141142
panic("Not implemented")
142143
}
@@ -171,9 +172,11 @@ func (m *MockEC2) CreateRoute(request *ec2.CreateRouteInput) (*ec2.CreateRouteOu
171172
rt.Routes = append(rt.Routes, r)
172173
return &ec2.CreateRouteOutput{Return: aws.Bool(true)}, nil
173174
}
175+
174176
func (m *MockEC2) CreateRouteWithContext(aws.Context, *ec2.CreateRouteInput, ...request.Option) (*ec2.CreateRouteOutput, error) {
175177
panic("Not implemented")
176178
}
179+
177180
func (m *MockEC2) CreateRouteRequest(*ec2.CreateRouteInput) (*request.Request, *ec2.CreateRouteOutput) {
178181
panic("Not implemented")
179182
}
@@ -193,9 +196,11 @@ func (m *MockEC2) DeleteRouteTable(request *ec2.DeleteRouteTableInput) (*ec2.Del
193196

194197
return &ec2.DeleteRouteTableOutput{}, nil
195198
}
199+
196200
func (m *MockEC2) DeleteRouteTableWithContext(aws.Context, *ec2.DeleteRouteTableInput, ...request.Option) (*ec2.DeleteRouteTableOutput, error) {
197201
panic("Not implemented")
198202
}
203+
199204
func (m *MockEC2) DeleteRouteTableRequest(*ec2.DeleteRouteTableInput) (*request.Request, *ec2.DeleteRouteTableOutput) {
200205
panic("Not implemented")
201206
}

0 commit comments

Comments
 (0)