Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Commit

Permalink
minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Jingtao Ren committed Jan 11, 2018
1 parent 458b86c commit efa6712
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 2 additions & 5 deletions pkg/backup/writer/abs_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ func (absw *absWriter) Write(path string, r io.Reader) (int64, error) {
}

blob := containerRef.GetBlobReference(key)
putBlobOpts := storage.PutBlobOptions{}

err = blob.CreateBlockBlob(&putBlobOpts)
err = blob.CreateBlockBlob(&storage.PutBlobOptions{})
if err != nil {
return 0, err
}
Expand Down Expand Up @@ -92,8 +90,7 @@ func (absw *absWriter) Write(path string, r io.Reader) (int64, error) {
return 0, err
}

getBlobOpts := &storage.GetBlobOptions{}
_, err = blob.Get(getBlobOpts)
_, err = blob.Get(&storage.GetBlobOptions{})
if err != nil {
return 0, err
}
Expand Down
4 changes: 1 addition & 3 deletions pkg/util/azureutil/absfactory/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func NewClientFromSecret(kubecli kubernetes.Interface, namespace, absSecret stri
}
}()

w = &ABSClient{}
se, err := kubecli.CoreV1().Secrets(namespace).Get(absSecret, metav1.GetOptions{})
if err != nil {
return nil, fmt.Errorf("failed to get k8s secret: %v", err)
Expand All @@ -58,6 +57,5 @@ func NewClientFromSecret(kubecli kubernetes.Interface, namespace, absSecret stri
}

abs := bc.GetBlobService()
w.ABS = &abs
return w, nil
return &ABSClient{ABS: &abs}, nil
}

0 comments on commit efa6712

Please sign in to comment.