Replace old job service package with V2 (rename packages)

This commit is contained in:
Steven Zou 2018-03-30 11:22:29 +08:00
parent bfbb949034
commit 013028ef4a
40 changed files with 116 additions and 119 deletions

View File

@ -8,13 +8,13 @@ import (
"io/ioutil"
"net/http"
"github.com/vmware/harbor/src/jobservice_v2/opm"
"github.com/vmware/harbor/src/jobservice/opm"
"github.com/gorilla/mux"
"github.com/vmware/harbor/src/jobservice_v2/core"
"github.com/vmware/harbor/src/jobservice_v2/errs"
"github.com/vmware/harbor/src/jobservice_v2/models"
"github.com/vmware/harbor/src/jobservice/core"
"github.com/vmware/harbor/src/jobservice/errs"
"github.com/vmware/harbor/src/jobservice/models"
)
//Handler defines approaches to handle the http requests.

View File

@ -14,8 +14,8 @@ import (
"testing"
"time"
"github.com/vmware/harbor/src/jobservice_v2/env"
"github.com/vmware/harbor/src/jobservice_v2/models"
"github.com/vmware/harbor/src/jobservice/env"
"github.com/vmware/harbor/src/jobservice/models"
)
var testingHandler = NewDefaultHandler(&fakeController{})

View File

@ -9,9 +9,9 @@ import (
"net/http"
"time"
"github.com/vmware/harbor/src/jobservice_v2/config"
"github.com/vmware/harbor/src/jobservice_v2/env"
"github.com/vmware/harbor/src/jobservice_v2/logger"
"github.com/vmware/harbor/src/jobservice/config"
"github.com/vmware/harbor/src/jobservice/env"
"github.com/vmware/harbor/src/jobservice/logger"
)
//Server serves the http requests.

View File

@ -11,7 +11,7 @@ import (
"strconv"
"strings"
"github.com/vmware/harbor/src/jobservice_v2/utils"
"github.com/vmware/harbor/src/jobservice/utils"
yaml "gopkg.in/yaml.v2"
)

View File

@ -8,12 +8,12 @@ import (
"io/ioutil"
"github.com/robfig/cron"
"github.com/vmware/harbor/src/jobservice_v2/config"
"github.com/vmware/harbor/src/jobservice_v2/errs"
"github.com/vmware/harbor/src/jobservice_v2/job"
"github.com/vmware/harbor/src/jobservice_v2/models"
"github.com/vmware/harbor/src/jobservice_v2/pool"
"github.com/vmware/harbor/src/jobservice_v2/utils"
"github.com/vmware/harbor/src/jobservice/config"
"github.com/vmware/harbor/src/jobservice/errs"
"github.com/vmware/harbor/src/jobservice/job"
"github.com/vmware/harbor/src/jobservice/models"
"github.com/vmware/harbor/src/jobservice/pool"
"github.com/vmware/harbor/src/jobservice/utils"
)
const (

View File

@ -5,10 +5,10 @@ import (
"errors"
"testing"
"github.com/vmware/harbor/src/jobservice_v2/errs"
"github.com/vmware/harbor/src/jobservice/errs"
"github.com/vmware/harbor/src/jobservice_v2/env"
"github.com/vmware/harbor/src/jobservice_v2/models"
"github.com/vmware/harbor/src/jobservice/env"
"github.com/vmware/harbor/src/jobservice/models"
)
func TestLaunchGenericJob(t *testing.T) {

View File

@ -4,7 +4,7 @@
package core
import (
"github.com/vmware/harbor/src/jobservice_v2/models"
"github.com/vmware/harbor/src/jobservice/models"
)
//Interface defines the related main methods of job operation.

View File

@ -5,7 +5,7 @@ package env
import (
"context"
"github.com/vmware/harbor/src/jobservice_v2/logger"
"github.com/vmware/harbor/src/jobservice/logger"
)
//JobContext is combination of BaseContext and other job specified resources.

View File

@ -12,11 +12,11 @@ import (
"github.com/vmware/harbor/src/common"
"github.com/vmware/harbor/src/common/dao"
"github.com/vmware/harbor/src/common/models"
"github.com/vmware/harbor/src/jobservice_v2/config"
"github.com/vmware/harbor/src/jobservice_v2/env"
"github.com/vmware/harbor/src/jobservice_v2/job"
jlogger "github.com/vmware/harbor/src/jobservice_v2/job/impl/logger"
"github.com/vmware/harbor/src/jobservice_v2/logger"
"github.com/vmware/harbor/src/jobservice/config"
"github.com/vmware/harbor/src/jobservice/env"
"github.com/vmware/harbor/src/jobservice/job"
jlogger "github.com/vmware/harbor/src/jobservice/job/impl/logger"
"github.com/vmware/harbor/src/jobservice/logger"
)
//Context ...

View File

@ -10,11 +10,11 @@ import (
"github.com/vmware/harbor/src/common/dao"
"github.com/vmware/harbor/src/common/models"
"github.com/vmware/harbor/src/jobservice_v2/opm"
"github.com/vmware/harbor/src/jobservice/opm"
"github.com/vmware/harbor/src/jobservice_v2/errs"
"github.com/vmware/harbor/src/jobservice/errs"
"github.com/vmware/harbor/src/jobservice_v2/env"
"github.com/vmware/harbor/src/jobservice/env"
)
//DemoJob is the job to demostrate the job interface.

View File

@ -5,8 +5,8 @@ import (
common_http "github.com/vmware/harbor/src/common/http"
"github.com/vmware/harbor/src/common/utils/registry/auth"
"github.com/vmware/harbor/src/jobservice_v2/env"
"github.com/vmware/harbor/src/jobservice_v2/logger"
"github.com/vmware/harbor/src/jobservice/env"
"github.com/vmware/harbor/src/jobservice/logger"
)
// Deleter deletes repository or images on the destination registry

View File

@ -8,8 +8,8 @@ import (
"github.com/vmware/harbor/src/common/models"
reg "github.com/vmware/harbor/src/common/utils/registry"
"github.com/vmware/harbor/src/common/utils/registry/auth"
"github.com/vmware/harbor/src/jobservice_v2/env"
"github.com/vmware/harbor/src/jobservice_v2/logger"
"github.com/vmware/harbor/src/jobservice/env"
"github.com/vmware/harbor/src/jobservice/logger"
)
// Replicator call UI's API to start a repliation according to the policy ID

View File

@ -17,9 +17,9 @@ import (
"github.com/vmware/harbor/src/common/utils"
reg "github.com/vmware/harbor/src/common/utils/registry"
"github.com/vmware/harbor/src/common/utils/registry/auth"
"github.com/vmware/harbor/src/jobservice_v2/env"
job_utils "github.com/vmware/harbor/src/jobservice_v2/job/impl/utils"
"github.com/vmware/harbor/src/jobservice_v2/logger"
"github.com/vmware/harbor/src/jobservice/env"
job_utils "github.com/vmware/harbor/src/jobservice/job/impl/utils"
"github.com/vmware/harbor/src/jobservice/logger"
)
var (

View File

@ -26,8 +26,8 @@ import (
"github.com/vmware/harbor/src/common/models"
"github.com/vmware/harbor/src/common/utils/clair"
"github.com/vmware/harbor/src/common/utils/log"
"github.com/vmware/harbor/src/jobservice_v2/env"
"github.com/vmware/harbor/src/jobservice_v2/job/impl/utils"
"github.com/vmware/harbor/src/jobservice/env"
"github.com/vmware/harbor/src/jobservice/job/impl/utils"
)
// ClairJob is the struct to scan Harbor's Image with Clair

View File

@ -2,7 +2,7 @@
package job
import "github.com/vmware/harbor/src/jobservice_v2/env"
import "github.com/vmware/harbor/src/jobservice/env"
//CheckOPCmdFunc is the function to check if the related operation commands
//like STOP or CANCEL is fired for the specified job. If yes, return the

BIN
src/jobservice/main Executable file

Binary file not shown.

View File

@ -6,13 +6,13 @@ import (
"fmt"
"github.com/vmware/harbor/src/adminserver/client"
"github.com/vmware/harbor/src/jobservice_v2/config"
"github.com/vmware/harbor/src/jobservice_v2/env"
"github.com/vmware/harbor/src/jobservice_v2/job/impl"
ilogger "github.com/vmware/harbor/src/jobservice_v2/job/impl/logger"
"github.com/vmware/harbor/src/jobservice_v2/logger"
"github.com/vmware/harbor/src/jobservice_v2/runtime"
"github.com/vmware/harbor/src/jobservice_v2/utils"
"github.com/vmware/harbor/src/jobservice/config"
"github.com/vmware/harbor/src/jobservice/env"
"github.com/vmware/harbor/src/jobservice/job/impl"
ilogger "github.com/vmware/harbor/src/jobservice/job/impl/logger"
"github.com/vmware/harbor/src/jobservice/logger"
"github.com/vmware/harbor/src/jobservice/runtime"
"github.com/vmware/harbor/src/jobservice/utils"
)
func main() {

View File

@ -13,8 +13,8 @@ import (
"strings"
"time"
"github.com/vmware/harbor/src/jobservice_v2/models"
"github.com/vmware/harbor/src/jobservice_v2/utils"
"github.com/vmware/harbor/src/jobservice/models"
"github.com/vmware/harbor/src/jobservice/utils"
)
const (

View File

@ -7,7 +7,7 @@ import (
"net/http/httptest"
"testing"
"github.com/vmware/harbor/src/jobservice_v2/models"
"github.com/vmware/harbor/src/jobservice/models"
)
func TestHookClient(t *testing.T) {

View File

@ -5,7 +5,7 @@ package opm
import (
"sync"
"github.com/vmware/harbor/src/jobservice_v2/utils"
"github.com/vmware/harbor/src/jobservice/utils"
)
//HookStore is used to cache the hooks in memory.

View File

@ -2,7 +2,7 @@
package opm
import "github.com/vmware/harbor/src/jobservice_v2/models"
import "github.com/vmware/harbor/src/jobservice/models"
//JobStatsManager defines the methods to handle stats of job.
type JobStatsManager interface {

View File

@ -13,13 +13,13 @@ import (
"sync/atomic"
"time"
"github.com/vmware/harbor/src/jobservice_v2/errs"
"github.com/vmware/harbor/src/jobservice_v2/logger"
"github.com/vmware/harbor/src/jobservice/errs"
"github.com/vmware/harbor/src/jobservice/logger"
"github.com/garyburd/redigo/redis"
"github.com/vmware/harbor/src/jobservice_v2/job"
"github.com/vmware/harbor/src/jobservice_v2/models"
"github.com/vmware/harbor/src/jobservice_v2/utils"
"github.com/vmware/harbor/src/jobservice/job"
"github.com/vmware/harbor/src/jobservice/models"
"github.com/vmware/harbor/src/jobservice/utils"
)
const (

View File

@ -13,9 +13,9 @@ import (
"time"
"github.com/garyburd/redigo/redis"
"github.com/vmware/harbor/src/jobservice_v2/job"
"github.com/vmware/harbor/src/jobservice_v2/models"
"github.com/vmware/harbor/src/jobservice_v2/utils"
"github.com/vmware/harbor/src/jobservice/job"
"github.com/vmware/harbor/src/jobservice/models"
"github.com/vmware/harbor/src/jobservice/utils"
)
const (

View File

@ -9,9 +9,9 @@ import (
"github.com/garyburd/redigo/redis"
"github.com/gocraft/work"
"github.com/robfig/cron"
"github.com/vmware/harbor/src/jobservice_v2/job"
"github.com/vmware/harbor/src/jobservice_v2/logger"
"github.com/vmware/harbor/src/jobservice_v2/utils"
"github.com/vmware/harbor/src/jobservice/job"
"github.com/vmware/harbor/src/jobservice/logger"
"github.com/vmware/harbor/src/jobservice/utils"
)
const (

View File

@ -6,8 +6,8 @@ import (
"testing"
"time"
"github.com/vmware/harbor/src/jobservice_v2/tests"
"github.com/vmware/harbor/src/jobservice_v2/utils"
"github.com/vmware/harbor/src/jobservice/tests"
"github.com/vmware/harbor/src/jobservice/utils"
)
func TestPeriodicEnqueuerStartStop(t *testing.T) {

View File

@ -2,7 +2,7 @@
package period
import "github.com/vmware/harbor/src/jobservice_v2/models"
import "github.com/vmware/harbor/src/jobservice/models"
//Interface defines operations the periodic scheduler should have.
type Interface interface {

View File

@ -6,7 +6,7 @@ import (
"encoding/json"
"sync"
"github.com/vmware/harbor/src/jobservice_v2/utils"
"github.com/vmware/harbor/src/jobservice/utils"
)
const (

View File

@ -12,10 +12,10 @@ import (
"github.com/robfig/cron"
"github.com/garyburd/redigo/redis"
"github.com/vmware/harbor/src/jobservice_v2/env"
"github.com/vmware/harbor/src/jobservice_v2/logger"
"github.com/vmware/harbor/src/jobservice_v2/models"
"github.com/vmware/harbor/src/jobservice_v2/utils"
"github.com/vmware/harbor/src/jobservice/env"
"github.com/vmware/harbor/src/jobservice/logger"
"github.com/vmware/harbor/src/jobservice/models"
"github.com/vmware/harbor/src/jobservice/utils"
)
const (

View File

@ -7,9 +7,9 @@ import (
"testing"
"time"
"github.com/vmware/harbor/src/jobservice_v2/env"
"github.com/vmware/harbor/src/jobservice_v2/tests"
"github.com/vmware/harbor/src/jobservice_v2/utils"
"github.com/vmware/harbor/src/jobservice/env"
"github.com/vmware/harbor/src/jobservice/tests"
"github.com/vmware/harbor/src/jobservice/utils"
)
var redisPool = tests.GiveMeRedisPool()

View File

@ -9,8 +9,8 @@ import (
"github.com/gocraft/work"
"github.com/garyburd/redigo/redis"
"github.com/vmware/harbor/src/jobservice_v2/logger"
"github.com/vmware/harbor/src/jobservice_v2/utils"
"github.com/vmware/harbor/src/jobservice/logger"
"github.com/vmware/harbor/src/jobservice/utils"
)
//Sweeper take charge of clearing the outdated data such as scheduled jobs etc..

View File

@ -8,8 +8,8 @@ import (
"github.com/gocraft/work"
"github.com/vmware/harbor/src/jobservice_v2/tests"
"github.com/vmware/harbor/src/jobservice_v2/utils"
"github.com/vmware/harbor/src/jobservice/tests"
"github.com/vmware/harbor/src/jobservice/utils"
)
func TestSweeper(t *testing.T) {

View File

@ -2,7 +2,7 @@
package pool
import "github.com/vmware/harbor/src/jobservice_v2/models"
import "github.com/vmware/harbor/src/jobservice/models"
//Interface for worker pool.
//More like a driver to transparent the lower queue.

View File

@ -9,13 +9,13 @@ import (
"reflect"
"time"
"github.com/vmware/harbor/src/jobservice_v2/logger"
"github.com/vmware/harbor/src/jobservice_v2/opm"
"github.com/vmware/harbor/src/jobservice_v2/period"
"github.com/vmware/harbor/src/jobservice/logger"
"github.com/vmware/harbor/src/jobservice/opm"
"github.com/vmware/harbor/src/jobservice/period"
"github.com/garyburd/redigo/redis"
"github.com/vmware/harbor/src/jobservice_v2/models"
"github.com/vmware/harbor/src/jobservice_v2/utils"
"github.com/vmware/harbor/src/jobservice/models"
"github.com/vmware/harbor/src/jobservice/utils"
)
//MessageServer implements the sub/pub mechanism via redis to do async message exchanging.

View File

@ -8,13 +8,13 @@ import (
"testing"
"time"
"github.com/vmware/harbor/src/jobservice_v2/opm"
"github.com/vmware/harbor/src/jobservice/opm"
"github.com/vmware/harbor/src/jobservice_v2/models"
"github.com/vmware/harbor/src/jobservice_v2/period"
"github.com/vmware/harbor/src/jobservice_v2/utils"
"github.com/vmware/harbor/src/jobservice/models"
"github.com/vmware/harbor/src/jobservice/period"
"github.com/vmware/harbor/src/jobservice/utils"
"github.com/vmware/harbor/src/jobservice_v2/tests"
"github.com/vmware/harbor/src/jobservice/tests"
)
var redisPool = tests.GiveMeRedisPool()

View File

@ -7,11 +7,11 @@ import (
"time"
"github.com/gocraft/work"
"github.com/vmware/harbor/src/jobservice_v2/env"
"github.com/vmware/harbor/src/jobservice_v2/errs"
"github.com/vmware/harbor/src/jobservice_v2/job"
"github.com/vmware/harbor/src/jobservice_v2/logger"
"github.com/vmware/harbor/src/jobservice_v2/opm"
"github.com/vmware/harbor/src/jobservice/env"
"github.com/vmware/harbor/src/jobservice/errs"
"github.com/vmware/harbor/src/jobservice/job"
"github.com/vmware/harbor/src/jobservice/logger"
"github.com/vmware/harbor/src/jobservice/opm"
)
//RedisJob is a job wrapper to wrap the job.Interface to the style which can be recognized by the redis pool.

View File

@ -10,13 +10,13 @@ import (
"github.com/garyburd/redigo/redis"
"github.com/gocraft/work"
"github.com/robfig/cron"
"github.com/vmware/harbor/src/jobservice_v2/env"
"github.com/vmware/harbor/src/jobservice_v2/job"
"github.com/vmware/harbor/src/jobservice_v2/logger"
"github.com/vmware/harbor/src/jobservice_v2/models"
"github.com/vmware/harbor/src/jobservice_v2/opm"
"github.com/vmware/harbor/src/jobservice_v2/period"
"github.com/vmware/harbor/src/jobservice_v2/utils"
"github.com/vmware/harbor/src/jobservice/env"
"github.com/vmware/harbor/src/jobservice/job"
"github.com/vmware/harbor/src/jobservice/logger"
"github.com/vmware/harbor/src/jobservice/models"
"github.com/vmware/harbor/src/jobservice/opm"
"github.com/vmware/harbor/src/jobservice/period"
"github.com/vmware/harbor/src/jobservice/utils"
)
var (

View File

@ -9,14 +9,14 @@ import (
"testing"
"time"
"github.com/vmware/harbor/src/jobservice_v2/errs"
"github.com/vmware/harbor/src/jobservice_v2/job"
"github.com/vmware/harbor/src/jobservice_v2/logger"
"github.com/vmware/harbor/src/jobservice_v2/opm"
"github.com/vmware/harbor/src/jobservice/errs"
"github.com/vmware/harbor/src/jobservice/job"
"github.com/vmware/harbor/src/jobservice/logger"
"github.com/vmware/harbor/src/jobservice/opm"
"github.com/vmware/harbor/src/jobservice_v2/tests"
"github.com/vmware/harbor/src/jobservice/tests"
"github.com/vmware/harbor/src/jobservice_v2/env"
"github.com/vmware/harbor/src/jobservice/env"
)
var rPool = tests.GiveMeRedisPool()

View File

@ -5,7 +5,7 @@ package pool
import (
"reflect"
"github.com/vmware/harbor/src/jobservice_v2/job"
"github.com/vmware/harbor/src/jobservice/job"
)
//Wrap returns a new job.Interface based on the wrapped job handler reference.

View File

@ -13,15 +13,15 @@ import (
"github.com/garyburd/redigo/redis"
"github.com/vmware/harbor/src/common/job"
"github.com/vmware/harbor/src/jobservice_v2/api"
"github.com/vmware/harbor/src/jobservice_v2/config"
"github.com/vmware/harbor/src/jobservice_v2/core"
"github.com/vmware/harbor/src/jobservice_v2/env"
"github.com/vmware/harbor/src/jobservice_v2/job/impl"
"github.com/vmware/harbor/src/jobservice_v2/job/impl/replication"
"github.com/vmware/harbor/src/jobservice_v2/job/impl/scan"
"github.com/vmware/harbor/src/jobservice_v2/logger"
"github.com/vmware/harbor/src/jobservice_v2/pool"
"github.com/vmware/harbor/src/jobservice/api"
"github.com/vmware/harbor/src/jobservice/config"
"github.com/vmware/harbor/src/jobservice/core"
"github.com/vmware/harbor/src/jobservice/env"
"github.com/vmware/harbor/src/jobservice/job/impl"
"github.com/vmware/harbor/src/jobservice/job/impl/replication"
"github.com/vmware/harbor/src/jobservice/job/impl/scan"
"github.com/vmware/harbor/src/jobservice/logger"
"github.com/vmware/harbor/src/jobservice/pool"
)
const (

View File

@ -29,7 +29,6 @@ import (
"github.com/vmware/harbor/src/common/models"
"github.com/vmware/harbor/src/common/secret"
"github.com/vmware/harbor/src/common/utils/log"
jobservice_client "github.com/vmware/harbor/src/jobservice/client"
"github.com/vmware/harbor/src/ui/promgr"
"github.com/vmware/harbor/src/ui/promgr/pmsdriver"
"github.com/vmware/harbor/src/ui/promgr/pmsdriver/admiral"
@ -56,8 +55,6 @@ var (
AdmiralClient *http.Client
// TokenReader is used in integration mode to read token
TokenReader admiral.TokenReader
// GlobalJobserviceClient is a global client for jobservice
GlobalJobserviceClient jobservice_client.Client
)
// Init configurations