Skip to content

Commit 0f6b26f

Browse files
authored
Use Headless Services by default (#523)
This fixes a regression, because in ODH the Services had been headless for Raw deployment mode (see #288). Such default changed to headed services when the feasibility to configure the behavior was introduced, but despite the upstream project has always been using headed services, in ODH this breaks backwards compatibility. Thus, this restores the ODH default of using headless services for Raw deployment. Users can still use the inferenceservice-config ConfigMap to switch to headed Services. Signed-off-by: Edgar Hernández <[email protected]>
1 parent e29e4eb commit 0f6b26f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pkg/apis/serving/v1beta1/configmap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ func NewServiceConfig(clientset kubernetes.Interface) (*ServiceConfig, error) {
280280
if err != nil {
281281
return nil, err
282282
}
283-
serviceConfig := &ServiceConfig{}
283+
serviceConfig := &ServiceConfig{ServiceClusterIPNone: true}
284284
if service, ok := configMap.Data[ServiceConfigName]; ok {
285285
err := json.Unmarshal([]byte(service), &serviceConfig)
286286
if err != nil {

pkg/apis/serving/v1beta1/configmap_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var (
4848
AdditionalDomain, AdditionalDomainExtra)
4949
ServiceConfigData = fmt.Sprintf(`{
5050
"serviceClusterIPNone" : %t
51-
}`, true)
51+
}`, false)
5252

5353
ISCVWithData = fmt.Sprintf(`{
5454
"serviceAnnotationDisallowedList": ["%s","%s"],
@@ -134,6 +134,7 @@ func TestNewServiceConfig(t *testing.T) {
134134
emp, err := NewServiceConfig(empty)
135135
g.Expect(err).Should(gomega.BeNil())
136136
g.Expect(emp).ShouldNot(gomega.BeNil())
137+
g.Expect(emp.ServiceClusterIPNone).Should(gomega.BeTrue()) // In ODH the default is <true>
137138

138139
// with value
139140
withTrue := fakeclientset.NewSimpleClientset(&v1.ConfigMap{
@@ -145,7 +146,7 @@ func TestNewServiceConfig(t *testing.T) {
145146
wt, err := NewServiceConfig(withTrue)
146147
g.Expect(err).Should(gomega.BeNil())
147148
g.Expect(wt).ShouldNot(gomega.BeNil())
148-
g.Expect(wt.ServiceClusterIPNone).Should(gomega.BeTrue())
149+
g.Expect(wt.ServiceClusterIPNone).Should(gomega.BeFalse())
149150

150151
// no value, should be nil
151152
noValue := fakeclientset.NewSimpleClientset(&v1.ConfigMap{
@@ -157,7 +158,7 @@ func TestNewServiceConfig(t *testing.T) {
157158
nv, err := NewServiceConfig(noValue)
158159
g.Expect(err).Should(gomega.BeNil())
159160
g.Expect(nv).ShouldNot(gomega.BeNil())
160-
g.Expect(nv.ServiceClusterIPNone).Should(gomega.BeFalse())
161+
g.Expect(nv.ServiceClusterIPNone).Should(gomega.BeTrue()) // In ODH the default is <true>
161162
}
162163

163164
func TestInferenceServiceDisallowedLists(t *testing.T) {

0 commit comments

Comments
 (0)