diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml new file mode 100644 index 0000000..62d1f7d --- /dev/null +++ b/.github/workflows/pr-release.yml @@ -0,0 +1,40 @@ +name: Build test image +on: + pull_request: + types: [ labeled ] +env: + REGISTRY: harbor.clyso.com +jobs: + # build and publish docker images + docker: + if: ${{ github.event.label.name == 'test' }} + strategy: + matrix: + service: + - worker + - proxy + - agent + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ${{ env.REGISTRY }}/chorus/${{ matrix.service }}:${{ github.head_ref || github.ref_name }} + build-args: | + GIT_TAG=${{ github.ref_name }} + GIT_COMMIT=${{ github.sha }} + SERVICE=${{ matrix.service }} diff --git a/service/worker/handler/migration_bucket_list_obj_handler.go b/service/worker/handler/migration_bucket_list_obj_handler.go index 2f8694e..7fc8fd8 100644 --- a/service/worker/handler/migration_bucket_list_obj_handler.go +++ b/service/worker/handler/migration_bucket_list_obj_handler.go @@ -21,6 +21,7 @@ import ( "encoding/json" "errors" "fmt" + "strings" xctx "github.com/clyso/chorus/pkg/ctx" "github.com/clyso/chorus/pkg/dom" @@ -74,7 +75,7 @@ func (s *svc) HandleMigrationBucketListObj(ctx context.Context, t *asynq.Task) e return fmt.Errorf("migration bucket list obj: list objects error %w", object.Err) } objectsNum++ - isDir := object.Size == 0 && object.ContentType == "" && object.ETag == "" && object.LastModified.IsZero() + isDir := object.Size == 0 && strings.HasSuffix(object.Key, "/") logger.Debug().Str(log.Object, object.Key).Str("obj_version_id", object.VersionID).Bool("is_dir", isDir).Msg("migration bucket list obj: start processing object from the list") if isDir { subP := p