func (contextReader *AliyunOSSBuildContextReader) Read() (string, error) {
	accessId, err := util.ReadCredentials(contextReader.k8sClient, contextReader.buildContext.AccessId)
	if err != nil {
		return "", err
	}
	accessSecret, err := util.ReadCredentials(contextReader.k8sClient, contextReader.buildContext.AccessSecret)
	if err != nil {
		return "", err
	}
	client, err := oss.New(contextReader.buildContext.Endpoint, accessId, accessSecret)
	if err != nil {
		return "", err
	}
	bucket, err := client.Bucket(contextReader.buildContext.Bucket.Name)
	if err != nil {
		return "", err
	}
	contextFilePath := fmt.Sprintf("%s/%s", common.ContextDirectory, common.ContextFile)
	if err := os.MkdirAll(common.ContextDirectory, 0750); err != nil {
		return "", err
	}
	if _, err := os.Create(contextFilePath); err != nil {
		return "", err
	}
	if err := bucket.GetObjectToFile(contextReader.buildContext.Bucket.Key, contextFilePath); err != nil {
		return "", err
	}
	if err := util.UntarFile(contextFilePath, common.ContextDirectoryUncompressed); err != nil {
		return "", err
	}
	return common.ContextDirectoryUncompressed, nil
}
Read reads and stores build context from OSS
package context
import (
	"fmt"
	"os"
	"github.com/aliyun/aliyun-oss-go-sdk/oss"
	"github.com/ocibuilder/ocibuilder/pkg/apis/ocibuilder/v1alpha1"
	"github.com/ocibuilder/ocibuilder/pkg/common"
	"github.com/ocibuilder/ocibuilder/pkg/util"
	"k8s.io/client-go/kubernetes"
)
type AliyunOSSBuildContextReader struct {
	buildContext *v1alpha1.AliyunOSSContext
	k8sClient kubernetes.Interface
}