Skip to content

Commit

Permalink
Revert explicit check on type to recreate when type changes
Browse files Browse the repository at this point in the history
  • Loading branch information
thbkrkr committed Oct 29, 2024
1 parent 0d3a897 commit d38519e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
5 changes: 0 additions & 5 deletions pkg/controller/common/service_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ func needsUpdate(expected *corev1.Service, reconciled *corev1.Service) bool {

// applyServerSideValues applies any default that may have been set from the reconciled version.
func applyServerSideValues(expected, reconciled *corev1.Service) {
// shortcut if the service type has changed
if expected.Spec.Type != reconciled.Spec.Type {
return
}

// Type may be defaulted by the api server
if expected.Spec.Type == "" {
expected.Spec.Type = reconciled.Spec.Type
Expand Down
12 changes: 0 additions & 12 deletions pkg/controller/common/service_control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,18 +275,6 @@ func Test_needsRecreate(t *testing.T) {
},
want: true,
},
{
name: "Needs recreate to go from LoadBalancer type to ClusterIP",
args: args{
expected: corev1.Service{Spec: corev1.ServiceSpec{
Type: corev1.ServiceTypeClusterIP,
}},
reconciled: corev1.Service{Spec: corev1.ServiceSpec{
Type: corev1.ServiceTypeLoadBalancer,
}},
},
want: true,
},
{
name: "Removing the load balancer class is OK if target type is no longer LoadBalancer",
args: args{
Expand Down

0 comments on commit d38519e

Please sign in to comment.