mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-21 07:24:19 +00:00
When creating backup from schedule, allow default name (#2569)
* When creating backup from schedule, allow default name Signed-off-by: Christoph Blecker <admin@toph.ca>
This commit is contained in:
@@ -16,7 +16,12 @@ limitations under the License.
|
||||
|
||||
package v1
|
||||
|
||||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// ScheduleSpec defines the specification for a Velero schedule
|
||||
type ScheduleSpec struct {
|
||||
@@ -95,3 +100,8 @@ type ScheduleList struct {
|
||||
|
||||
Items []Schedule `json:"items"`
|
||||
}
|
||||
|
||||
// TimestampedName returns the default backup name format based on the schedule
|
||||
func (s *Schedule) TimestampedName(timestamp time.Time) string {
|
||||
return fmt.Sprintf("%s-%s", s.Name, timestamp.Format("20060102150405"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user