Skip to content

Commit

Permalink
[installer]: remove the custom labels from the selector labels
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Emms committed Aug 8, 2022
1 parent 3c23517 commit 48f229b
Show file tree
Hide file tree
Showing 18 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion install/installer/pkg/components/agent-smith/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func daemonset(ctx *common.RenderContext) ([]runtime.Object, error) {
}),
},
Spec: appsv1.DaemonSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels},
Selector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Name: Component,
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/blobserve/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaDeployment),
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels},
Selector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
Replicas: common.Replicas(ctx, Component),
Strategy: common.DeploymentStrategy,
Template: corev1.PodTemplateSpec{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaDeployment),
},
Spec: v1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels},
Selector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
Replicas: common.Replicas(ctx, Component),
Strategy: common.DeploymentStrategy,
Template: corev1.PodTemplateSpec{
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/dashboard/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaDeployment),
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels},
Selector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
Replicas: common.Replicas(ctx, Component),
Strategy: common.DeploymentStrategy,
Template: corev1.PodTemplateSpec{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
MaxSurge: &intstr.IntOrString{IntVal: 1},
},
},
Selector: &metav1.LabelSelector{MatchLabels: labels},
Selector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
Replicas: common.Replicas(ctx, Component),
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/ide-metrics/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaDeployment),
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels},
Selector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
Replicas: common.Replicas(ctx, Component),
Strategy: common.DeploymentStrategy,
Template: corev1.PodTemplateSpec{
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/ide-proxy/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaDeployment),
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels},
Selector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
Replicas: common.Replicas(ctx, Component),
Strategy: common.DeploymentStrategy,
Template: corev1.PodTemplateSpec{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaDeployment),
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels},
Selector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
Replicas: common.Replicas(ctx, Component),
Strategy: common.DeploymentStrategy,
Template: corev1.PodTemplateSpec{
Expand Down
4 changes: 2 additions & 2 deletions install/installer/pkg/components/openvsx-proxy/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func statefulset(ctx *common.RenderContext) ([]runtime.Object, error) {
},
Spec: appsv1.StatefulSetSpec{
Selector: &metav1.LabelSelector{
MatchLabels: labels,
MatchLabels: common.DefaultLabels(Component),
},
ServiceName: Component,
// todo(sje): receive config value
Expand Down Expand Up @@ -139,7 +139,7 @@ func statefulset(ctx *common.RenderContext) ([]runtime.Object, error) {
VolumeClaimTemplates: []v1.PersistentVolumeClaim{{
ObjectMeta: metav1.ObjectMeta{
Name: "redis-data",
Labels: labels,
Labels: common.DefaultLabels(Component),
},
Spec: v1.PersistentVolumeClaimSpec{
AccessModes: []v1.PersistentVolumeAccessMode{
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/proxy/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaDeployment),
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels},
Selector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
Replicas: common.Replicas(ctx, Component),
Strategy: common.DeploymentStrategy,
Template: corev1.PodTemplateSpec{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
}),
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels},
Selector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
Replicas: common.Replicas(ctx, Component),
Strategy: common.DeploymentStrategy,
Template: corev1.PodTemplateSpec{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func daemonset(ctx *common.RenderContext) ([]runtime.Object, error) {
Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaDaemonset),
},
Spec: appsv1.DaemonSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels},
Selector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Name: Component,
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/server/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaDeployment),
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels},
Selector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
Replicas: common.Replicas(ctx, Component),
Strategy: common.DeploymentStrategy,
Template: corev1.PodTemplateSpec{
Expand Down
3 changes: 2 additions & 1 deletion install/installer/pkg/components/usage/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package usage

import (
"fmt"

"github.com/gitpod-io/gitpod/common-go/baseserver"
"github.com/gitpod-io/gitpod/installer/pkg/cluster"
"github.com/gitpod-io/gitpod/installer/pkg/common"
Expand Down Expand Up @@ -72,7 +73,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaDeployment),
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels},
Selector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
Replicas: common.Replicas(ctx, Component),
Strategy: common.DeploymentStrategy,
Template: corev1.PodTemplateSpec{
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/ws-daemon/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ fi
Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaDaemonset),
},
Spec: appsv1.DaemonSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels},
Selector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: labels,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaDeployment),
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels},
Selector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
Replicas: common.Replicas(ctx, Component),
Strategy: common.DeploymentStrategy,
Template: corev1.PodTemplateSpec{
Expand Down
2 changes: 1 addition & 1 deletion install/installer/pkg/components/ws-manager/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaDeployment),
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels},
Selector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
Replicas: common.Replicas(ctx, Component),
Strategy: common.DeploymentStrategy,
Template: corev1.PodTemplateSpec{
Expand Down
4 changes: 2 additions & 2 deletions install/installer/pkg/components/ws-proxy/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
Affinity: common.NodeAffinity(cluster.AffinityLabelWorkspaceServices),
TopologySpreadConstraints: []corev1.TopologySpreadConstraint{
corev1.TopologySpreadConstraint{
LabelSelector: &metav1.LabelSelector{MatchLabels: labels},
LabelSelector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
MaxSkew: 1,
TopologyKey: "kubernetes.io/hostname",
WhenUnsatisfiable: corev1.DoNotSchedule,
Expand Down Expand Up @@ -177,7 +177,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaDeployment),
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels},
Selector: &metav1.LabelSelector{MatchLabels: common.DefaultLabels(Component)},
Replicas: common.Replicas(ctx, Component),
Strategy: common.DeploymentStrategy,
Template: corev1.PodTemplateSpec{
Expand Down

0 comments on commit 48f229b

Please sign in to comment.