Skip to content

Commit 53f73f4

Browse files
ndeloofglours
authored andcommitted
prefer provider over external to avoid confusion
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent e705dd3 commit 53f73f4

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

loader/loader_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3761,18 +3761,18 @@ services:
37613761
assert.Equal(t, *p.Services["test"].Secrets[0].Mode, types.FileMode(0o440))
37623762
}
37633763

3764-
func TestExternalService(t *testing.T) {
3764+
func TestServiceProvider(t *testing.T) {
37653765
p, err := loadYAML(`
3766-
name: external-service
3766+
name: service-provider
37673767
services:
37683768
test:
3769-
external:
3769+
provider:
37703770
type: foo
37713771
options:
37723772
bar: zot
37733773
`)
37743774
assert.NilError(t, err)
3775-
assert.DeepEqual(t, p.Services["test"].External, &types.ExternalServiceConfig{
3775+
assert.DeepEqual(t, p.Services["test"].Provider, &types.ServiceProviderConfig{
37763776
Type: "foo",
37773777
Options: map[string]string{"bar": "zot"},
37783778
})

loader/validate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
// checkConsistency validate a compose model is consistent
3030
func checkConsistency(project *types.Project) error { //nolint:gocyclo
3131
for name, s := range project.Services {
32-
if s.Build == nil && s.Image == "" && s.External == nil {
32+
if s.Build == nil && s.Image == "" && s.Provider == nil {
3333
return fmt.Errorf("service %q has neither an image nor a build context specified: %w", s.Name, errdefs.ErrInvalid)
3434
}
3535

schema/compose-spec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@
259259
}
260260
]
261261
},
262-
"external": {
262+
"provider": {
263263
"type": "object",
264264
"properties": {
265265
"type": {"type": "string"},

types/derived.gen.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

types/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ type ServiceConfig struct {
7676
//
7777
// Set to `[]` or an empty string to clear the entrypoint from the image.
7878
Entrypoint ShellCommand `yaml:"entrypoint,omitempty" json:"entrypoint"` // NOTE: we can NOT omitempty for JSON! see ShellCommand type for details.
79-
External *ExternalServiceConfig `yaml:"external,omitempty" json:"external,omitempty"`
79+
Provider *ServiceProviderConfig `yaml:"provider,omitempty" json:"provider,omitempty"`
8080
Environment MappingWithEquals `yaml:"environment,omitempty" json:"environment,omitempty"`
8181
EnvFiles []EnvFile `yaml:"env_file,omitempty" json:"env_file,omitempty"`
8282
Expose StringOrNumberList `yaml:"expose,omitempty" json:"expose,omitempty"`
@@ -142,7 +142,7 @@ type ServiceConfig struct {
142142
Extensions Extensions `yaml:"#extensions,inline,omitempty" json:"-"`
143143
}
144144

145-
type ExternalServiceConfig struct {
145+
type ServiceProviderConfig struct {
146146
Type string `yaml:"type,omitempty" json:"driver,omitempty"`
147147
Options Options `yaml:"options,omitempty" json:"options,omitempty"`
148148
Extensions Extensions `yaml:"#extensions,inline,omitempty" json:"-"`

0 commit comments

Comments
 (0)