Merge pull request #805 from eclipse-che/dashboard_sl
fix: Add common selector for che-dashboardpull/808/head
commit
7444b8c807
|
|
@ -18,7 +18,7 @@ import (
|
|||
|
||||
const (
|
||||
// DashboardComponent which is supposed to be used for the naming related objects
|
||||
DashboardComponent = "dashboard"
|
||||
DashboardComponent = "che-dashboard"
|
||||
)
|
||||
|
||||
type Dashboard struct {
|
||||
|
|
|
|||
|
|
@ -60,21 +60,21 @@ func TestDashboardAll(t *testing.T) {
|
|||
|
||||
// check service
|
||||
service := &corev1.Service{}
|
||||
err = cli.Get(context.TODO(), types.NamespacedName{Name: "dashboard", Namespace: "eclipse-che"}, service)
|
||||
err = cli.Get(context.TODO(), types.NamespacedName{Name: DashboardComponent, Namespace: "eclipse-che"}, service)
|
||||
if err != nil {
|
||||
t.Fatalf("Service not found: %v", err)
|
||||
}
|
||||
|
||||
// check endpoint
|
||||
route := &routev1.Route{}
|
||||
err = cli.Get(context.TODO(), types.NamespacedName{Name: "dashboard", Namespace: "eclipse-che"}, route)
|
||||
err = cli.Get(context.TODO(), types.NamespacedName{Name: DashboardComponent, Namespace: "eclipse-che"}, route)
|
||||
if err != nil {
|
||||
t.Fatalf("Route not found: %v", err)
|
||||
}
|
||||
|
||||
// check deployment
|
||||
deployment := &appsv1.Deployment{}
|
||||
err = cli.Get(context.TODO(), types.NamespacedName{Name: "dashboard", Namespace: "eclipse-che"}, deployment)
|
||||
err = cli.Get(context.TODO(), types.NamespacedName{Name: DashboardComponent, Namespace: "eclipse-che"}, deployment)
|
||||
if err != nil {
|
||||
t.Fatalf("Deployment not found: %v", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@ import (
|
|||
|
||||
func (p *Dashboard) getDashboardDeploymentSpec() (*appsv1.Deployment, error) {
|
||||
terminationGracePeriodSeconds := int64(30)
|
||||
labels := deploy.GetLabels(p.deployContext.CheCluster, DashboardComponent)
|
||||
labels, labelsSelector := deploy.GetLabelsAndSelector(p.deployContext.CheCluster, DashboardComponent)
|
||||
|
||||
dashboardImageAndTag := util.GetValue(p.deployContext.CheCluster.Spec.Server.DashboardImage, deploy.DefaultDashboardImage(p.deployContext.CheCluster))
|
||||
pullPolicy := corev1.PullPolicy(util.GetValue(p.deployContext.CheCluster.Spec.Server.DashboardImagePullPolicy, deploy.DefaultPullPolicyFromDockerImage(dashboardImageAndTag)))
|
||||
|
||||
|
|
@ -39,7 +40,7 @@ func (p *Dashboard) getDashboardDeploymentSpec() (*appsv1.Deployment, error) {
|
|||
Labels: labels,
|
||||
},
|
||||
Spec: appsv1.DeploymentSpec{
|
||||
Selector: &metav1.LabelSelector{MatchLabels: labels},
|
||||
Selector: &metav1.LabelSelector{MatchLabels: labelsSelector},
|
||||
Strategy: appsv1.DeploymentStrategy{
|
||||
Type: appsv1.RollingUpdateDeploymentStrategyType,
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue