Skip to content

Commit

Permalink
nydusify: fix format error
Browse files Browse the repository at this point in the history
Signed-off-by: henry.hj <henry.hj@antgroup.com>
  • Loading branch information
henry.hj committed Feb 21, 2022
1 parent a058856 commit efca578
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion contrib/nydusify/pkg/packer/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (a Artifact) bootstrapPath(metaFileName string) string {
return filepath.Join(a.OutputDir, metaFileName)
}

func (a Artifact) outputJsonPath() string {
func (a Artifact) outputJSONPath() string {
return filepath.Join(a.OutputDir, "output.json")
}

Expand Down
20 changes: 10 additions & 10 deletions contrib/nydusify/pkg/packer/packer.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ type Builder interface {
}

type Packer struct {
logger *logrus.Logger
nydusImagePath string
BackendConfig *BackendConfig
pusher *Pusher
builder Builder
logger *logrus.Logger
nydusImagePath string
BackendConfig *BackendConfig
pusher *Pusher
builder Builder
Artifact
}

Expand All @@ -55,7 +55,7 @@ type BlobManifest struct {

type BackendConfig struct {
Endpoint string `json:"endpoint"`
AccessKeyId string `json:"access_key_id"`
AccessKeyID string `json:"access_key_id"`
AccessKeySecret string `json:"access_key_secret"`
BucketName string `json:"bucket_name"`
MetaPrefix string `json:"meta_prefix"`
Expand All @@ -65,7 +65,7 @@ type BackendConfig struct {
func (cfg *BackendConfig) rawMetaBackendCfg() []byte {
configMap := map[string]string{
"endpoint": cfg.Endpoint,
"access_key_id": cfg.AccessKeyId,
"access_key_id": cfg.AccessKeyID,
"access_key_secret": cfg.AccessKeySecret,
"bucket_name": cfg.BucketName,
"object_prefix": cfg.MetaPrefix + "/",
Expand All @@ -77,7 +77,7 @@ func (cfg *BackendConfig) rawMetaBackendCfg() []byte {
func (cfg *BackendConfig) rawBlobBackendCfg() []byte {
configMap := map[string]string{
"endpoint": cfg.Endpoint,
"access_key_id": cfg.AccessKeyId,
"access_key_id": cfg.AccessKeyID,
"access_key_secret": cfg.AccessKeySecret,
"bucket_name": cfg.BucketName,
"object_prefix": cfg.BlobPrefix + "/",
Expand Down Expand Up @@ -181,7 +181,7 @@ func (p *Packer) getNewBlobsHash(exists []string) (string, error) {
for _, blob := range exists {
m[blob] = true
}
content, err := ioutil.ReadFile(p.outputJsonPath())
content, err := ioutil.ReadFile(p.outputJSONPath())
if err != nil {
return "", err
}
Expand Down Expand Up @@ -215,7 +215,7 @@ func (p *Packer) Pack(_ context.Context, req PackRequest) (PackResult, error) {
BootstrapPath: p.bootstrapPath(req.Meta),
RootfsPath: req.TargetDir,
WhiteoutSpec: "oci",
OutputJSONPath: p.outputJsonPath(),
OutputJSONPath: p.outputJSONPath(),
BlobPath: blobPath,
}); err != nil {
return PackResult{}, errors.Wrapf(err, "failed to Pack targetDir %s", req.TargetDir)
Expand Down
4 changes: 2 additions & 2 deletions contrib/nydusify/pkg/packer/pusher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (m *mockBackend) Check(_ string) (bool, error) {
return false, nil
}

func (m *mockBackend) Type() backend.BackendType {
func (m *mockBackend) Type() backend.Type {
return backend.OssBackend
}

Expand All @@ -36,7 +36,7 @@ func Test_parseBackendConfig(t *testing.T) {
assert.Nil(t, err)
assert.Equal(t, BackendConfig{
Endpoint: "mock.aliyuncs.com",
AccessKeyId: "testid",
AccessKeyID: "testid",
AccessKeySecret: "testkey",
BucketName: "testbucket",
MetaPrefix: "test",
Expand Down

0 comments on commit efca578

Please sign in to comment.