-
Notifications
You must be signed in to change notification settings - Fork 500
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
make controller logic independable with certain tidbcluster label #1419
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -447,7 +447,7 @@ func TestPDMemberManagerPdStatefulSetIsUpgrading(t *testing.T) { | |
Name: ordinalPodName(v1alpha1.PDMemberType, tc.GetName(), 0), | ||
Namespace: metav1.NamespaceDefault, | ||
Annotations: map[string]string{}, | ||
Labels: label.New().Instance(tc.GetLabels()[label.InstanceLabelKey]).PD().Labels(), | ||
Labels: label.New().Instance(tc.GetInstanceName()).PD().Labels(), | ||
}, | ||
} | ||
if test.updatePod != nil { | ||
|
@@ -849,7 +849,7 @@ func TestGetNewPDHeadlessServiceForTidbCluster(t *testing.T) { | |
Labels: map[string]string{ | ||
"app.kubernetes.io/name": "tidb-cluster", | ||
"app.kubernetes.io/managed-by": "tidb-operator", | ||
"app.kubernetes.io/instance": "", | ||
"app.kubernetes.io/instance": "foo", | ||
"app.kubernetes.io/component": "pd", | ||
}, | ||
OwnerReferences: []metav1.OwnerReference{ | ||
|
@@ -880,7 +880,7 @@ func TestGetNewPDHeadlessServiceForTidbCluster(t *testing.T) { | |
Selector: map[string]string{ | ||
"app.kubernetes.io/name": "tidb-cluster", | ||
"app.kubernetes.io/managed-by": "tidb-operator", | ||
"app.kubernetes.io/instance": "", | ||
"app.kubernetes.io/instance": "foo", | ||
"app.kubernetes.io/component": "pd", | ||
}, | ||
PublishNotReadyAddresses: true, | ||
|
@@ -1088,7 +1088,7 @@ func TestGetPDConfigMap(t *testing.T) { | |
Labels: map[string]string{ | ||
"app.kubernetes.io/name": "tidb-cluster", | ||
"app.kubernetes.io/managed-by": "tidb-operator", | ||
"app.kubernetes.io/instance": "", | ||
"app.kubernetes.io/instance": "foo", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use const vars in label package to replace these keys? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think both make sense, by not using the const var, the correctness of the |
||
"app.kubernetes.io/component": "pd", | ||
}, | ||
OwnerReferences: []metav1.OwnerReference{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -548,7 +548,7 @@ func TestGetNewPumpHeadlessService(t *testing.T) { | |
Labels: map[string]string{ | ||
"app.kubernetes.io/name": "tidb-cluster", | ||
"app.kubernetes.io/managed-by": "tidb-operator", | ||
"app.kubernetes.io/instance": "", | ||
"app.kubernetes.io/instance": "foo", | ||
"app.kubernetes.io/component": "pump", | ||
}, | ||
OwnerReferences: []metav1.OwnerReference{ | ||
|
@@ -579,7 +579,7 @@ func TestGetNewPumpHeadlessService(t *testing.T) { | |
Selector: map[string]string{ | ||
"app.kubernetes.io/name": "tidb-cluster", | ||
"app.kubernetes.io/managed-by": "tidb-operator", | ||
"app.kubernetes.io/instance": "", | ||
"app.kubernetes.io/instance": "foo", | ||
"app.kubernetes.io/component": "pump", | ||
}, | ||
PublishNotReadyAddresses: true, | ||
|
@@ -627,7 +627,7 @@ func TestGetNewPumpConfigMap(t *testing.T) { | |
Labels: map[string]string{ | ||
"app.kubernetes.io/name": "tidb-cluster", | ||
"app.kubernetes.io/managed-by": "tidb-operator", | ||
"app.kubernetes.io/instance": "", | ||
"app.kubernetes.io/instance": "foo", | ||
"app.kubernetes.io/component": "pump", | ||
}, | ||
OwnerReferences: []metav1.OwnerReference{ | ||
|
@@ -676,7 +676,7 @@ func TestGetNewPumpConfigMap(t *testing.T) { | |
Labels: map[string]string{ | ||
"app.kubernetes.io/name": "tidb-cluster", | ||
"app.kubernetes.io/managed-by": "tidb-operator", | ||
"app.kubernetes.io/instance": "", | ||
"app.kubernetes.io/instance": "foo", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
"app.kubernetes.io/component": "pump", | ||
}, | ||
OwnerReferences: []metav1.OwnerReference{ | ||
|
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.
Alternatively, we could define a
GetLabels()
method and shadow the one ofObjectMeta
so that the controller logic don't have to be modified, but that way we have to copy a map every time this method get called.