mirror of https://github.com/kubernetes/kops.git
Merge pull request #7839 from tanjunchen/fix-up-static-check
fix-up staticcheck problems
This commit is contained in:
commit
90a6f1090a
|
@ -155,7 +155,7 @@ func actionServerCommand(ctx *cli.Context) error {
|
||||||
|
|
||||||
// waitForCertificates is responsible for waiting for the certificates to appear
|
// waitForCertificates is responsible for waiting for the certificates to appear
|
||||||
func waitForCertificates(files []string, timeout time.Duration) error {
|
func waitForCertificates(files []string, timeout time.Duration) error {
|
||||||
doneCh := make(chan struct{}, 0)
|
doneCh := make(chan struct{})
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
expires := time.Now().Add(timeout)
|
expires := time.Now().Add(timeout)
|
||||||
|
|
|
@ -49,8 +49,8 @@ func NewVerifier() (server.Verifier, error) {
|
||||||
|
|
||||||
// Verify is responsible for build a identification document
|
// Verify is responsible for build a identification document
|
||||||
func (a *awsNodeVerifier) VerifyIdentity(ctx context.Context) ([]byte, error) {
|
func (a *awsNodeVerifier) VerifyIdentity(ctx context.Context) ([]byte, error) {
|
||||||
errs := make(chan error, 0)
|
errs := make(chan error)
|
||||||
doneCh := make(chan []byte, 0)
|
doneCh := make(chan []byte)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
encoded, err := func() ([]byte, error) {
|
encoded, err := func() ([]byte, error) {
|
||||||
|
|
|
@ -35,7 +35,7 @@ var (
|
||||||
|
|
||||||
// authorizeNodeRequest is responsible for handling the incoming authorization request
|
// authorizeNodeRequest is responsible for handling the incoming authorization request
|
||||||
func (n *NodeAuthorizer) authorizeNodeRequest(ctx context.Context, request *NodeRegistration) error {
|
func (n *NodeAuthorizer) authorizeNodeRequest(ctx context.Context, request *NodeRegistration) error {
|
||||||
doneCh := make(chan error, 0)
|
doneCh := make(chan error)
|
||||||
|
|
||||||
// @step: create a context to run under
|
// @step: create a context to run under
|
||||||
ctx, cancel := context.WithTimeout(ctx, n.config.AuthorizationTimeout)
|
ctx, cancel := context.WithTimeout(ctx, n.config.AuthorizationTimeout)
|
||||||
|
|
|
@ -79,7 +79,7 @@ func (e *VPC) Find(c *fi.Context) (*VPC, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if vpcs == nil || len(vpcs) == 0 {
|
if len(vpcs) == 0 {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -328,7 +328,7 @@ func ZoneToVSwitchID(VPCID string, zones []string, vswitchIDs []string) (map[str
|
||||||
return res, fmt.Errorf("error describing VPC: %v", err)
|
return res, fmt.Errorf("error describing VPC: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if vpc == nil || len(vpc) == 0 {
|
if len(vpc) == 0 {
|
||||||
return res, fmt.Errorf("VPC %q not found", VPCID)
|
return res, fmt.Errorf("VPC %q not found", VPCID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ func buildEphemeralDevices(cloud awsup.AWSCloud, machineType string) (map[string
|
||||||
|
|
||||||
// buildAdditionalDevices is responsible for creating additional volumes in this lc
|
// buildAdditionalDevices is responsible for creating additional volumes in this lc
|
||||||
func buildAdditionalDevices(volumes []*BlockDeviceMapping) (map[string]*BlockDeviceMapping, error) {
|
func buildAdditionalDevices(volumes []*BlockDeviceMapping) (map[string]*BlockDeviceMapping, error) {
|
||||||
devices := make(map[string]*BlockDeviceMapping, 0)
|
devices := make(map[string]*BlockDeviceMapping)
|
||||||
|
|
||||||
// @step: iterate the volumes and create devices from them
|
// @step: iterate the volumes and create devices from them
|
||||||
for _, x := range volumes {
|
for _, x := range volumes {
|
||||||
|
|
Loading…
Reference in New Issue