mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-25 17:34:17 +00:00
Run the E2E test on kind / get-go-version (push) Successful in 59s
Run the E2E test on kind / setup-test-matrix (push) Successful in 4s
Main CI / get-go-version (push) Successful in 14s
Run the E2E test on kind / build (push) Failing after 1m48s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 25s
* Replace github.com/robfig/cron/v3 by github.com/netresearch/go-cron Replace k8s.io/utils/pointer with k8s.io/utils/ptr Signed-off-by: Xun Jiang <xun.jiang@broadcom.com> * Replace gopkg.in/yaml.v3 by go.yaml.in/yaml/v3 Signed-off-by: Xun Jiang <xun.jiang@broadcom.com> * Replace github.com/joho/godotenv. Move the needed code into Velero repository. Signed-off-by: Xun Jiang <xun.jiang@broadcom.com> * Replace github.com/pkg/errors by github.com/cockroachdb/errors Change errors.Cause to errors.Is, because github.com/cockroachdb/errors New() function create a error with error stack with depth 1, but github.com/pkg/errors's New() function create error with no depth. Signed-off-by: Xun Jiang <xun.jiang@broadcom.com> --------- Signed-off-by: Xun Jiang <xun.jiang@broadcom.com> Signed-off-by: Xun Jiang/Bruce Jiang <59276555+blackpiglet@users.noreply.github.com>
23 lines
586 B
Go
23 lines
586 B
Go
package k8s
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/cockroachdb/errors"
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
)
|
|
|
|
func InstallStorageClass(ctx context.Context, yaml string) error {
|
|
fmt.Printf("Install storage class with %s.\n", yaml)
|
|
err := KubectlApplyByFile(ctx, yaml)
|
|
return err
|
|
}
|
|
|
|
func DeleteStorageClass(ctx context.Context, client TestClient, name string) error {
|
|
if err := client.ClientGo.StorageV1().StorageClasses().Delete(ctx, name, metav1.DeleteOptions{}); err != nil {
|
|
return errors.Wrapf(err, "Could not retrieve storage classes %s", name)
|
|
}
|
|
return nil
|
|
}
|