-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unit tests for hostnetwork and run e2e test conditionally #1093
Conversation
/run-e2e-test |
@@ -426,7 +426,7 @@ func (pmm *pdMemberManager) pdStatefulSetIsUpgrading(set *apps.StatefulSet, tc * | |||
return false, nil | |||
} | |||
|
|||
func (pmm *pdMemberManager) getNewPDSetForTidbCluster(tc *v1alpha1.TidbCluster) (*apps.StatefulSet, error) { | |||
func getNewPDSetForTidbCluster(tc *v1alpha1.TidbCluster) (*apps.StatefulSet, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function receiver is removed because not needed
@@ -219,7 +219,7 @@ func getNewTiDBHeadlessServiceForTidbCluster(tc *v1alpha1.TidbCluster) *corev1.S | |||
} | |||
} | |||
|
|||
func (tmm *tidbMemberManager) getNewTiDBSetForTidbCluster(tc *v1alpha1.TidbCluster) *apps.StatefulSet { | |||
func getNewTiDBSetForTidbCluster(tc *v1alpha1.TidbCluster) *apps.StatefulSet { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function receiver is removed because not needed
@@ -269,7 +269,7 @@ func getNewServiceForTidbCluster(tc *v1alpha1.TidbCluster, svcConfig SvcConfig) | |||
return &svc | |||
} | |||
|
|||
func (tkmm *tikvMemberManager) getNewSetForTidbCluster(tc *v1alpha1.TidbCluster) (*apps.StatefulSet, error) { | |||
func getNewTiKVSetForTidbCluster(tc *v1alpha1.TidbCluster) (*apps.StatefulSet, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function receiver is removed because not needed, easier to test
/run-e2e-test |
(sv.AtLeast(utilversion.MustParseSemantic("v1.15.0")) && sv.LessThan(utilversion.MustParseSemantic("v1.15.4"))) { // >= v1.15.0 but < v1.15.4 | ||
// https://github.com/pingcap/tidb-operator/issues/1042#issuecomment-547742565 | ||
glog.Infof("Skipping HostNetwork test. Kubernetes %v has a bug that StatefulSet may apply revision incorrectly, HostNetwork cannot work well in this cluster", serverVersion) | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example log:
[2019-11-01T03:35:11.775Z] I1101 03:35:09.611526 1 main.go:181] ServerVersion: v1.12.10
[2019-11-01T03:35:11.775Z] I1101 03:35:09.611549 1 main.go:186] Skipping HostNetwork test. Kubernetes v1.12.10 has a bug that StatefulSet may apply revision incorrectly, HostNetwork cannot work well in this cluster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -172,6 +173,20 @@ func main() { | |||
* Note that only one cluster can run in host network mode at the same time. | |||
*/ | |||
testHostNetwork := func(wg *sync.WaitGroup, cluster *tests.TidbClusterConfig) { | |||
serverVersion, err := kubeCli.Discovery().ServerVersion() | |||
if err != nil { | |||
panic(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exit if the cluster is unavailable or unstable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What problem does this PR solve?
fixes #1042
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
Does this PR introduce a user-facing change?: