Skip to content

Commit

Permalink
Remove unnecessary LocalPV support (#3739)
Browse files Browse the repository at this point in the history
* remove localpv

* remove pump and drainer local-path

* remove pump storage

* fix lint

* revert change in aws related code

* revert local-storage recycle code

* revert setup_local_pvc

* remove kind to set sc

* remove storageClassName set forcelly

* fix lint

* fix

* use standard in kind

* add comment and fix lint

* remove storageclass

* remove unused code

Co-authored-by: DanielZhangQD <[email protected]>
  • Loading branch information
handlerww and DanielZhangQD authored Feb 26, 2021
1 parent f37103a commit a629a58
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
4 changes: 0 additions & 4 deletions tests/cmd/stability/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/component-base/logs"
"k8s.io/kubernetes/test/e2e/framework/log"
"k8s.io/utils/pointer"
)

var cfg *tests.Config
Expand Down Expand Up @@ -396,8 +395,6 @@ func newTidbClusterConfig(ns, clusterName string) *tests.TidbClusterConfig {
tidbVersion := cfg.GetTiDBVersionOrDie()
topologyKey := "rack"
tc := fixture.GetTidbCluster(ns, clusterName, tidbVersion)
tc.Spec.PD.StorageClassName = pointer.StringPtr("local-storage")
tc.Spec.TiKV.StorageClassName = pointer.StringPtr("local-storage")
tc.Spec.ConfigUpdateStrategy = v1alpha1.ConfigUpdateStrategyRollingUpdate
return &tests.TidbClusterConfig{
Namespace: ns,
Expand All @@ -407,7 +404,6 @@ func newTidbClusterConfig(ns, clusterName string) *tests.TidbClusterConfig {
TiKVImage: fmt.Sprintf("pingcap/tikv:%s", tidbVersion),
TiDBImage: fmt.Sprintf("pingcap/tidb:%s", tidbVersion),
PumpImage: fmt.Sprintf("pingcap/tidb-binlog:%s", tidbVersion),
StorageClassName: "local-storage",
UserName: "root",
Password: "",
InitSecretName: fmt.Sprintf("%s-set-secret", clusterName),
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func setupSuite() {
// The default storage class of kind is local-path-provisioner which
// consumes local storage like local-volume-provisioner. However, it's not
// stable in our e2e testing.
if framework.TestContext.Provider == "gke" || framework.TestContext.Provider == "aws" || framework.TestContext.Provider == "kind" {
if framework.TestContext.Provider == "gke" || framework.TestContext.Provider == "aws" {
defaultSCName := "local-storage"
list, err := c.StorageV1().StorageClasses().List(metav1.ListOptions{})
framework.ExpectNoError(err, "list storage class failed")
Expand Down
4 changes: 1 addition & 3 deletions tests/e2e/tidbcluster/tidbcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,7 @@ var _ = ginkgo.Describe("TiDBCluster", func() {
SchedulerName: pointer.StringPtr("default-scheduler"),
ConfigUpdateStrategy: &updateStrategy,
},
Replicas: 1,
StorageClassName: pointer.StringPtr("local-storage"),
Replicas: 1,
ResourceRequirements: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceStorage: resource.MustParse("10Gi"),
Expand Down Expand Up @@ -1570,7 +1569,6 @@ func newTidbClusterConfig(cfg *tests.Config, ns, clusterName, password, tcVersio
TiKVImage: fmt.Sprintf("pingcap/tikv:%s", tcVersion),
TiDBImage: fmt.Sprintf("pingcap/tidb:%s", tcVersion),
PumpImage: fmt.Sprintf("pingcap/tidb-binlog:%s", tcVersion),
StorageClassName: "local-storage",
Password: password,
UserName: "root",
InitSecretName: fmt.Sprintf("%s-set-secret", clusterName),
Expand Down
9 changes: 1 addition & 8 deletions tests/pkg/fixture/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,6 @@ func NewTidbMonitor(name, namespace string, tc *v1alpha1.TidbCluster, grafanaEna
}
}
if persist {
storageClassName := "local-storage"
monitor.Spec.StorageClassName = &storageClassName
monitor.Spec.Storage = "2Gi"
monitor.Spec.Persistent = true
}
Expand Down Expand Up @@ -444,9 +442,7 @@ func GetBackupCRDWithS3(tc *v1alpha1.TidbCluster, fromSecretName, brType string,
},
}
if brType == DumperType {
storage := "local-storage"
br.Spec.BR = nil
br.Spec.StorageClassName = &storage
br.Spec.StorageSize = "1Gi"
}
return br
Expand Down Expand Up @@ -481,9 +477,7 @@ func GetRestoreCRDWithS3(tc *v1alpha1.TidbCluster, toSecretName, restoreType str
},
}
if restoreType == DumperType {
storage := "local-storage"
restore.Spec.BR = nil
restore.Spec.StorageClassName = &storage
restore.Spec.StorageSize = "1Gi"
restore.Spec.S3.Path = fmt.Sprintf("s3://%s/%s", s3config.Bucket, s3config.Path)
}
Expand Down Expand Up @@ -524,8 +518,7 @@ func AddPumpForTidbCluster(tc *v1alpha1.TidbCluster) *v1alpha1.TidbCluster {
SchedulerName: pointer.StringPtr("default-scheduler"),
ConfigUpdateStrategy: &tc.Spec.ConfigUpdateStrategy,
},
Replicas: 1,
StorageClassName: pointer.StringPtr("local-storage"),
Replicas: 1,
ResourceRequirements: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceStorage: resource.MustParse("10Gi"),
Expand Down

0 comments on commit a629a58

Please sign in to comment.