Skip to content

Commit 197d335

Browse files
committed
Fixed golint issues and new piecies of wait.Poll
Signed-off-by: RainbowMango <[email protected]>
1 parent 6a07cca commit 197d335

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

pkg/controllers/certificate/cert_rotation_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func (c *CertRotationController) syncCertRotation(secret *corev1.Secret) error {
181181

182182
var newCertData []byte
183183
klog.V(1).Infof("Waiting for the client certificate to be issued")
184-
err = wait.PollUntilContextTimeout(context.TODO(), 1*time.Second, 5*time.Minute, false, func(ctx context.Context) (done bool, err error) {
184+
err = wait.PollUntilContextTimeout(context.TODO(), 1*time.Second, 5*time.Minute, false, func(context.Context) (done bool, err error) {
185185
csr, err := c.KubeClient.CertificatesV1().CertificateSigningRequests().Get(context.TODO(), csr, metav1.GetOptions{})
186186
if err != nil {
187187
return false, fmt.Errorf("failed to get the cluster csr %s. err: %v", clusterName, err)

pkg/karmadactl/register/register.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ func (o *CommandRegisterOption) constructKarmadaAgentConfig(bootstrapClient *kub
545545
}
546546

547547
klog.V(1).Infof("Waiting for the client certificate to be issued")
548-
err = wait.PollUntilContextTimeout(context.TODO(), 1*time.Second, o.Timeout, false, func(ctx context.Context) (done bool, err error) {
548+
err = wait.PollUntilContextTimeout(context.TODO(), 1*time.Second, o.Timeout, false, func(context.Context) (done bool, err error) {
549549
csrOK, err := bootstrapClient.CertificatesV1().CertificateSigningRequests().Get(context.TODO(), csrName, metav1.GetOptions{})
550550
if err != nil {
551551
return false, fmt.Errorf("failed to get the cluster csr %s. err: %v", o.ClusterName, err)

pkg/karmadactl/unjoin/unjoin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ func (j *CommandUnjoinOption) deleteClusterObject(controlPlaneKarmadaClient *kar
239239
}
240240

241241
// make sure the given cluster object has been deleted
242-
err = wait.PollUntilContextTimeout(context.TODO(), 1*time.Second, j.Wait, false, func(ctx context.Context) (done bool, err error) {
242+
err = wait.PollUntilContextTimeout(context.TODO(), 1*time.Second, j.Wait, false, func(context.Context) (done bool, err error) {
243243
_, err = controlPlaneKarmadaClient.ClusterV1alpha1().Clusters().Get(context.TODO(), j.ClusterName, metav1.GetOptions{})
244244
if apierrors.IsNotFound(err) {
245245
return true, nil

pkg/util/serviceaccount.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func EnsureServiceAccountExist(client kubeclient.Interface, serviceAccountObj *c
9191
// WaitForServiceAccountSecretCreation wait the ServiceAccount's secret has been created.
9292
func WaitForServiceAccountSecretCreation(client kubeclient.Interface, asObj *corev1.ServiceAccount) (*corev1.Secret, error) {
9393
var clusterSecret *corev1.Secret
94-
err := wait.PollUntilContextTimeout(context.TODO(), 1*time.Second, 30*time.Second, false, func(ctx context.Context) (done bool, err error) {
94+
err := wait.PollUntilContextTimeout(context.TODO(), 1*time.Second, 30*time.Second, false, func(context.Context) (done bool, err error) {
9595
serviceAccount, err := client.CoreV1().ServiceAccounts(asObj.Namespace).Get(context.TODO(), asObj.Name, metav1.GetOptions{})
9696
if err != nil {
9797
if apierrors.IsNotFound(err) {

0 commit comments

Comments
 (0)