Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit ed67111

Browse files
authored
Merge pull request #1155 from docker/remove_example_backend
2 parents 6504a9b + aca816d commit ed67111

22 files changed

+83
-360
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,11 @@ jobs:
6565

6666
- name: Test
6767
env:
68-
BUILD_TAGS: example
6968
run: make -f builder.Makefile test
7069

7170
- name: Build for local E2E
7271
env:
73-
BUILD_TAGS: example,e2e
72+
BUILD_TAGS: e2e
7473
run: make -f builder.Makefile cli
7574

7675
- name: E2E Test

.github/workflows/windows-ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,11 @@ jobs:
4848
key: go-${{ hashFiles('**/go.sum') }}
4949

5050
- name: Test
51-
env:
52-
BUILD_TAGS: example,local
5351
run: make -f builder.Makefile test
5452

5553
- name: Build
5654
env:
57-
BUILD_TAGS: example,local,e2e
55+
BUILD_TAGS: e2e
5856
run: make -f builder.Makefile cli
5957

6058
- name: E2E Test

BUILDING.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,6 @@ This will create a symbolic link from the existing Docker CLI to
3535
You can statically cross compile the CLI for Windows, macOS, and Linux using the
3636
`cross` target.
3737

38-
### Building with specific backends
39-
40-
You can specify which backends are build using the `BUILD_TAGS` variable.
41-
The available backends are:
42-
* `aci`: For ACI support (always built)
43-
* `ecs`: For ECS support (always built)
44-
* `example`: Testing backend (off by default)
45-
* `local`: Beginnings of a [moby](https://github.com/moby/moby) backend
46-
(off by default)
47-
48-
If you want the ACI, ECS and example backends, then you can build as follows:
49-
50-
```console
51-
make BUILD_TAGS=example cli
52-
```
53-
5438
### Updating the API code
5539

5640
The API provided by the CLI is defined using protobuf. If you make changes to

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protos: ## Generate go code from .proto files
3939
cli: ## Compile the cli
4040
@docker build . --target cli \
4141
--platform local \
42-
--build-arg BUILD_TAGS=example,e2e \
42+
--build-arg BUILD_TAGS=e2e \
4343
--build-arg GIT_TAG=$(GIT_TAG) \
4444
--output ./bin
4545

@@ -63,7 +63,6 @@ cross: ## Compile the CLI for linux, darwin and windows
6363

6464
test: ## Run unit tests
6565
@docker build . \
66-
--build-arg BUILD_TAGS=example \
6766
--build-arg GIT_TAG=$(GIT_TAG) \
6867
--target test
6968

@@ -72,7 +71,7 @@ cache-clear: ## Clear the builder cache
7271

7372
lint: ## run linter(s)
7473
@docker build . \
75-
--build-arg BUILD_TAGS=example,e2e \
74+
--build-arg BUILD_TAGS=e2e \
7675
--build-arg GIT_TAG=$(GIT_TAG) \
7776
--target lint
7877

api/context/store/contextmetadata.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ type AwsContext EcsContext
6161
// LocalContext is the context for the local backend
6262
type LocalContext struct{}
6363

64-
// ExampleContext is the context for the example backend
65-
type ExampleContext struct{}
66-
6764
// MarshalJSON implements custom JSON marshalling
6865
func (dc ContextMetadata) MarshalJSON() ([]byte, error) {
6966
s := map[string]interface{}{}

api/context/store/store.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ const (
5555
// LocalContextType is the endpoint key in the context endpoints for a new
5656
// local backend
5757
LocalContextType = "local"
58-
// ExampleContextType is the endpoint key in the context endpoints for an
59-
// example backend
60-
ExampleContextType = "example"
6158
)
6259

6360
const (
@@ -331,8 +328,5 @@ func getters() map[string]func() interface{} {
331328
LocalContextType: func() interface{} {
332329
return &LocalContext{}
333330
},
334-
ExampleContextType: func() interface{} {
335-
return &ExampleContext{}
336-
},
337331
}
338332
}

api/context/store/store_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ func TestGetEndpoint(t *testing.T) {
6464
assert.NilError(t, err)
6565
assert.Equal(t, ctx.Location, "eu")
6666

67-
var exampleCtx ExampleContext
68-
err = s.GetEndpoint("aci", &exampleCtx)
67+
var localCtx LocalContext
68+
err = s.GetEndpoint("aci", &localCtx)
6969
assert.Error(t, err, "wrong context type")
7070
}
7171

cli/cmd/context/create.go

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func createCommand() *cobra.Command {
3939

4040
longHelp := fmt.Sprintf(`Create a new context
4141
42-
Create docker engine context:
42+
Create docker engine context:
4343
$ docker context create CONTEXT [flags]
4444
4545
%s
@@ -78,7 +78,6 @@ $ docker context create my-context --description "some description" --docker "ho
7878

7979
cmd.AddCommand(
8080
createLocalCommand(),
81-
createExampleCommand(),
8281
)
8382
for _, command := range extraCommands {
8483
cmd.AddCommand(command())
@@ -111,22 +110,6 @@ func createLocalCommand() *cobra.Command {
111110
return cmd
112111
}
113112

114-
func createExampleCommand() *cobra.Command {
115-
var opts descriptionCreateOpts
116-
cmd := &cobra.Command{
117-
Use: "example CONTEXT",
118-
Short: "Create a test context returning fixed output",
119-
Args: cobra.ExactArgs(1),
120-
Hidden: true,
121-
RunE: func(cmd *cobra.Command, args []string) error {
122-
return createDockerContext(cmd.Context(), args[0], store.ExampleContextType, opts.description, store.ExampleContext{})
123-
},
124-
}
125-
126-
addDescriptionFlag(cmd, &opts.description)
127-
return cmd
128-
}
129-
130113
func createDockerContext(ctx context.Context, name string, contextType string, description string, data interface{}) error {
131114
s := store.ContextStore(ctx)
132115
result := s.Create(

cli/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ import (
5151
_ "github.com/docker/compose-cli/aci"
5252
_ "github.com/docker/compose-cli/ecs"
5353
_ "github.com/docker/compose-cli/ecs/local"
54-
_ "github.com/docker/compose-cli/example"
5554
_ "github.com/docker/compose-cli/local"
5655
)
5756

docs/architecture.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ These constraints resulted in the following architecture:
2020
What follows is a list of useful links to help navigate the code:
2121
* The CLI UX code is in [`cli/`](../cli)
2222
* The backend interface is defined in [`backend/`](../backend)
23-
* An example backend can be found in [`example/`](../example)
2423
* The API is defined by protobufs that can be found in [`protos/`](../protos)
2524
* The API server is in [`server/`](../server)
2625
* The context management and interface can be found in [`context/`](../api/context)

0 commit comments

Comments
 (0)