Merge pull request #12867 from hakman/gofumpt_script

Add gofumpt scripts
This commit is contained in:
Kubernetes Prow Robot 2021-12-01 22:13:32 -08:00 committed by GitHub
commit 0be79b25b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
408 changed files with 866 additions and 1038 deletions

View File

@ -93,7 +93,7 @@ func Test_Replacement(t *testing.T) {
New *ChannelVersion
Replaces bool
}{
//Test ManifestHash Changes
// Test ManifestHash Changes
{
Old: &ChannelVersion{Id: "a", ManifestHash: hash1},
New: &ChannelVersion{Id: "a", ManifestHash: hash1},
@ -319,7 +319,6 @@ func Test_NeedsRollingUpdate(t *testing.T) {
}
}
}
func Test_InstallPKI(t *testing.T) {
@ -348,7 +347,7 @@ func Test_InstallPKI(t *testing.T) {
t.Errorf("unexpected error: %v", err)
}
//Two consecutive calls should work since multiple CP nodes can update at the same time
// Two consecutive calls should work since multiple CP nodes can update at the same time
err = addon.installPKI(ctx, fakek8s, fakecm)
if err != nil {
t.Errorf("unexpected error: %v", err)
@ -358,5 +357,4 @@ func Test_InstallPKI(t *testing.T) {
if err != nil {
t.Errorf("unexpected error: %v", err)
}
}

View File

@ -42,7 +42,7 @@ func Apply(data []byte) error {
}()
localManifestFile := path.Join(tmpDir, "manifest.yaml")
if err := os.WriteFile(localManifestFile, data, 0600); err != nil {
if err := os.WriteFile(localManifestFile, data, 0o600); err != nil {
return fmt.Errorf("error writing temp file: %v", err)
}

View File

@ -156,7 +156,6 @@ func (c *Channel) GetInstalledVersion(ctx context.Context, k8sClient kubernetes.
}
func (c *Channel) IsPKIInstalled(ctx context.Context, k8sClient kubernetes.Interface, cmClient certmanager.Interface) (bool, error) {
_, err := k8sClient.CoreV1().Secrets("kube-system").Get(ctx, c.Name+"-ca", metav1.GetOptions{})
if errors.IsNotFound(err) {
return false, nil
@ -174,12 +173,12 @@ func (c *Channel) IsPKIInstalled(ctx context.Context, k8sClient kubernetes.Inter
}
return true, nil
}
type annotationPatch struct {
Metadata annotationPatchMetadata `json:"metadata,omitempty"`
}
type annotationPatchMetadata struct {
Annotations map[string]string `json:"annotations,omitempty"`
}

View File

@ -76,5 +76,4 @@ func Test_IsPKIInstalled(t *testing.T) {
if !isInstalled {
t.Error("claims PKI is not installed when it is")
}
}

View File

@ -45,8 +45,7 @@ import (
"k8s.io/kops/util/pkg/tables"
)
type GetAddonsOptions struct {
}
type GetAddonsOptions struct{}
func NewCmdGetAddons(f Factory, out io.Writer) *cobra.Command {
var options GetAddonsOptions

View File

@ -19,7 +19,6 @@ package cmd
import (
goflag "flag"
"fmt"
"io"
"github.com/spf13/cobra"

View File

@ -46,6 +46,7 @@ func (m *MockAutoscaling) AttachLoadBalancersWithContext(aws.Context, *autoscali
klog.Fatalf("Not implemented")
return nil, nil
}
func (m *MockAutoscaling) AttachLoadBalancersRequest(*autoscaling.AttachLoadBalancersInput) (*request.Request, *autoscaling.AttachLoadBalancersOutput) {
klog.Fatalf("Not implemented")
return nil, nil

View File

@ -283,6 +283,7 @@ func (m *MockAutoscaling) DescribeAutoScalingGroupsWithContext(aws.Context, *aut
klog.Fatalf("Not implemented")
return nil, nil
}
func (m *MockAutoscaling) DescribeAutoScalingGroupsRequest(*autoscaling.DescribeAutoScalingGroupsInput) (*request.Request, *autoscaling.DescribeAutoScalingGroupsOutput) {
klog.Fatalf("Not implemented")
return nil, nil
@ -332,6 +333,7 @@ func (m *MockAutoscaling) DeleteAutoScalingGroupWithContext(aws.Context, *autosc
klog.Fatalf("Not implemented")
return nil, nil
}
func (m *MockAutoscaling) DeleteAutoScalingGroupRequest(*autoscaling.DeleteAutoScalingGroupInput) (*request.Request, *autoscaling.DeleteAutoScalingGroupOutput) {
klog.Fatalf("Not implemented")
return nil, nil

View File

@ -173,9 +173,11 @@ func (m *MockEC2) DescribeAddresses(request *ec2.DescribeAddressesInput) (*ec2.D
func (m *MockEC2) ReleaseAddressRequest(*ec2.ReleaseAddressInput) (*request.Request, *ec2.ReleaseAddressOutput) {
panic("Not implemented")
}
func (m *MockEC2) ReleaseAddressWithContext(aws.Context, *ec2.ReleaseAddressInput, ...request.Option) (*ec2.ReleaseAddressOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) ReleaseAddress(request *ec2.ReleaseAddressInput) (*ec2.ReleaseAddressOutput, error) {
m.mutex.Lock()
defer m.mutex.Unlock()

View File

@ -79,6 +79,7 @@ func (m *MockEC2) DescribeDhcpOptions(request *ec2.DescribeDhcpOptionsInput) (*e
func (m *MockEC2) DescribeDhcpOptionsWithContext(aws.Context, *ec2.DescribeDhcpOptionsInput, ...request.Option) (*ec2.DescribeDhcpOptionsOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DescribeDhcpOptionsRequest(*ec2.DescribeDhcpOptionsInput) (*request.Request, *ec2.DescribeDhcpOptionsOutput) {
panic("Not implemented")
}
@ -108,9 +109,11 @@ func (m *MockEC2) AssociateDhcpOptions(request *ec2.AssociateDhcpOptionsInput) (
return response, nil
}
func (m *MockEC2) AssociateDhcpOptionsWithContext(aws.Context, *ec2.AssociateDhcpOptionsInput, ...request.Option) (*ec2.AssociateDhcpOptionsOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) AssociateDhcpOptionsRequest(*ec2.AssociateDhcpOptionsInput) (*request.Request, *ec2.AssociateDhcpOptionsOutput) {
panic("Not implemented")
}
@ -154,9 +157,11 @@ func (m *MockEC2) CreateDhcpOptions(request *ec2.CreateDhcpOptionsInput) (*ec2.C
copy.Tags = m.getTags(ec2.ResourceTypeDhcpOptions, *dhcpOptions.DhcpOptionsId)
return &ec2.CreateDhcpOptionsOutput{DhcpOptions: &copy}, nil
}
func (m *MockEC2) CreateDhcpOptionsWithContext(aws.Context, *ec2.CreateDhcpOptionsInput, ...request.Option) (*ec2.CreateDhcpOptionsOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) CreateDhcpOptionsRequest(*ec2.CreateDhcpOptionsInput) (*request.Request, *ec2.CreateDhcpOptionsOutput) {
panic("Not implemented")
}
@ -180,6 +185,7 @@ func (m *MockEC2) DeleteDhcpOptions(request *ec2.DeleteDhcpOptionsInput) (*ec2.D
func (m *MockEC2) DeleteDhcpOptionsWithContext(aws.Context, *ec2.DeleteDhcpOptionsInput, ...request.Option) (*ec2.DeleteDhcpOptionsOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DeleteDhcpOptionsRequest(*ec2.DeleteDhcpOptionsInput) (*request.Request, *ec2.DeleteDhcpOptionsOutput) {
panic("Not implemented")
}

View File

@ -163,6 +163,7 @@ func (m *MockEC2) DescribeEgressOnlyInternetGateways(request *ec2.DescribeEgress
return response, nil
}
func (m *MockEC2) DeleteEgressOnlyInternetGateway(request *ec2.DeleteEgressOnlyInternetGatewayInput) (*ec2.DeleteEgressOnlyInternetGatewayOutput, error) {
m.mutex.Lock()
defer m.mutex.Unlock()
@ -182,6 +183,7 @@ func (m *MockEC2) DeleteEgressOnlyInternetGateway(request *ec2.DeleteEgressOnlyI
func (m *MockEC2) DeleteEgressOnlyInternetGatewayWithContext(aws.Context, *ec2.DeleteEgressOnlyInternetGatewayInput, ...request.Option) (*ec2.DeleteEgressOnlyInternetGatewayOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DeleteEgressOnlyInternetGatewayRequest(*ec2.DeleteEgressOnlyInternetGatewayInput) (*request.Request, *ec2.DeleteEgressOnlyInternetGatewayOutput) {
panic("Not implemented")
}

View File

@ -29,15 +29,19 @@ import (
func (m *MockEC2) DescribeImageAttributeRequest(*ec2.DescribeImageAttributeInput) (*request.Request, *ec2.DescribeImageAttributeOutput) {
panic("Not implemented")
}
func (m *MockEC2) DescribeImageAttributeWithContext(aws.Context, *ec2.DescribeImageAttributeInput, ...request.Option) (*ec2.DescribeImageAttributeOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DescribeImageAttribute(*ec2.DescribeImageAttributeInput) (*ec2.DescribeImageAttributeOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DescribeImagesRequest(*ec2.DescribeImagesInput) (*request.Request, *ec2.DescribeImagesOutput) {
panic("Not implemented")
}
func (m *MockEC2) DescribeImagesWithContext(aws.Context, *ec2.DescribeImagesInput, ...request.Option) (*ec2.DescribeImagesOutput, error) {
panic("Not implemented")
}
@ -70,12 +74,15 @@ func (m *MockEC2) DescribeImages(request *ec2.DescribeImagesInput) (*ec2.Describ
return response, nil
}
func (m *MockEC2) DescribeImportImageTasksRequest(*ec2.DescribeImportImageTasksInput) (*request.Request, *ec2.DescribeImportImageTasksOutput) {
panic("Not implemented")
}
func (m *MockEC2) DescribeImportImageTasksWithContext(aws.Context, *ec2.DescribeImportImageTasksInput, ...request.Option) (*ec2.DescribeImportImageTasksOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DescribeImportImageTasks(*ec2.DescribeImportImageTasksInput) (*ec2.DescribeImportImageTasksOutput, error) {
panic("Not implemented")
}

View File

@ -31,6 +31,7 @@ func (m *MockEC2) DescribeInstances(*ec2.DescribeInstancesInput) (*ec2.DescribeI
func (m *MockEC2) DescribeInstancesWithContext(aws.Context, *ec2.DescribeInstancesInput, ...request.Option) (*ec2.DescribeInstancesOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DescribeInstancesRequest(*ec2.DescribeInstancesInput) (*request.Request, *ec2.DescribeInstancesOutput) {
panic("Not implemented")
}
@ -46,6 +47,7 @@ func (m *MockEC2) DescribeInstancesPages(request *ec2.DescribeInstancesInput, ca
return nil
}
func (m *MockEC2) DescribeInstancesPagesWithContext(aws.Context, *ec2.DescribeInstancesInput, func(*ec2.DescribeInstancesOutput, bool) bool, ...request.Option) error {
panic("Not implemented")
}

View File

@ -174,12 +174,12 @@ func (m *MockEC2) AttachInternetGateway(request *ec2.AttachInternetGatewayInput)
}
return nil, fmt.Errorf("InternetGateway not found")
}
func (m *MockEC2) AttachInternetGatewayWithContext(aws.Context, *ec2.AttachInternetGatewayInput, ...request.Option) (*ec2.AttachInternetGatewayOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) AttachInternetGatewayRequest(*ec2.AttachInternetGatewayInput) (*request.Request, *ec2.AttachInternetGatewayOutput) {
panic("Not implemented")
}
@ -215,6 +215,7 @@ func (m *MockEC2) DetachInternetGateway(request *ec2.DetachInternetGatewayInput)
func (m *MockEC2) DetachInternetGatewayWithContext(aws.Context, *ec2.DetachInternetGatewayInput, ...request.Option) (*ec2.DetachInternetGatewayOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DetachInternetGatewayRequest(*ec2.DetachInternetGatewayInput) (*request.Request, *ec2.DetachInternetGatewayOutput) {
panic("Not implemented")
}
@ -238,6 +239,7 @@ func (m *MockEC2) DeleteInternetGateway(request *ec2.DeleteInternetGatewayInput)
func (m *MockEC2) DeleteInternetGatewayWithContext(aws.Context, *ec2.DeleteInternetGatewayInput, ...request.Option) (*ec2.DeleteInternetGatewayOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DeleteInternetGatewayRequest(*ec2.DeleteInternetGatewayInput) (*request.Request, *ec2.DeleteInternetGatewayOutput) {
panic("Not implemented")
}

View File

@ -30,15 +30,19 @@ import (
func (m *MockEC2) DescribeKeyPairsRequest(*ec2.DescribeKeyPairsInput) (*request.Request, *ec2.DescribeKeyPairsOutput) {
panic("MockEC2 DescribeKeyPairsRequest not implemented")
}
func (m *MockEC2) DescribeKeyPairsWithContext(aws.Context, *ec2.DescribeKeyPairsInput, ...request.Option) (*ec2.DescribeKeyPairsOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) ImportKeyPairRequest(*ec2.ImportKeyPairInput) (*request.Request, *ec2.ImportKeyPairOutput) {
panic("MockEC2 ImportKeyPairRequest not implemented")
}
func (m *MockEC2) ImportKeyPairWithContext(aws.Context, *ec2.ImportKeyPairInput, ...request.Option) (*ec2.ImportKeyPairOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) ImportKeyPair(request *ec2.ImportKeyPairInput) (*ec2.ImportKeyPairOutput, error) {
m.mutex.Lock()
defer m.mutex.Unlock()
@ -71,12 +75,15 @@ func (m *MockEC2) ImportKeyPair(request *ec2.ImportKeyPairInput) (*ec2.ImportKey
return response, nil
}
func (m *MockEC2) CreateKeyPairRequest(*ec2.CreateKeyPairInput) (*request.Request, *ec2.CreateKeyPairOutput) {
panic("MockEC2 CreateKeyPairRequest not implemented")
}
func (m *MockEC2) CreateKeyPairWithContext(aws.Context, *ec2.CreateKeyPairInput, ...request.Option) (*ec2.CreateKeyPairOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) CreateKeyPair(*ec2.CreateKeyPairInput) (*ec2.CreateKeyPairOutput, error) {
panic("MockEC2 CreateKeyPair not implemented")
}
@ -164,6 +171,7 @@ func (m *MockEC2) DeleteKeyPair(request *ec2.DeleteKeyPairInput) (*ec2.DeleteKey
func (m *MockEC2) DeleteKeyPairWithContext(aws.Context, *ec2.DeleteKeyPairInput, ...request.Option) (*ec2.DeleteKeyPairOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DeleteKeyPairRequest(*ec2.DeleteKeyPairInput) (*request.Request, *ec2.DeleteKeyPairOutput) {
panic("Not implemented")
}

View File

@ -97,6 +97,7 @@ func (m *MockEC2) WaitUntilNatGatewayAvailable(request *ec2.DescribeNatGatewaysI
return nil
}
func (m *MockEC2) WaitUntilNatGatewayAvailableWithContext(aws.Context, *ec2.DescribeNatGatewaysInput, ...request.WaiterOption) error {
panic("Not implemented")
}
@ -104,6 +105,7 @@ func (m *MockEC2) WaitUntilNatGatewayAvailableWithContext(aws.Context, *ec2.Desc
func (m *MockEC2) CreateNatGatewayWithContext(aws.Context, *ec2.CreateNatGatewayInput, ...request.Option) (*ec2.CreateNatGatewayOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) CreateNatGatewayRequest(*ec2.CreateNatGatewayInput) (*request.Request, *ec2.CreateNatGatewayOutput) {
panic("Not implemented")
}
@ -160,9 +162,11 @@ func (m *MockEC2) DescribeNatGateways(request *ec2.DescribeNatGatewaysInput) (*e
return response, nil
}
func (m *MockEC2) DescribeNatGatewaysWithContext(aws.Context, *ec2.DescribeNatGatewaysInput, ...request.Option) (*ec2.DescribeNatGatewaysOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DescribeNatGatewaysRequest(*ec2.DescribeNatGatewaysInput) (*request.Request, *ec2.DescribeNatGatewaysOutput) {
panic("Not implemented")
}
@ -170,6 +174,7 @@ func (m *MockEC2) DescribeNatGatewaysRequest(*ec2.DescribeNatGatewaysInput) (*re
func (m *MockEC2) DescribeNatGatewaysPages(*ec2.DescribeNatGatewaysInput, func(*ec2.DescribeNatGatewaysOutput, bool) bool) error {
panic("Not implemented")
}
func (m *MockEC2) DescribeNatGatewaysPagesWithContext(aws.Context, *ec2.DescribeNatGatewaysInput, func(*ec2.DescribeNatGatewaysOutput, bool) bool, ...request.Option) error {
panic("Not implemented")
}
@ -193,6 +198,7 @@ func (m *MockEC2) DeleteNatGateway(request *ec2.DeleteNatGatewayInput) (*ec2.Del
func (m *MockEC2) DeleteNatGatewayWithContext(aws.Context, *ec2.DeleteNatGatewayInput, ...request.Option) (*ec2.DeleteNatGatewayOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DeleteNatGatewayRequest(*ec2.DeleteNatGatewayInput) (*request.Request, *ec2.DeleteNatGatewayOutput) {
panic("Not implemented")
}

View File

@ -137,6 +137,7 @@ func (m *MockEC2) CreateRouteTableWithId(request *ec2.CreateRouteTableInput, id
func (m *MockEC2) CreateRouteTableWithContext(aws.Context, *ec2.CreateRouteTableInput, ...request.Option) (*ec2.CreateRouteTableOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) CreateRouteTableRequest(*ec2.CreateRouteTableInput) (*request.Request, *ec2.CreateRouteTableOutput) {
panic("Not implemented")
}
@ -171,9 +172,11 @@ func (m *MockEC2) CreateRoute(request *ec2.CreateRouteInput) (*ec2.CreateRouteOu
rt.Routes = append(rt.Routes, r)
return &ec2.CreateRouteOutput{Return: aws.Bool(true)}, nil
}
func (m *MockEC2) CreateRouteWithContext(aws.Context, *ec2.CreateRouteInput, ...request.Option) (*ec2.CreateRouteOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) CreateRouteRequest(*ec2.CreateRouteInput) (*request.Request, *ec2.CreateRouteOutput) {
panic("Not implemented")
}
@ -193,9 +196,11 @@ func (m *MockEC2) DeleteRouteTable(request *ec2.DeleteRouteTableInput) (*ec2.Del
return &ec2.DeleteRouteTableOutput{}, nil
}
func (m *MockEC2) DeleteRouteTableWithContext(aws.Context, *ec2.DeleteRouteTableInput, ...request.Option) (*ec2.DeleteRouteTableOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DeleteRouteTableRequest(*ec2.DeleteRouteTableInput) (*request.Request, *ec2.DeleteRouteTableOutput) {
panic("Not implemented")
}

View File

@ -91,18 +91,23 @@ func (m *MockEC2) DeleteSecurityGroup(request *ec2.DeleteSecurityGroupInput) (*e
func (m *MockEC2) DescribeSecurityGroupReferencesRequest(*ec2.DescribeSecurityGroupReferencesInput) (*request.Request, *ec2.DescribeSecurityGroupReferencesOutput) {
panic("Not implemented")
}
func (m *MockEC2) DescribeSecurityGroupReferencesWithContext(aws.Context, *ec2.DescribeSecurityGroupReferencesInput, ...request.Option) (*ec2.DescribeSecurityGroupReferencesOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DescribeSecurityGroupReferences(*ec2.DescribeSecurityGroupReferencesInput) (*ec2.DescribeSecurityGroupReferencesOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DescribeSecurityGroupsRequest(*ec2.DescribeSecurityGroupsInput) (*request.Request, *ec2.DescribeSecurityGroupsOutput) {
panic("Not implemented")
}
func (m *MockEC2) DescribeSecurityGroupsWithContext(aws.Context, *ec2.DescribeSecurityGroupsInput, ...request.Option) (*ec2.DescribeSecurityGroupsOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DescribeSecurityGroups(request *ec2.DescribeSecurityGroupsInput) (*ec2.DescribeSecurityGroupsOutput, error) {
m.mutex.Lock()
defer m.mutex.Unlock()
@ -169,24 +174,31 @@ func (m *MockEC2) DescribeSecurityGroups(request *ec2.DescribeSecurityGroupsInpu
func (m *MockEC2) DescribeStaleSecurityGroupsRequest(*ec2.DescribeStaleSecurityGroupsInput) (*request.Request, *ec2.DescribeStaleSecurityGroupsOutput) {
panic("Not implemented")
}
func (m *MockEC2) DescribeStaleSecurityGroupsWithContext(aws.Context, *ec2.DescribeStaleSecurityGroupsInput, ...request.Option) (*ec2.DescribeStaleSecurityGroupsOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DescribeStaleSecurityGroups(*ec2.DescribeStaleSecurityGroupsInput) (*ec2.DescribeStaleSecurityGroupsOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) RevokeSecurityGroupEgressRequest(*ec2.RevokeSecurityGroupEgressInput) (*request.Request, *ec2.RevokeSecurityGroupEgressOutput) {
panic("Not implemented")
}
func (m *MockEC2) RevokeSecurityGroupEgressWithContext(aws.Context, *ec2.RevokeSecurityGroupEgressInput, ...request.Option) (*ec2.RevokeSecurityGroupEgressOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) RevokeSecurityGroupEgress(*ec2.RevokeSecurityGroupEgressInput) (*ec2.RevokeSecurityGroupEgressOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) RevokeSecurityGroupIngressRequest(*ec2.RevokeSecurityGroupIngressInput) (*request.Request, *ec2.RevokeSecurityGroupIngressOutput) {
panic("Not implemented")
}
func (m *MockEC2) RevokeSecurityGroupIngressWithContext(aws.Context, *ec2.RevokeSecurityGroupIngressInput, ...request.Option) (*ec2.RevokeSecurityGroupIngressOutput, error) {
panic("Not implemented")
}
@ -222,9 +234,11 @@ func (m *MockEC2) RevokeSecurityGroupIngress(request *ec2.RevokeSecurityGroupIng
func (m *MockEC2) AuthorizeSecurityGroupEgressRequest(*ec2.AuthorizeSecurityGroupEgressInput) (*request.Request, *ec2.AuthorizeSecurityGroupEgressOutput) {
panic("Not implemented")
}
func (m *MockEC2) AuthorizeSecurityGroupEgressWithContext(aws.Context, *ec2.AuthorizeSecurityGroupEgressInput, ...request.Option) (*ec2.AuthorizeSecurityGroupEgressOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) AuthorizeSecurityGroupEgress(request *ec2.AuthorizeSecurityGroupEgressInput) (*ec2.AuthorizeSecurityGroupEgressOutput, error) {
m.mutex.Lock()
defer m.mutex.Unlock()
@ -327,12 +341,15 @@ func (m *MockEC2) AuthorizeSecurityGroupEgress(request *ec2.AuthorizeSecurityGro
response := &ec2.AuthorizeSecurityGroupEgressOutput{}
return response, nil
}
func (m *MockEC2) AuthorizeSecurityGroupIngressRequest(*ec2.AuthorizeSecurityGroupIngressInput) (*request.Request, *ec2.AuthorizeSecurityGroupIngressOutput) {
panic("Not implemented")
}
func (m *MockEC2) AuthorizeSecurityGroupIngressWithContext(aws.Context, *ec2.AuthorizeSecurityGroupIngressInput, ...request.Option) (*ec2.AuthorizeSecurityGroupIngressOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) AuthorizeSecurityGroupIngress(request *ec2.AuthorizeSecurityGroupIngressInput) (*ec2.AuthorizeSecurityGroupIngressOutput, error) {
m.mutex.Lock()
defer m.mutex.Unlock()

View File

@ -217,9 +217,11 @@ func (m *MockEC2) AssociateRouteTable(request *ec2.AssociateRouteTableInput) (*e
}
return response, nil
}
func (m *MockEC2) AssociateRouteTableWithContext(aws.Context, *ec2.AssociateRouteTableInput, ...request.Option) (*ec2.AssociateRouteTableOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) AssociateRouteTableRequest(*ec2.AssociateRouteTableInput) (*request.Request, *ec2.AssociateRouteTableOutput) {
panic("Not implemented")
}
@ -243,6 +245,7 @@ func (m *MockEC2) DeleteSubnet(request *ec2.DeleteSubnetInput) (*ec2.DeleteSubne
func (m *MockEC2) DeleteSubnetWithContext(aws.Context, *ec2.DeleteSubnetInput, ...request.Option) (*ec2.DeleteSubnetOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DeleteSubnetRequest(*ec2.DeleteSubnetInput) (*request.Request, *ec2.DeleteSubnetOutput) {
panic("Not implemented")
}

View File

@ -209,9 +209,11 @@ func (m *MockEC2) DescribeTags(request *ec2.DescribeTagsInput) (*ec2.DescribeTag
return response, nil
}
func (m *MockEC2) DescribeTagsPages(*ec2.DescribeTagsInput, func(*ec2.DescribeTagsOutput, bool) bool) error {
panic("Not implemented")
}
func (m *MockEC2) DescribeTagsPagesWithContext(aws.Context, *ec2.DescribeTagsInput, func(*ec2.DescribeTagsOutput, bool) bool, ...request.Option) error {
panic("Not implemented")
}

View File

@ -76,6 +76,7 @@ func (m *MockEC2) CreateVolume(request *ec2.CreateVolumeInput) (*ec2.Volume, err
func (m *MockEC2) CreateVolumeWithContext(aws.Context, *ec2.CreateVolumeInput, ...request.Option) (*ec2.Volume, error) {
panic("Not implemented")
}
func (m *MockEC2) CreateVolumeRequest(*ec2.CreateVolumeInput) (*request.Request, *ec2.Volume) {
panic("Not implemented")
}
@ -83,33 +84,43 @@ func (m *MockEC2) CreateVolumeRequest(*ec2.CreateVolumeInput) (*request.Request,
func (m *MockEC2) DescribeVolumeAttributeRequest(*ec2.DescribeVolumeAttributeInput) (*request.Request, *ec2.DescribeVolumeAttributeOutput) {
panic("MockEC2 DescribeVolumeAttributeRequest not implemented")
}
func (m *MockEC2) DescribeVolumeAttributeWithContext(aws.Context, *ec2.DescribeVolumeAttributeInput, ...request.Option) (*ec2.DescribeVolumeAttributeOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DescribeVolumeAttribute(*ec2.DescribeVolumeAttributeInput) (*ec2.DescribeVolumeAttributeOutput, error) {
panic("MockEC2 DescribeVolumeAttribute not implemented")
}
func (m *MockEC2) DescribeVolumeStatusRequest(*ec2.DescribeVolumeStatusInput) (*request.Request, *ec2.DescribeVolumeStatusOutput) {
panic("MockEC2 DescribeVolumeStatusRequest not implemented")
}
func (m *MockEC2) DescribeVolumeStatusWithContext(aws.Context, *ec2.DescribeVolumeStatusInput, ...request.Option) (*ec2.DescribeVolumeStatusOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DescribeVolumeStatus(*ec2.DescribeVolumeStatusInput) (*ec2.DescribeVolumeStatusOutput, error) {
panic("MockEC2 DescribeVolumeStatus not implemented")
}
func (m *MockEC2) DescribeVolumeStatusPages(*ec2.DescribeVolumeStatusInput, func(*ec2.DescribeVolumeStatusOutput, bool) bool) error {
panic("MockEC2 DescribeVolumeStatusPages not implemented")
}
func (m *MockEC2) DescribeVolumeStatusPagesWithContext(aws.Context, *ec2.DescribeVolumeStatusInput, func(*ec2.DescribeVolumeStatusOutput, bool) bool, ...request.Option) error {
panic("Not implemented")
}
func (m *MockEC2) DescribeVolumesRequest(*ec2.DescribeVolumesInput) (*request.Request, *ec2.DescribeVolumesOutput) {
panic("MockEC2 DescribeVolumesRequest not implemented")
}
func (m *MockEC2) DescribeVolumesWithContext(aws.Context, *ec2.DescribeVolumesInput, ...request.Option) (*ec2.DescribeVolumesOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DescribeVolumes(request *ec2.DescribeVolumesInput) (*ec2.DescribeVolumesOutput, error) {
m.mutex.Lock()
defer m.mutex.Unlock()
@ -127,7 +138,6 @@ func (m *MockEC2) DescribeVolumes(request *ec2.DescribeVolumesInput) (*ec2.Descr
for _, filter := range request.Filters {
match := false
switch *filter.Name {
default:
if strings.HasPrefix(*filter.Name, "tag:") {
match = m.hasTag(ec2.ResourceTypeVolume, *volume.VolumeId, filter)
@ -177,9 +187,11 @@ func (m *MockEC2) DescribeVolumesPagesWithContext(aws.Context, *ec2.DescribeVolu
func (m *MockEC2) DescribeVolumesModifications(*ec2.DescribeVolumesModificationsInput) (*ec2.DescribeVolumesModificationsOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DescribeVolumesModificationsWithContext(aws.Context, *ec2.DescribeVolumesModificationsInput, ...request.Option) (*ec2.DescribeVolumesModificationsOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DescribeVolumesModificationsRequest(*ec2.DescribeVolumesModificationsInput) (*request.Request, *ec2.DescribeVolumesModificationsOutput) {
panic("Not implemented")
}
@ -203,6 +215,7 @@ func (m *MockEC2) DeleteVolume(request *ec2.DeleteVolumeInput) (*ec2.DeleteVolum
func (m *MockEC2) DeleteVolumeWithContext(aws.Context, *ec2.DeleteVolumeInput, ...request.Option) (*ec2.DeleteVolumeOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DeleteVolumeRequest(*ec2.DeleteVolumeInput) (*request.Request, *ec2.DeleteVolumeOutput) {
panic("Not implemented")
}

View File

@ -48,9 +48,11 @@ func (m *MockEC2) FindVpc(id string) *ec2.Vpc {
func (m *MockEC2) CreateVpcRequest(*ec2.CreateVpcInput) (*request.Request, *ec2.CreateVpcOutput) {
panic("Not implemented")
}
func (m *MockEC2) CreateVpcWithContext(aws.Context, *ec2.CreateVpcInput, ...request.Option) (*ec2.CreateVpcOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) CreateVpcWithId(request *ec2.CreateVpcInput, id string) (*ec2.CreateVpcOutput, error) {
m.mutex.Lock()
defer m.mutex.Unlock()
@ -155,9 +157,11 @@ func (m *MockEC2) DescribeVpcs(request *ec2.DescribeVpcsInput) (*ec2.DescribeVpc
func (m *MockEC2) DescribeVpcAttributeRequest(*ec2.DescribeVpcAttributeInput) (*request.Request, *ec2.DescribeVpcAttributeOutput) {
panic("Not implemented")
}
func (m *MockEC2) DescribeVpcAttributeWithContext(aws.Context, *ec2.DescribeVpcAttributeInput, ...request.Option) (*ec2.DescribeVpcAttributeOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DescribeVpcAttribute(request *ec2.DescribeVpcAttributeInput) (*ec2.DescribeVpcAttributeOutput, error) {
m.mutex.Lock()
defer m.mutex.Unlock()
@ -202,9 +206,11 @@ func (m *MockEC2) ModifyVpcAttribute(request *ec2.ModifyVpcAttributeInput) (*ec2
return response, nil
}
func (m *MockEC2) ModifyVpcAttributeWithContext(aws.Context, *ec2.ModifyVpcAttributeInput, ...request.Option) (*ec2.ModifyVpcAttributeOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) ModifyVpcAttributeRequest(*ec2.ModifyVpcAttributeInput) (*request.Request, *ec2.ModifyVpcAttributeOutput) {
panic("Not implemented")
}
@ -228,6 +234,7 @@ func (m *MockEC2) DeleteVpc(request *ec2.DeleteVpcInput) (*ec2.DeleteVpcOutput,
func (m *MockEC2) DeleteVpcWithContext(aws.Context, *ec2.DeleteVpcInput, ...request.Option) (*ec2.DeleteVpcOutput, error) {
panic("Not implemented")
}
func (m *MockEC2) DeleteVpcRequest(*ec2.DeleteVpcInput) (*request.Request, *ec2.DeleteVpcOutput) {
panic("Not implemented")
}

View File

@ -39,9 +39,11 @@ func (m *MockIAM) GetInstanceProfile(request *iam.GetInstanceProfileInput) (*iam
}
return response, nil
}
func (m *MockIAM) GetInstanceProfileWithContext(aws.Context, *iam.GetInstanceProfileInput, ...request.Option) (*iam.GetInstanceProfileOutput, error) {
panic("Not implemented")
}
func (m *MockIAM) GetInstanceProfileRequest(*iam.GetInstanceProfileInput) (*request.Request, *iam.GetInstanceProfileOutput) {
panic("Not implemented")
}
@ -81,12 +83,15 @@ func (m *MockIAM) CreateInstanceProfile(request *iam.CreateInstanceProfileInput)
copy := *p
return &iam.CreateInstanceProfileOutput{InstanceProfile: &copy}, nil
}
func (m *MockIAM) CreateInstanceProfileWithContext(aws.Context, *iam.CreateInstanceProfileInput, ...request.Option) (*iam.CreateInstanceProfileOutput, error) {
panic("Not implemented")
}
func (m *MockIAM) CreateInstanceProfileRequest(*iam.CreateInstanceProfileInput) (*request.Request, *iam.CreateInstanceProfileOutput) {
panic("Not implemented")
}
func (m *MockIAM) AddRoleToInstanceProfile(request *iam.AddRoleToInstanceProfileInput) (*iam.AddRoleToInstanceProfileOutput, error) {
m.mutex.Lock()
defer m.mutex.Unlock()
@ -147,6 +152,7 @@ func (m *MockIAM) RemoveRoleFromInstanceProfile(request *iam.RemoveRoleFromInsta
func (m *MockIAM) RemoveRoleFromInstanceProfileWithContext(aws.Context, *iam.RemoveRoleFromInstanceProfileInput, ...request.Option) (*iam.RemoveRoleFromInstanceProfileOutput, error) {
panic("Not implemented")
}
func (m *MockIAM) RemoveRoleFromInstanceProfileRequest(*iam.RemoveRoleFromInstanceProfileInput) (*request.Request, *iam.RemoveRoleFromInstanceProfileOutput) {
panic("Not implemented")
}
@ -218,6 +224,7 @@ func (m *MockIAM) DeleteInstanceProfile(request *iam.DeleteInstanceProfileInput)
func (m *MockIAM) DeleteInstanceProfileWithContext(aws.Context, *iam.DeleteInstanceProfileInput, ...request.Option) (*iam.DeleteInstanceProfileOutput, error) {
panic("Not implemented")
}
func (m *MockIAM) DeleteInstanceProfileRequest(*iam.DeleteInstanceProfileInput) (*request.Request, *iam.DeleteInstanceProfileOutput) {
panic("Not implemented")
}

View File

@ -79,6 +79,7 @@ func (m *MockIAM) CreateRole(request *iam.CreateRoleInput) (*iam.CreateRoleOutpu
func (m *MockIAM) CreateRoleWithContext(aws.Context, *iam.CreateRoleInput, ...request.Option) (*iam.CreateRoleOutput, error) {
panic("Not implemented")
}
func (m *MockIAM) CreateRoleRequest(*iam.CreateRoleInput) (*request.Request, *iam.CreateRoleOutput) {
panic("Not implemented")
}
@ -110,6 +111,7 @@ func (m *MockIAM) ListRoles(request *iam.ListRolesInput) (*iam.ListRolesOutput,
func (m *MockIAM) ListRolesWithContext(aws.Context, *iam.ListRolesInput, ...request.Option) (*iam.ListRolesOutput, error) {
panic("Not implemented")
}
func (m *MockIAM) ListRolesRequest(*iam.ListRolesInput) (*request.Request, *iam.ListRolesOutput) {
panic("Not implemented")
}

View File

@ -55,9 +55,11 @@ func (m *MockIAM) GetRolePolicy(request *iam.GetRolePolicyInput) (*iam.GetRolePo
}
return nil, awserr.New(iam.ErrCodeNoSuchEntityException, "No such entity", nil)
}
func (m *MockIAM) GetRolePolicyWithContext(aws.Context, *iam.GetRolePolicyInput, ...request.Option) (*iam.GetRolePolicyOutput, error) {
panic("Not implemented")
}
func (m *MockIAM) GetRolePolicyRequest(*iam.GetRolePolicyInput) (*request.Request, *iam.GetRolePolicyOutput) {
panic("Not implemented")
}
@ -90,9 +92,11 @@ func (m *MockIAM) PutRolePolicy(request *iam.PutRolePolicyInput) (*iam.PutRolePo
return &iam.PutRolePolicyOutput{}, nil
}
func (m *MockIAM) PutRolePolicyWithContext(aws.Context, *iam.PutRolePolicyInput, ...request.Option) (*iam.PutRolePolicyOutput, error) {
panic("Not implemented")
}
func (m *MockIAM) PutRolePolicyRequest(*iam.PutRolePolicyInput) (*request.Request, *iam.PutRolePolicyOutput) {
panic("Not implemented")
}
@ -171,6 +175,7 @@ func (m *MockIAM) DeleteRolePolicy(request *iam.DeleteRolePolicyInput) (*iam.Del
func (m *MockIAM) DeleteRolePolicyWithContext(aws.Context, *iam.DeleteRolePolicyInput, ...request.Option) (*iam.DeleteRolePolicyOutput, error) {
panic("Not implemented")
}
func (m *MockIAM) DeleteRolePolicyRequest(*iam.DeleteRolePolicyInput) (*request.Request, *iam.DeleteRolePolicyOutput) {
panic("Not implemented")
}

View File

@ -45,6 +45,7 @@ func (m *MockIAM) ListOpenIDConnectProviders(request *iam.ListOpenIDConnectProvi
func (m *MockIAM) ListOpenIDConnectProvidersWithContext(aws.Context, *iam.ListOpenIDConnectProvidersInput, ...request.Option) (*iam.ListOpenIDConnectProvidersOutput, error) {
panic("Not implemented")
}
func (m *MockIAM) ListOpenIDConnectProvidersRequest(*iam.ListOpenIDConnectProvidersInput) (*request.Request, *iam.ListOpenIDConnectProvidersOutput) {
panic("Not implemented")
}
@ -104,6 +105,7 @@ func (m *MockIAM) CreateOpenIDConnectProvider(request *iam.CreateOpenIDConnectPr
func (m *MockIAM) CreateOpenIDConnectProviderWithContext(aws.Context, *iam.CreateOpenIDConnectProviderInput, ...request.Option) (*iam.CreateOpenIDConnectProviderOutput, error) {
panic("Not implemented")
}
func (m *MockIAM) CreateOpenIDConnectProviderRequest(*iam.CreateOpenIDConnectProviderInput) (*request.Request, *iam.CreateOpenIDConnectProviderOutput) {
panic("Not implemented")
}
@ -135,9 +137,11 @@ func (m *MockIAM) DeleteOpenIDConnectProviderRequest(*iam.DeleteOpenIDConnectPro
func (m *MockIAM) UpdateOpenIDConnectProviderThumbprint(*iam.UpdateOpenIDConnectProviderThumbprintInput) (*iam.UpdateOpenIDConnectProviderThumbprintOutput, error) {
panic("Not implemented")
}
func (m *MockIAM) UpdateOpenIDConnectProviderThumbprintWithContext(aws.Context, *iam.UpdateOpenIDConnectProviderThumbprintInput, ...request.Option) (*iam.UpdateOpenIDConnectProviderThumbprintOutput, error) {
panic("Not implemented")
}
func (m *MockIAM) UpdateOpenIDConnectProviderThumbprintRequest(*iam.UpdateOpenIDConnectProviderThumbprintInput) (*request.Request, *iam.UpdateOpenIDConnectProviderThumbprintOutput) {
panic("Not implemented")
}

View File

@ -61,9 +61,11 @@ func (m *MockRoute53) GetHostedZone(request *route53.GetHostedZoneInput) (*route
func (m *MockRoute53) GetHostedZoneCountRequest(*route53.GetHostedZoneCountInput) (*request.Request, *route53.GetHostedZoneCountOutput) {
panic("MockRoute53 GetHostedZoneCountRequest not implemented")
}
func (m *MockRoute53) GetHostedZoneCountWithContext(aws.Context, *route53.GetHostedZoneCountInput, ...request.Option) (*route53.GetHostedZoneCountOutput, error) {
panic("Not implemented")
}
func (m *MockRoute53) GetHostedZoneCount(*route53.GetHostedZoneCountInput) (*route53.GetHostedZoneCountOutput, error) {
panic("MockRoute53 GetHostedZoneCount not implemented")
}

View File

@ -21,8 +21,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/gce"
)
type changeClient struct {
}
type changeClient struct{}
var _ gce.ChangeClient = &changeClient{}

View File

@ -76,7 +76,6 @@ func (m *MockClient) mockVolumes() {
}
func (m *MockClient) listVolumes(w http.ResponseWriter, vals url.Values) {
w.WriteHeader(http.StatusOK)
vols := filterVolumes(m.volumes, vals)

View File

@ -69,7 +69,6 @@ func (m *MockClient) mockFlavors() {
}
func (m *MockClient) listFlavors(w http.ResponseWriter) {
w.WriteHeader(http.StatusOK)
flavors := make([]flavors.Flavor, 0)

View File

@ -40,7 +40,6 @@ type recordSetsListResponse struct {
}
func (m *MockClient) mockZones() {
handler := func(w http.ResponseWriter, r *http.Request) {
m.mutex.Lock()
defer m.mutex.Unlock()
@ -85,7 +84,6 @@ func (m *MockClient) mockZones() {
}
func (m *MockClient) listZones(w http.ResponseWriter) {
w.WriteHeader(http.StatusOK)
zones := make([]zones.Zone, 0)

View File

@ -64,7 +64,6 @@ func (m *MockClient) mockImages() {
}
func (m *MockClient) listImages(w http.ResponseWriter) {
w.WriteHeader(http.StatusOK)
images := make([]images.Image, 0)

View File

@ -66,7 +66,6 @@ func (m *MockClient) mockListeners() {
}
func (m *MockClient) listListeners(w http.ResponseWriter, vals url.Values) {
w.WriteHeader(http.StatusOK)
listeners := make([]listeners.Listener, 0)

View File

@ -73,7 +73,6 @@ func (m *MockClient) mockLoadBalancers() {
}
func (m *MockClient) listLoadBalancers(w http.ResponseWriter, vals url.Values) {
w.WriteHeader(http.StatusOK)
loadbalancers := make([]loadbalancers.LoadBalancer, 0)

View File

@ -71,7 +71,6 @@ func (m *MockClient) mockPools() {
}
func (m *MockClient) listPools(w http.ResponseWriter, vals url.Values) {
w.WriteHeader(http.StatusOK)
pools := make([]pools.Pool, 0)

View File

@ -55,7 +55,6 @@ func (m *MockClient) mockFloatingIPs() {
}
func (m *MockClient) listFloatingIPs(w http.ResponseWriter, vals url.Values) {
w.WriteHeader(http.StatusOK)
floatingips := make([]floatingips.FloatingIP, 0)

View File

@ -83,7 +83,6 @@ func (m *MockClient) mockNetworks() {
}
func (m *MockClient) listNetworks(w http.ResponseWriter, vals url.Values) {
w.WriteHeader(http.StatusOK)
networks := make([]externalNetwork, 0)

View File

@ -67,7 +67,6 @@ func (m *MockClient) mockPorts() {
case http.MethodPut:
parts := strings.Split(strings.Trim(r.URL.Path, "/"), "/")
if len(parts) == 4 && parts[2] == "tags" {
m.tagPort(w, r)
} else if len(parts) == 2 {
m.updatePort(w, r)
@ -85,7 +84,6 @@ func (m *MockClient) mockPorts() {
}
func (m *MockClient) listPorts(w http.ResponseWriter, vals url.Values) {
w.WriteHeader(http.StatusOK)
ports := make([]ports.Port, 0)
@ -245,5 +243,4 @@ func (m *MockClient) updatePort(w http.ResponseWriter, r *http.Request) {
m.ports[portID] = port
w.WriteHeader(http.StatusOK)
}

View File

@ -75,7 +75,6 @@ func (m *MockClient) mockRouters() {
}
func (m *MockClient) listRouters(w http.ResponseWriter, vals url.Values) {
w.WriteHeader(http.StatusOK)
routers := make([]routers.Router, 0)

View File

@ -71,7 +71,6 @@ func (m *MockClient) mockSecurityGroupRules() {
}
func (m *MockClient) listSecurityGroupRules(w http.ResponseWriter, vals url.Values) {
w.WriteHeader(http.StatusOK)
sgrs := filterRules(m.securityGroupRules, vals)

View File

@ -70,7 +70,6 @@ func (m *MockClient) mockSecurityGroups() {
}
func (m *MockClient) listSecurityGroups(w http.ResponseWriter, vals url.Values) {
w.WriteHeader(http.StatusOK)
sgs := make([]groups.SecGroup, 0)

View File

@ -162,7 +162,6 @@ func (r *LegacyNodeReconciler) getClusterForNode(node *corev1.Node) (*kops.Clust
// getInstanceLifecycle returns InstanceLifecycle string object
func (r *LegacyNodeReconciler) getInstanceLifecycle(ctx context.Context, node *corev1.Node) (string, error) {
identity, err := r.identifier.IdentifyNode(ctx, node)
if err != nil {
return "", fmt.Errorf("error identifying node %q: %v", node.Name, err)

View File

@ -52,7 +52,6 @@ var (
)
func init() {
// +kubebuilder:scaffold:scheme
}
@ -61,7 +60,7 @@ func main() {
// Disable metrics by default (avoid port conflicts, also risky because we are host network)
metricsAddress := ":0"
//flag.StringVar(&metricsAddr, "metrics-addr", metricsAddress, "The address the metric endpoint binds to.")
// flag.StringVar(&metricsAddr, "metrics-addr", metricsAddress, "The address the metric endpoint binds to.")
configPath := "/etc/kubernetes/kops-controller/config.yaml"
flag.StringVar(&configPath, "conf", configPath, "Location of yaml configuration file")

View File

@ -100,8 +100,8 @@ func RunCreate(ctx context.Context, f *util.Factory, out io.Writer, c *CreateOpt
return err
}
var clusterName = ""
//var cSpec = false
clusterName := ""
// var cSpec = false
var sb bytes.Buffer
fmt.Fprintf(&sb, "\n")
for _, f := range c.Filenames {
@ -146,7 +146,7 @@ func RunCreate(ctx context.Context, f *util.Factory, out io.Writer, c *CreateOpt
return fmt.Errorf("error creating cluster: %v", err)
}
fmt.Fprintf(&sb, "Created cluster/%s\n", v.ObjectMeta.Name)
//cSpec = true
// cSpec = true
case *kopsapi.InstanceGroup:
clusterName = v.ObjectMeta.Labels[kopsapi.LabelClusterName]

View File

@ -808,7 +808,6 @@ func RunCreateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *Cr
// parseCloudLabels takes a CSV list of key=value records and parses them into a map. Nested '='s are supported via
// quoted strings (eg `foo="bar=baz"` parses to map[string]string{"foo":"bar=baz"}. Nested commas are not supported.
func parseCloudLabels(s string) (map[string]string, error) {
// Replace commas with newlines to allow a single pass with csv.Reader.
// We can't use csv.Reader for the initial split because it would see each key=value record as a single field
// and significantly complicates using quoted fields as keys or values.

View File

@ -231,9 +231,7 @@ func RunCreateInstanceGroup(ctx context.Context, f *util.Factory, out io.Writer,
}
if options.Edit {
var (
edit = editor.NewDefaultEditor(commandutils.EditorEnvs)
)
edit := editor.NewDefaultEditor(commandutils.EditorEnvs)
raw, err := kopscodecs.ToVersionedYaml(ig)
if err != nil {

View File

@ -24,9 +24,7 @@ import (
"k8s.io/kubectl/pkg/util/i18n"
)
var (
createSecretShort = i18n.T(`Create a secret.`)
)
var createSecretShort = i18n.T(`Create a secret.`)
func NewCmdCreateSecret(f *util.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{

View File

@ -65,5 +65,4 @@ func TestConfirmation(t *testing.T) {
if answer != true {
t.Fatal("Confirmation should have been approved.")
}
}

View File

@ -19,10 +19,9 @@ package main
import (
"context"
"fmt"
"strings"
"io"
"os"
"strings"
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -122,7 +121,6 @@ func NewCmdDeleteInstanceGroup(f *util.Factory, out io.Writer) *cobra.Command {
// RunDeleteInstanceGroup runs the deletion of an instance group
func RunDeleteInstanceGroup(ctx context.Context, f *util.Factory, out io.Writer, options *DeleteInstanceGroupOptions) error {
// TODO make this drain and validate the ig?
// TODO implement drain and validate logic
groupName := options.GroupName

View File

@ -24,9 +24,7 @@ import (
"k8s.io/kubectl/pkg/util/i18n"
)
var (
distrustShort = i18n.T("Distrust keypairs.")
)
var distrustShort = i18n.T("Distrust keypairs.")
func NewCmdDistrust(f *util.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{

View File

@ -139,9 +139,7 @@ func RunEditCluster(ctx context.Context, f *util.Factory, out io.Writer, options
return nil
}
var (
editor = util_editor.NewDefaultEditor(commandutils.EditorEnvs)
)
editor := util_editor.NewDefaultEditor(commandutils.EditorEnvs)
ext := "yaml"
raw, err := kopscodecs.ToVersionedYaml(oldCluster)

View File

@ -167,9 +167,7 @@ func RunEditInstanceGroup(ctx context.Context, f *util.Factory, out io.Writer, o
return nil
}
var (
editor = editor.NewDefaultEditor(commandutils.EditorEnvs)
)
editor := editor.NewDefaultEditor(commandutils.EditorEnvs)
ext := "yaml"
raw, err := kopscodecs.ToVersionedYaml(oldGroup)

View File

@ -24,12 +24,9 @@ import (
"k8s.io/kubectl/pkg/util/i18n"
)
var (
exportShort = i18n.T(`Export configuration.`)
)
var exportShort = i18n.T(`Export configuration.`)
func NewCmdExport(f *util.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "export",
Short: exportShort,

View File

@ -20,7 +20,6 @@ import (
"context"
"fmt"
"io"
"os"
"github.com/spf13/cobra"
@ -100,7 +99,6 @@ func NewCmdGet(f *util.Factory, out io.Writer) *cobra.Command {
}
func RunGet(ctx context.Context, f commandutils.Factory, out io.Writer, options *GetOptions) error {
client, err := f.Clientset()
if err != nil {
return err

View File

@ -123,7 +123,6 @@ func RunGetInstances(ctx context.Context, f *util.Factory, out io.Writer, option
var cloudInstances []*cloudinstances.CloudInstance
cloudGroups, err := cloud.GetCloudGroups(cluster, instanceGroups, false, nodeList.Items)
if err != nil {
return err
}
@ -211,7 +210,6 @@ func createK8sClient(cluster *kops.Cluster) (*kubernetes.Clientset, error) {
return nil, fmt.Errorf("cannot build kubernetes api client for %q: %v", contextName, err)
}
return k8sClient, nil
}
func asRenderable(instances []*cloudinstances.CloudInstance) []*renderableCloudInstance {

View File

@ -166,9 +166,11 @@ func (i *integrationTest) withAddons(addons ...string) *integrationTest {
return i
}
const dnsControllerAddon = "dns-controller.addons.k8s.io-k8s-1.12"
const awsCCMAddon = "aws-cloud-controller.addons.k8s.io-k8s-1.18"
const awsEBSCSIAddon = "aws-ebs-csi-driver.addons.k8s.io-k8s-1.17"
const (
dnsControllerAddon = "dns-controller.addons.k8s.io-k8s-1.12"
awsCCMAddon = "aws-cloud-controller.addons.k8s.io-k8s-1.18"
awsEBSCSIAddon = "aws-ebs-csi-driver.addons.k8s.io-k8s-1.17"
)
// TestMinimal runs the test on a minimum configuration, similar to kops create cluster minimal.example.com --zones us-west-1a
func TestMinimal(t *testing.T) {
@ -479,16 +481,13 @@ func TestDiscoveryFeatureGate(t *testing.T) {
withOIDCDiscovery().
withKubeDNS().
runTestTerraformAWS(t)
}
func TestVFSServiceAccountIssuerDiscovery(t *testing.T) {
newIntegrationTest("minimal.example.com", "vfs-said").
withAddons(dnsControllerAddon).
withOIDCDiscovery().
runTestTerraformAWS(t)
}
// TestAWSLBController runs a simple configuration, but with AWS LB controller and UseServiceAccountExternalPermissions enabled
@ -814,8 +813,7 @@ func (i *integrationTest) runTest(t *testing.T, h *testutils.IntegrationTestHarn
expectedDataPath := path.Join(i.srcDir, "data")
{
for _, dataFileName := range expectedDataFilenames {
actualDataContent, err :=
os.ReadFile(path.Join(actualDataPath, dataFileName))
actualDataContent, err := os.ReadFile(path.Join(actualDataPath, dataFileName))
if err != nil {
t.Fatalf("failed to read actual data file: %v", err)
}
@ -1312,7 +1310,7 @@ func MakeSSHKeyPair(publicKeyPath string, privateKeyPath string) error {
if err := pem.Encode(&privateKeyBytes, privateKeyPEM); err != nil {
return err
}
if err := os.WriteFile(privateKeyPath, privateKeyBytes.Bytes(), os.FileMode(0700)); err != nil {
if err := os.WriteFile(privateKeyPath, privateKeyBytes.Bytes(), os.FileMode(0o700)); err != nil {
return err
}
@ -1321,7 +1319,7 @@ func MakeSSHKeyPair(publicKeyPath string, privateKeyPath string) error {
return err
}
publicKeyBytes := ssh.MarshalAuthorizedKey(publicKey)
if err := os.WriteFile(publicKeyPath, publicKeyBytes, os.FileMode(0744)); err != nil {
if err := os.WriteFile(publicKeyPath, publicKeyBytes, os.FileMode(0o744)); err != nil {
return err
}

View File

@ -24,9 +24,7 @@ import (
"k8s.io/kubectl/pkg/util/i18n"
)
var (
promoteShort = i18n.T(`Promote a resource.`)
)
var promoteShort = i18n.T(`Promote a resource.`)
func NewCmdPromote(f *util.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{

View File

@ -157,7 +157,6 @@ func (o *RollingUpdateOptions) InitDefaults() {
}
func NewCmdRollingUpdateCluster(f *util.Factory, out io.Writer) *cobra.Command {
var options RollingUpdateOptions
options.InitDefaults()
@ -213,7 +212,6 @@ func NewCmdRollingUpdateCluster(f *util.Factory, out io.Writer) *cobra.Command {
}
func RunRollingUpdateCluster(ctx context.Context, f *util.Factory, out io.Writer, options *RollingUpdateOptions) error {
clientset, err := f.Clientset()
if err != nil {
return err

View File

@ -109,10 +109,9 @@ func init() {
}
func NewCmdRoot(f *util.Factory, out io.Writer) *cobra.Command {
cmd := rootCommand.cobraCommand
//cmd.PersistentFlags().AddGoFlagSet(goflag.CommandLine)
// cmd.PersistentFlags().AddGoFlagSet(goflag.CommandLine)
goflag.CommandLine.VisitAll(func(goflag *goflag.Flag) {
switch goflag.Name {
case "cloud-provider-gce-lb-src-cidrs":
@ -330,7 +329,6 @@ func GetClusterNameForCompletionNoKubeconfig(clusterArgs []string) (clusterName
}
return "", []string{"--name"}, cobra.ShellCompDirectiveNoFileComp
}
func GetClusterForCompletion(ctx context.Context, factory commandutils.Factory, clusterArgs []string) (cluster *kopsapi.Cluster, clientSet simple.Clientset, completions []string, directive cobra.ShellCompDirective) {

View File

@ -24,9 +24,7 @@ import (
"k8s.io/kubectl/pkg/util/i18n"
)
var (
toolboxShort = i18n.T(`Miscellaneous, infrequently used commands.`)
)
var toolboxShort = i18n.T(`Miscellaneous, infrequently used commands.`)
func NewCmdToolbox(f *util.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{

View File

@ -102,7 +102,6 @@ func NewCmdToolboxDump(f *util.Factory, out io.Writer) *cobra.Command {
}
func RunToolboxDump(ctx context.Context, f *util.Factory, out io.Writer, options *ToolboxDumpOptions) error {
clientset, err := f.Clientset()
if err != nil {
return err

View File

@ -234,7 +234,6 @@ func NewCmdToolboxInstanceSelector(f *util.Factory, out io.Writer) *cobra.Comman
// RunToolboxInstanceSelector executes the instance-selector tool to create instance groups with declarative resource specifications
func RunToolboxInstanceSelector(ctx context.Context, f *util.Factory, out io.Writer, commandline *cli.CommandLineInterface, options *InstanceSelectorOptions) error {
clientset, cluster, channel, err := retrieveClusterRefs(ctx, f, options.ClusterName)
if err != nil {
return err

View File

@ -223,7 +223,7 @@ func RunToolBoxTemplate(f *util.Factory, out io.Writer, options *ToolboxTemplate
iowriter := out
// @check if we are writing to a file rather than stdout
if options.outputPath != "" {
w, err := os.OpenFile(utils.ExpandPath(options.outputPath), os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0660)
w, err := os.OpenFile(utils.ExpandPath(options.outputPath), os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0o660)
if err != nil {
return fmt.Errorf("unable to open file: %s, error: %v", options.outputPath, err)
}

View File

@ -24,9 +24,7 @@ import (
"k8s.io/kubectl/pkg/util/i18n"
)
var (
trustShort = i18n.T("Trust keypairs.")
)
var trustShort = i18n.T("Trust keypairs.")
func NewCmdTrust(f *util.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{

View File

@ -24,9 +24,7 @@ import (
"k8s.io/kubectl/pkg/util/i18n"
)
var (
updateShort = i18n.T("Update a cluster.")
)
var updateShort = i18n.T("Update a cluster.")
func NewCmdUpdate(f *util.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{

View File

@ -470,7 +470,6 @@ func hasKubecfg(contextName string) (bool, error) {
func completeUpdateClusterTarget(f commandutils.Factory, options *UpdateClusterOptions) func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
commandutils.ConfigureKlogForCompletion()
ctx := context.TODO()

View File

@ -19,14 +19,13 @@ package dns
import (
"context"
"fmt"
"time"
"k8s.io/klog/v2"
"sort"
"strings"
"sync"
"sync/atomic"
"time"
"k8s.io/klog/v2"
"k8s.io/kops/dns-controller/pkg/util"
"k8s.io/kops/dnsprovider/pkg/dnsprovider"
@ -35,8 +34,10 @@ import (
var zoneListCacheValidity = time.Minute * 15
const DefaultTTL = time.Minute
const MaxFailures = 5
const (
DefaultTTL = time.Minute
MaxFailures = 5
)
// DNSController applies the desired DNS state to the DNS backend
type DNSController struct {

View File

@ -29,7 +29,6 @@ import (
)
func TestPodController(t *testing.T) {
ctx := context.Background()
pspec := &corev1.Pod{
ObjectMeta: metav1.ObjectMeta{

View File

@ -55,32 +55,38 @@ var testData = []struct {
{
[2]record{
{"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"}, // Identical
{"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"}}, true,
{"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"},
}, true,
},
{
[2]record{
{"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"}, // Identical except Name
{"bar", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"}}, false,
{"bar", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"},
}, false,
},
{
[2]record{
{"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"}, // Identical except Rrdata
{"foo", []string{"1.2.3.4", "5,6,7,9"}, 180, "A"}}, false,
{"foo", []string{"1.2.3.4", "5,6,7,9"}, 180, "A"},
}, false,
},
{
[2]record{
{"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"}, // Identical except Rrdata ordering reversed
{"foo", []string{"5,6,7,8", "1.2.3.4"}, 180, "A"}}, false,
{"foo", []string{"5,6,7,8", "1.2.3.4"}, 180, "A"},
}, false,
},
{
[2]record{
{"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"}, // Identical except TTL
{"foo", []string{"1.2.3.4", "5,6,7,8"}, 150, "A"}}, false,
{"foo", []string{"1.2.3.4", "5,6,7,8"}, 150, "A"},
}, false,
},
{
[2]record{
{"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"}, // Identical except Type
{"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "CNAME"}}, false,
{"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "CNAME"},
}, false,
},
}

View File

@ -66,6 +66,7 @@ func (zones Zones) Remove(zone dnsprovider.Zone) error {
}
return nil
}
func (zones Zones) New(name string) (dnsprovider.Zone, error) {
id := string(uuid.NewUUID())
managedZone := route53.HostedZone{Id: &id, Name: &name}

View File

@ -149,7 +149,6 @@ func (z *zones) New(name string) (dnsprovider.Zone, error) {
name: name,
client: z.client,
}, nil
}
// zone implements dnsprovider.Zone
@ -203,7 +202,6 @@ func (r *resourceRecordSets) List() ([]dnsprovider.ResourceRecordSet, error) {
}
return rrsets, nil
}
// Get returns a list of dnsprovider.ResourceRecordSet that matches the name parameter

View File

@ -34,5 +34,4 @@ func (response *ResourceRecordSetsListResponse) Rrsets() []interfaces.ResourceRe
rrsets[i] = &ResourceRecordSet{rrset}
}
return rrsets
}

View File

@ -25,7 +25,6 @@ import (
// TestContract verifies the general ResourceRecordChangeset contract
func TestContract(t *testing.T, rrsets dnsprovider.ResourceRecordSets) {
{
changeset := rrsets.StartChangeset()
if !changeset.IsEmpty() {
@ -64,5 +63,4 @@ func TestContract(t *testing.T, rrsets dnsprovider.ResourceRecordSets) {
t.Fatalf("expected changeset not to be empty after upsert")
}
}
}

View File

@ -40,9 +40,11 @@ var masterZones []string
var sshPublicKey = "~/.ssh/id_rsa.pub"
var flagRegistryBase = flag.String("registry", os.Getenv("KOPS_STATE_STORE"), "VFS path where files are kept")
var flagClusterName = flag.String("name", "", "Name of cluster to create")
var flagZones = flag.String("zones", "", "Comma separated list of zones to create")
var (
flagRegistryBase = flag.String("registry", os.Getenv("KOPS_STATE_STORE"), "VFS path where files are kept")
flagClusterName = flag.String("name", "", "Name of cluster to create")
flagZones = flag.String("zones", "", "Comma separated list of zones to create")
)
func main() {
flag.Parse()

29
hack/update-gofumpt.sh Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Copyright 2021 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -o errexit
set -o nounset
set -o pipefail
. "$(dirname "${BASH_SOURCE[0]}")/common.sh"
if ! command -v gofumpt &> /dev/null; then
cd "${KOPS_ROOT}/hack" || exit 1
go install mvdan.cc/gofumpt@v0.2.0
fi
cd "${KOPS_ROOT}" || exit 1
git ls-files "*.go" | grep -v vendor | xargs -L 1 gofumpt -w -l

35
hack/verify-gofumpt.sh Executable file
View File

@ -0,0 +1,35 @@
#!/usr/bin/env bash
# Copyright 2021 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -o errexit
set -o nounset
set -o pipefail
. "$(dirname "${BASH_SOURCE[0]}")/common.sh"
if ! command -v gofumpt &> /dev/null; then
cd "${KOPS_ROOT}/hack" || exit 1
go install mvdan.cc/gofumpt@v0.2.0
fi
cd "${KOPS_ROOT}" || exit 1
bad_files=$(git ls-files "*.go" | grep -v vendor | xargs gofumpt -l)
if [[ -n "${bad_files}" ]]; then
echo "FAIL: 'make gofmt' needs to be run on the following files: "
echo "${bad_files}"
echo "FAIL: please execute make gofmt"
exit 1
fi

View File

@ -97,7 +97,7 @@ func (i *Installation) Build(c *fi.ModelBuilderContext) {
}
func (i *Installation) buildEnvFile() *nodetasks.File {
var envVars = make(map[string]string)
envVars := make(map[string]string)
if os.Getenv("AWS_REGION") != "" {
envVars["AWS_REGION"] = os.Getenv("AWS_REGION")
@ -149,7 +149,7 @@ func (i *Installation) buildEnvFile() *nodetasks.File {
envVars["AZURE_STORAGE_ACCOUNT"] = os.Getenv("AZURE_STORAGE_ACCOUNT")
}
var sysconfig = ""
sysconfig := ""
for key, value := range envVars {
sysconfig += key + "=" + value + "\n"
}

View File

@ -123,7 +123,7 @@ func (b *CloudConfigBuilder) build(c *fi.ModelBuilderContext, inTree bool) error
if osc == nil {
break
}
//Support mapping of older keystone API
// Support mapping of older keystone API
tenantName := os.Getenv("OS_TENANT_NAME")
if tenantName == "" {
tenantName = os.Getenv("OS_PROJECT_NAME")
@ -147,7 +147,6 @@ func (b *CloudConfigBuilder) build(c *fi.ModelBuilderContext, inTree bool) error
fmt.Sprintf("application-credential-id=\"%s\"", os.Getenv("OS_APPLICATION_CREDENTIAL_ID")),
fmt.Sprintf("application-credential-secret=\"%s\"", os.Getenv("OS_APPLICATION_CREDENTIAL_SECRET")),
)
}
lines = append(lines,
@ -184,7 +183,7 @@ func (b *CloudConfigBuilder) build(c *fi.ModelBuilderContext, inTree bool) error
}
if bs := osc.BlockStorage; bs != nil {
//Block Storage Config
// Block Storage Config
lines = append(lines,
"[BlockStorage]",
fmt.Sprintf("bs-version=%s", fi.StringValue(bs.Version)),

View File

@ -406,7 +406,6 @@ iptables -w -t nat -A IP-MASQ -m comment --comment "ip-masq: outbound traffic is
// buildCNIConfigTemplateFile is responsible for creating a special template for setups using Kubenet
func (b *ContainerdBuilder) buildCNIConfigTemplateFile(c *fi.ModelBuilderContext) {
// Based on https://github.com/kubernetes/kubernetes/blob/15a8a8ec4a3275a33b7f8eb3d4d98db2abad55b7/cluster/gce/gci/configure-helper.sh#L2911-L2937
contents := `{
@ -475,7 +474,6 @@ func (b *ContainerdBuilder) buildContainerdConfig() (string, error) {
}
func appendNvidiaGPURuntimeConfig(config *toml.Tree) error {
gpuConfig, err := toml.TreeFromMap(
map[string]interface{}{
"privileged_without_host_devices": false,

View File

@ -211,7 +211,6 @@ func TestContainerdConfig(t *testing.T) {
if config == "" {
t.Errorf("got unexpected empty containerd config")
}
}
func TestAppendGPURuntimeContainerdConfig(t *testing.T) {
@ -271,5 +270,4 @@ func TestAppendGPURuntimeContainerdConfig(t *testing.T) {
fmt.Println(diff.FormatDiff(expectedNewConfig, newConfig))
t.Error("new config did not match expected new config")
}
}

View File

@ -134,7 +134,7 @@ func (c *NodeupModelContext) EnsureDirectory(path string) error {
st, err := os.Stat(path)
if err != nil {
if os.IsNotExist(err) {
return os.MkdirAll(path, 0755)
return os.MkdirAll(path, 0o755)
}
return err

View File

@ -667,7 +667,7 @@ func (b *KubeAPIServerBuilder) buildPod(kubeAPIServer *kops.KubeAPIServerConfig)
container.Command = []string{"/usr/local/bin/kube-apiserver"}
container.Args = append(
sortedStrings(flags),
"--logtostderr=false", //https://github.com/kubernetes/klog/issues/60
"--logtostderr=false", // https://github.com/kubernetes/klog/issues/60
"--alsologtostderr",
"--log-file=/var/log/kube-apiserver.log")
}

View File

@ -120,7 +120,6 @@ func Test_KubeAPIServer_BuildFlags(t *testing.T) {
},
{
kops.KubeAPIServerConfig{
AuditDynamicConfiguration: &[]bool{true}[0],
},
"--audit-dynamic-configuration=true --insecure-port=0 --secure-port=0",

View File

@ -165,7 +165,8 @@ func (b *KubeControllerManagerBuilder) buildPod(kcm *kops.KubeControllerManagerC
// Configure CA certificate to be used to sign keys
flags = append(flags, []string{
"--cluster-signing-cert-file=" + filepath.Join(pathSrvKCM, "ca.crt"),
"--cluster-signing-key-file=" + filepath.Join(pathSrvKCM, "ca.key")}...)
"--cluster-signing-key-file=" + filepath.Join(pathSrvKCM, "ca.key"),
}...)
pod := &v1.Pod{
TypeMeta: metav1.TypeMeta{
@ -248,7 +249,7 @@ func (b *KubeControllerManagerBuilder) buildPod(kcm *kops.KubeControllerManagerC
container.Command = []string{"/usr/local/bin/kube-controller-manager"}
container.Args = append(
sortedStrings(flags),
"--logtostderr=false", //https://github.com/kubernetes/klog/issues/60
"--logtostderr=false", // https://github.com/kubernetes/klog/issues/60
"--alsologtostderr",
"--log-file=/var/log/kube-controller-manager.log")
}

View File

@ -43,7 +43,6 @@ var _ fi.ModelBuilder = &KubeProxyBuilder{}
// Build is responsible for building the kube-proxy manifest
// @TODO we should probably change this to a daemonset in the future and follow the kubeadm path
func (b *KubeProxyBuilder) Build(c *fi.ModelBuilderContext) error {
if b.Cluster.Spec.KubeProxy.Enabled != nil && !*b.Cluster.Spec.KubeProxy.Enabled {
klog.V(2).Infof("Kube-proxy is disabled, will not create configuration for it.")
return nil
@ -158,7 +157,8 @@ func (b *KubeProxyBuilder) buildPod() (*v1.Pod, error) {
flags = append(flags, []string{
"--kubeconfig=/var/lib/kube-proxy/kubeconfig",
"--oom-score-adj=-998"}...)
"--oom-score-adj=-998",
}...)
image := kubeProxyImage(b.NodeupModelContext)
container := &v1.Container{
@ -203,7 +203,7 @@ func (b *KubeProxyBuilder) buildPod() (*v1.Pod, error) {
container.Command = []string{"/usr/local/bin/kube-proxy"}
container.Args = append(
sortedStrings(flags),
"--logtostderr=false", //https://github.com/kubernetes/klog/issues/60
"--logtostderr=false", // https://github.com/kubernetes/klog/issues/60
"--alsologtostderr",
"--log-file=/var/log/kube-proxy.log")
}
@ -238,7 +238,7 @@ func (b *KubeProxyBuilder) buildPod() (*v1.Pod, error) {
pod.Spec.Containers = append(pod.Spec.Containers, *container)
// Note that e.g. kubeadm has this as a daemonset, but this doesn't have a lot of test coverage AFAICT
//ServiceAccountName: "kube-proxy",
// ServiceAccountName: "kube-proxy",
//d := &v1beta1.DaemonSet{
// ObjectMeta: metav1.ObjectMeta{

View File

@ -37,7 +37,7 @@ func TestKubeProxyBuilder_buildPod(t *testing.T) {
// https://pkg.go.dev/k8s.io/kops/pkg/apis/kops#ClusterSpec
// https://pkg.go.dev/k8s.io/kops/pkg/apis/kops#KubeProxyConfig
var cluster = &kops.Cluster{}
cluster := &kops.Cluster{}
cluster.Spec.MasterInternalName = "dev-cluster"
cluster.Spec.KubeProxy = &kops.KubeProxyConfig{}
@ -50,7 +50,8 @@ func TestKubeProxyBuilder_buildPod(t *testing.T) {
flags = append(flags, []string{
"--kubeconfig=/var/lib/kube-proxy/kubeconfig",
"--oom-score-adj=-998",
`--resource-container=""`}...)
`--resource-container=""`,
}...)
type fields struct {
NodeupModelContext *NodeupModelContext
@ -133,7 +134,6 @@ func TestKubeProxyBuilder_buildPod(t *testing.T) {
// compare pod spec container name
if !reflect.DeepEqual(got.Spec.Containers[0].Name, tt.want.Spec.Containers[0].Name) {
t.Errorf("KubeProxyBuilder.buildPod() Container Name = %v, want %v", got.Spec.Containers[0].Name, tt.want.Spec.Containers[0].Name)
}
// compare pod spec container Image
if !reflect.DeepEqual(got.Spec.Containers[0].Image, tt.want.Spec.Containers[0].Image) {
@ -144,7 +144,6 @@ func TestKubeProxyBuilder_buildPod(t *testing.T) {
if !reflect.DeepEqual(got.Spec.Containers[0].Resources, tt.want.Spec.Containers[0].Resources) {
t.Errorf("KubeProxyBuilder.buildPod() Resources = %v, want %v", got.Spec.Containers[0].Resources, tt.want.Spec.Containers[0].Resources)
}
})
}
}

View File

@ -263,7 +263,7 @@ func (b *KubeSchedulerBuilder) buildPod(kubeScheduler *kops.KubeSchedulerConfig)
container.Command = []string{"/usr/local/bin/kube-scheduler"}
container.Args = append(
sortedStrings(flags),
"--logtostderr=false", //https://github.com/kubernetes/klog/issues/60
"--logtostderr=false", // https://github.com/kubernetes/klog/issues/60
"--alsologtostderr",
"--log-file=/var/log/kube-scheduler.log")
}

View File

@ -59,7 +59,6 @@ var _ fi.ModelBuilder = &KubeletBuilder{}
// Build is responsible for building the kubelet configuration
func (b *KubeletBuilder) Build(c *fi.ModelBuilderContext) error {
err := b.buildKubeletServingCertificate(c)
if err != nil {
return fmt.Errorf("error building kubelet server cert: %v", err)
@ -304,7 +303,6 @@ func (b *KubeletBuilder) buildSystemdService() *nodetasks.Service {
service.InitDefaults()
if b.ConfigurationMode == "Warming" {
service.Running = fi.Bool(false)
}
@ -551,7 +549,6 @@ func (b *KubeletBuilder) buildMasterKubeletKubeconfig(c *fi.ModelBuilderContext)
}
func (b *KubeletBuilder) buildKubeletServingCertificate(c *fi.ModelBuilderContext) error {
if b.UseKopsControllerForNodeBootstrap() {
name := "kubelet-server"
dir := b.PathSrvKubernetes()
@ -599,7 +596,6 @@ func (b *KubeletBuilder) buildKubeletServingCertificate(c *fi.ModelBuilderContex
}
}
return nil
}
func (b *KubeletBuilder) kubeletNames() ([]string, error) {

View File

@ -35,12 +35,12 @@ import (
)
func Test_InstanceGroupKubeletMerge(t *testing.T) {
var cluster = &kops.Cluster{}
cluster := &kops.Cluster{}
cluster.Spec.Kubelet = &kops.KubeletConfigSpec{}
cluster.Spec.Kubelet.NvidiaGPUs = 0
cluster.Spec.KubernetesVersion = "1.6.0"
var instanceGroup = &kops.InstanceGroup{}
instanceGroup := &kops.InstanceGroup{}
instanceGroup.Spec.Kubelet = &kops.KubeletConfigSpec{}
instanceGroup.Spec.Kubelet.NvidiaGPUs = 1
instanceGroup.Spec.Role = kops.InstanceGroupRoleNode
@ -57,7 +57,7 @@ func Test_InstanceGroupKubeletMerge(t *testing.T) {
t.Error(err)
}
var mergedKubeletSpec, err = b.buildKubeletConfigSpec()
mergedKubeletSpec, err := b.buildKubeletConfigSpec()
if err != nil {
t.Error(err)
}
@ -175,7 +175,6 @@ func Test_RunKubeletBuilder(t *testing.T) {
runKubeletBuilder(t, context, nodeUpModelContext)
testutils.ValidateTasks(t, filepath.Join(basedir, "tasks.yaml"), context)
}
func Test_RunKubeletBuilderWarmPool(t *testing.T) {
@ -207,7 +206,6 @@ func Test_RunKubeletBuilderWarmPool(t *testing.T) {
runKubeletBuilder(t, context, nodeUpModelContext)
testutils.ValidateTasks(t, filepath.Join(basedir, "tasks.yaml"), context)
}
func runKubeletBuilder(t *testing.T, context *fi.ModelBuilderContext, nodeupModelContext *NodeupModelContext) {
@ -247,7 +245,6 @@ func runKubeletBuilder(t *testing.T, context *fi.ModelBuilderContext, nodeupMode
}
context.AddTask(task)
}
}
func BuildNodeupModelContext(model *testutils.Model) (*NodeupModelContext, error) {
@ -323,12 +320,14 @@ func mockedPopulateClusterSpec(c *kops.Cluster, cloud fi.Cloud) (*kops.Cluster,
// Fixed cert and key, borrowed from the create_kubecfg_test.go test
// Wouldn't actually work in a real environment, but good enough for (today's) tests
const dummyCertificate = "-----BEGIN CERTIFICATE-----\nMIIC2DCCAcCgAwIBAgIRALJXAkVj964tq67wMSI8oJQwDQYJKoZIhvcNAQELBQAw\nFTETMBEGA1UEAxMKa3ViZXJuZXRlczAeFw0xNzEyMjcyMzUyNDBaFw0yNzEyMjcy\nMzUyNDBaMBUxEzARBgNVBAMTCmt1YmVybmV0ZXMwggEiMA0GCSqGSIb3DQEBAQUA\nA4IBDwAwggEKAoIBAQDgnCkSmtnmfxEgS3qNPaUCH5QOBGDH/inHbWCODLBCK9gd\nXEcBl7FVv8T2kFr1DYb0HVDtMI7tixRVFDLgkwNlW34xwWdZXB7GeoFgU1xWOQSY\nOACC8JgYTQ/139HBEvgq4sej67p+/s/SNcw34Kk7HIuFhlk1rRk5kMexKIl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fnocfzAXhXBULt1nENcogNf1fcptAVtu\nBAiz4/HipQKqoWVUYmxfgbbLRKKLK0s0lOWKbYdVjhEm/m2ZU8wtXTagNwkIGoyq\nY/C1Lox4f1ROJnCjc/hfcOjcxX5M8A8peecHWlVtUPKTJgxQ7oMKcw==\n-----END RSA PRIVATE KEY-----\n"
const previousCertificate = "-----BEGIN CERTIFICATE-----\nMIIBZzCCARGgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDEw9zZXJ2\naWNlLWFjY291bnQwHhcNMjEwNTAyMjAzMDA2WhcNMzEwNTAyMjAzMDA2WjAaMRgw\nFgYDVQQDEw9zZXJ2aWNlLWFjY291bnQwXDANBgkqhkiG9w0BAQEFAANLADBIAkEA\n2JbeF8dNwqfEKKD65aGlVs58fWkA0qZdVLKw8qATzRBJTi1nqbj2kAR4gyy/C8Mx\nouxva/om9d7Sq8Ka55T7+wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0T\nAQH/BAUwAwEB/zAdBgNVHQ4EFgQUI5beFHueAGyT1pQ6UTOdbMfj3gQwDQYJKoZI\nhvcNAQELBQADQQBwPLO+Np8o6k3aNBGKE4JTCOs06X72OXNivkWWWP/9XGz6x4DI\nHPU65kbUn/pWXBUVVlpsKsdmWA2Bu8pd/vD+\n-----END CERTIFICATE-----\n"
const previousKey = "-----BEGIN RSA PRIVATE KEY-----\nMIIBPQIBAAJBANiW3hfHTcKnxCig+uWhpVbOfH1pANKmXVSysPKgE80QSU4tZ6m4\n9pAEeIMsvwvDMaLsb2v6JvXe0qvCmueU+/sCAwEAAQJBAKt/gmpHqP3qA3u8RA5R\n2W6L360Z2Mnza1FmkI/9StCCkJGjuE5yDhxU4JcVnFyX/nMxm2ockEEQDqRSu7Oo\nxTECIQD2QsUsgFL4FnXWzTclySJ6ajE4Cte3gSDOIvyMNMireQIhAOEnsV8UaSI+\nZyL7NMLzMPLCgtsrPnlamr8gdrEHf9ITAiEAxCCLbpTI/4LL2QZZrINTLVGT34Fr\nKl/yI5pjrrp/M2kCIQDfOktQyRuzJ8t5kzWsUxCkntS+FxHJn1rtQ3Jp8dV4oQIh\nAOyiVWDyLZJvg7Y24Ycmp86BZjM9Wk/BfWpBXKnl9iDY\n-----END RSA PRIVATE KEY-----"
const nextCertificate = "-----BEGIN CERTIFICATE-----\nMIIBZzCCARGgAwIBAgIBBDANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDEw9zZXJ2\naWNlLWFjY291bnQwHhcNMjEwNTAyMjAzMjE3WhcNMzEwNTAyMjAzMjE3WjAaMRgw\nFgYDVQQDEw9zZXJ2aWNlLWFjY291bnQwXDANBgkqhkiG9w0BAQEFAANLADBIAkEA\no4Tridlsf4Yz3UAiup/scSTiG/OqxkUW3Fz7zGKvVcLeYj9GEIKuzoB1VFk1nboD\nq4cCuGLfdzaQdCQKPIsDuwIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0T\nAQH/BAUwAwEB/zAdBgNVHQ4EFgQUhPbxEmUbwVOCa+fZgxreFhf67UEwDQYJKoZI\nhvcNAQELBQADQQALMsyK2Q7C/bk27eCvXyZKUfrLvor10hEjwGhv14zsKWDeTj/J\nA1LPYp7U9VtFfgFOkVbkLE9Rstc0ltNrPqxA\n-----END CERTIFICATE-----\n"
const nextKey = "-----BEGIN RSA PRIVATE KEY-----\nMIIBOgIBAAJBAKOE64nZbH+GM91AIrqf7HEk4hvzqsZFFtxc+8xir1XC3mI/RhCC\nrs6AdVRZNZ26A6uHArhi33c2kHQkCjyLA7sCAwEAAQJAejInjmEzqmzQr0NxcIN4\nPukwK3FBKl+RAOZfqNIKcww14mfOn7Gc6lF2zEC4GnLiB3tthbSXoBGi54nkW4ki\nyQIhANZNne9UhQlwyjsd3WxDWWrl6OOZ3J8ppMOIQni9WRLlAiEAw1XEdxPOSOSO\nB6rucpTT1QivVvyEFIb/ukvPm769Mh8CIQDNQwKnHdlfNX0+KljPPaMD1LrAZbr/\naC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AwEB/zAdBgNVHQ4EFgQUhPbxEmUbwVOCa+fZgxreFhf67UEwDQYJKoZI\nhvcNAQELBQADQQALMsyK2Q7C/bk27eCvXyZKUfrLvor10hEjwGhv14zsKWDeTj/J\nA1LPYp7U9VtFfgFOkVbkLE9Rstc0ltNrPqxA\n-----END CERTIFICATE-----\n"
nextKey = "-----BEGIN RSA PRIVATE KEY-----\nMIIBOgIBAAJBAKOE64nZbH+GM91AIrqf7HEk4hvzqsZFFtxc+8xir1XC3mI/RhCC\nrs6AdVRZNZ26A6uHArhi33c2kHQkCjyLA7sCAwEAAQJAejInjmEzqmzQr0NxcIN4\nPukwK3FBKl+RAOZfqNIKcww14mfOn7Gc6lF2zEC4GnLiB3tthbSXoBGi54nkW4ki\nyQIhANZNne9UhQlwyjsd3WxDWWrl6OOZ3J8ppMOIQni9WRLlAiEAw1XEdxPOSOSO\nB6rucpTT1QivVvyEFIb/ukvPm769Mh8CIQDNQwKnHdlfNX0+KljPPaMD1LrAZbr/\naC+8aWLhqtsKUQIgF7gUcTkwdV17eabh6Xv09Qtm7zMefred2etWvFy+8JUCIECv\nFYOKQVWHX+Q7CHX2K1oTECVnZuW1UItdDYVlFYxQ\n-----END RSA PRIVATE KEY-----"
)
func simplePrivateKeyset(cert, key string) *kops.Keyset {
return &kops.Keyset{

View File

@ -37,7 +37,6 @@ var _ fi.ModelBuilder = &LogrotateBuilder{}
// Build is responsible for configuring logrotate
func (b *LogrotateBuilder) Build(c *fi.ModelBuilderContext) error {
switch b.Distribution {
case distributions.DistributionContainerOS:
klog.Infof("Detected ContainerOS; won't install logrotate")

View File

@ -207,7 +207,7 @@ func (t *ProtokubeBuilder) ProtokubeFlags(k8sVersion semver.Version) (*Protokube
} else {
klog.Warningf("DNSZone not specified; protokube won't be able to update DNS")
// @TODO: Should we permit wildcard updates if zone is not specified?
//argv = append(argv, "--zone=*/*")
// argv = append(argv, "--zone=*/*")
}
if dns.IsGossipHostname(t.Cluster.Spec.MasterInternalName) {
@ -290,7 +290,7 @@ func (t *ProtokubeBuilder) ProtokubeFlags(k8sVersion semver.Version) (*Protokube
}
func (t *ProtokubeBuilder) buildEnvFile() (*nodetasks.File, error) {
var envVars = make(map[string]string)
envVars := make(map[string]string)
envVars["KUBECONFIG"] = "/var/lib/kops/kubeconfig"
@ -353,7 +353,7 @@ func (t *ProtokubeBuilder) buildEnvFile() (*nodetasks.File, error) {
envVars["PATH"] = fmt.Sprintf("/opt/kops/bin:%v", os.Getenv("PATH"))
}
var sysconfig = ""
sysconfig := ""
for key, value := range envVars {
sysconfig += key + "=" + value + "\n"
}

View File

@ -65,11 +65,9 @@ func (b *SecretBuilder) Build(c *fi.ModelBuilderContext) error {
}
func getInstanceAddress() (string, error) {
addrBytes, err := vfs.Context.ReadFile("metadata://openstack/local-ipv4")
if err != nil {
return "", nil
}
return string(addrBytes), nil
}

View File

@ -31,14 +31,15 @@ type UpdateServiceBuilder struct {
*NodeupModelContext
}
const flatcarServiceName = "update-service"
const debianPackageName = "unattended-upgrades"
const (
flatcarServiceName = "update-service"
debianPackageName = "unattended-upgrades"
)
var _ fi.ModelBuilder = &UpdateServiceBuilder{}
// Build is responsible for configuring automatic updates based on the OS.
func (b *UpdateServiceBuilder) Build(c *fi.ModelBuilderContext) error {
if b.Distribution == distributions.DistributionFlatcar {
b.buildFlatcarSystemdService(c)
} else if b.Distribution.IsDebianFamily() {
@ -107,5 +108,4 @@ APT::Periodic::AutocleanInterval "7";
Contents: fi.NewStringResource(contents),
Type: nodetasks.FileType_File,
})
}

View File

@ -34,5 +34,4 @@ func TestUpdateServiceBuilderExternal(t *testing.T) {
builder := UpdateServiceBuilder{NodeupModelContext: nodeupModelContext}
return builder.Build(target)
})
}

View File

@ -29,8 +29,7 @@ import (
)
// gcsAclStrategy is the AclStrategy for objects written to google cloud storage
type gcsAclStrategy struct {
}
type gcsAclStrategy struct{}
var _ acls.ACLStrategy = &gcsAclStrategy{}

View File

@ -24,8 +24,10 @@ import (
"k8s.io/kops/util/pkg/vfs"
)
var strategies map[string]ACLStrategy
var strategiesMutex sync.Mutex
var (
strategies map[string]ACLStrategy
strategiesMutex sync.Mutex
)
// GetACL returns the ACL for the vfs.Path, by consulting all registered strategies
func GetACL(p vfs.Path, cluster *kops.Cluster) (vfs.ACL, error) {

View File

@ -19,7 +19,6 @@ package s3
import (
"fmt"
"net/url"
"strings"
"k8s.io/klog/v2"
@ -31,8 +30,7 @@ import (
// s3PublicAclStrategy is the AclStrategy for objects that are written with public read only ACL.
// This strategy is used by custom file assets.
type s3PublicAclStrategy struct {
}
type s3PublicAclStrategy struct{}
var _ acls.ACLStrategy = &s3PublicAclStrategy{}

View File

@ -42,7 +42,6 @@ func Test_Strategy(t *testing.T) {
s := &s3PublicAclStrategy{}
acl, err := s.GetACL(path, cluster)
if err != nil {
t.Errorf("error getting ACL: %v", err)
}
@ -70,7 +69,6 @@ func Test_In_StateStore(t *testing.T) {
s := &s3PublicAclStrategy{}
acl, err := s.GetACL(stateStore, cluster)
if err != nil {
t.Errorf("error getting ACL: %v", err)
}

View File

@ -352,8 +352,7 @@ func (s *AuthenticationSpec) IsEmpty() bool {
return s.Kopeio == nil && s.AWS == nil
}
type KopeioAuthenticationSpec struct {
}
type KopeioAuthenticationSpec struct{}
type AWSAuthenticationSpec struct {
// Image is the AWS IAM Authenticator docker image to use
@ -392,11 +391,9 @@ func (s *AuthorizationSpec) IsEmpty() bool {
return s.RBAC == nil && s.AlwaysAllow == nil
}
type RBACAuthorizationSpec struct {
}
type RBACAuthorizationSpec struct{}
type AlwaysAllowAuthorizationSpec struct {
}
type AlwaysAllowAuthorizationSpec struct{}
// AccessSpec provides configuration details related to kubeapi dns and ELB access
type AccessSpec struct {
@ -406,8 +403,7 @@ type AccessSpec struct {
LoadBalancer *LoadBalancerAccessSpec `json:"loadBalancer,omitempty"`
}
type DNSAccessSpec struct {
}
type DNSAccessSpec struct{}
// LoadBalancerType string describes LoadBalancer types (public, internal)
type LoadBalancerType string

View File

@ -200,9 +200,9 @@ type KubeletConfigSpec struct {
CpuManagerPolicy string `json:"cpuManagerPolicy,omitempty" flag:"cpu-manager-policy"`
// RegistryPullQPS if > 0, limit registry pull QPS to this value. If 0, unlimited. (default 5)
RegistryPullQPS *int32 `json:"registryPullQPS,omitempty" flag:"registry-qps"`
//RegistryBurst Maximum size of a bursty pulls, temporarily allows pulls to burst to this number, while still not exceeding registry-qps. Only used if --registry-qps > 0 (default 10)
// RegistryBurst Maximum size of a bursty pulls, temporarily allows pulls to burst to this number, while still not exceeding registry-qps. Only used if --registry-qps > 0 (default 10)
RegistryBurst *int32 `json:"registryBurst,omitempty" flag:"registry-burst"`
//TopologyManagerPolicy determines the allocation policy for the topology manager.
// TopologyManagerPolicy determines the allocation policy for the topology manager.
TopologyManagerPolicy string `json:"topologyManagerPolicy,omitempty" flag:"topology-manager-policy"`
// rotateCertificates enables client certificate rotation.
RotateCertificates *bool `json:"rotateCertificates,omitempty" flag:"rotate-certificates"`
@ -903,9 +903,9 @@ type GCPPDCSIDriver struct {
// SnapshotControllerConfig is the config for the CSI Snapshot Controller
type SnapshotControllerConfig struct {
//Enabled enables the CSI Snapshot Controller
// Enabled enables the CSI Snapshot Controller
Enabled *bool `json:"enabled,omitempty"`
//InstallDefaultClass will install the default VolumeSnapshotClass
// InstallDefaultClass will install the default VolumeSnapshotClass
InstallDefaultClass bool `json:"installDefaultClass,omitempty"`
}

Some files were not shown because too many files have changed in this diff Show More