mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-25 09:24:16 +00:00
Rename Ark to Velero!!!
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
This commit is contained in:
committed by
Andy Goldstein
parent
bbc6caf7fe
commit
43714caaec
@@ -26,25 +26,25 @@ import (
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/clock"
|
||||
|
||||
arkv1api "github.com/heptio/ark/pkg/apis/ark/v1"
|
||||
"github.com/heptio/ark/pkg/buildinfo"
|
||||
arkv1client "github.com/heptio/ark/pkg/generated/clientset/versioned/typed/ark/v1"
|
||||
velerov1api "github.com/heptio/velero/pkg/apis/velero/v1"
|
||||
"github.com/heptio/velero/pkg/buildinfo"
|
||||
velerov1client "github.com/heptio/velero/pkg/generated/clientset/versioned/typed/velero/v1"
|
||||
)
|
||||
|
||||
const ttl = time.Minute
|
||||
|
||||
// Process fills out new ServerStatusRequest objects and deletes processed ones
|
||||
// that have expired.
|
||||
func Process(req *arkv1api.ServerStatusRequest, client arkv1client.ServerStatusRequestsGetter, clock clock.Clock, log logrus.FieldLogger) error {
|
||||
func Process(req *velerov1api.ServerStatusRequest, client velerov1client.ServerStatusRequestsGetter, clock clock.Clock, log logrus.FieldLogger) error {
|
||||
switch req.Status.Phase {
|
||||
case "", arkv1api.ServerStatusRequestPhaseNew:
|
||||
case "", velerov1api.ServerStatusRequestPhaseNew:
|
||||
log.Info("Processing new ServerStatusRequest")
|
||||
return errors.WithStack(patch(client, req, func(req *arkv1api.ServerStatusRequest) {
|
||||
return errors.WithStack(patch(client, req, func(req *velerov1api.ServerStatusRequest) {
|
||||
req.Status.ServerVersion = buildinfo.Version
|
||||
req.Status.ProcessedTimestamp.Time = clock.Now()
|
||||
req.Status.Phase = arkv1api.ServerStatusRequestPhaseProcessed
|
||||
req.Status.Phase = velerov1api.ServerStatusRequestPhaseProcessed
|
||||
}))
|
||||
case arkv1api.ServerStatusRequestPhaseProcessed:
|
||||
case velerov1api.ServerStatusRequestPhaseProcessed:
|
||||
log.Debug("Checking whether ServerStatusRequest has expired")
|
||||
expiration := req.Status.ProcessedTimestamp.Add(ttl)
|
||||
if expiration.After(clock.Now()) {
|
||||
@@ -63,7 +63,7 @@ func Process(req *arkv1api.ServerStatusRequest, client arkv1client.ServerStatusR
|
||||
}
|
||||
}
|
||||
|
||||
func patch(client arkv1client.ServerStatusRequestsGetter, req *arkv1api.ServerStatusRequest, updateFunc func(*arkv1api.ServerStatusRequest)) error {
|
||||
func patch(client velerov1client.ServerStatusRequestsGetter, req *velerov1api.ServerStatusRequest, updateFunc func(*velerov1api.ServerStatusRequest)) error {
|
||||
originalJSON, err := json.Marshal(req)
|
||||
if err != nil {
|
||||
return errors.WithStack(err)
|
||||
|
||||
Reference in New Issue
Block a user