Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for docker plugins #24

Closed
innovate-invent opened this issue Dec 9, 2020 · 3 comments · Fixed by #35
Closed

Add support for docker plugins #24

innovate-invent opened this issue Dec 9, 2020 · 3 comments · Fixed by #35
Assignees
Labels
enhancement New feature or request r/plugin
Milestone

Comments

@innovate-invent
Copy link
Contributor

innovate-invent commented Dec 9, 2020

Terraform Version

0.13.5
Affected Resource(s)

docker_plugin
Expected Behavior

Configure and manage docker plugins on a daemon
Actual Behavior

Not implemented
References

@suzuki-shunsuke suzuki-shunsuke added the enhancement New feature or request label Dec 21, 2020
@suzuki-shunsuke
Copy link
Collaborator

WIP: #35

@suzuki-shunsuke
Copy link
Collaborator

suzuki-shunsuke commented Dec 22, 2020

@innovate-invent

I haven't used Docker plugin, so would you show us the example of Terraform Configuration which you expect?

For example,

resource "docker_plugin" "sample-volume-plugin" {
  name  = "tiborvass/sample-volume-plugin:latest"
  # other attributes
  # ...
}

@innovate-invent
Copy link
Contributor Author

I would expect the interface to emulate the docker plugin install command

resource "docker_plugin" "sample-volume-plugin" {
  name  = "tiborvass/sample-volume-plugin:latest"
  alias = "plugin"
  disabled = false
  disable_content_trust = false
  grant_all_permissions = true  # conflicts with the next three options
  network_permissions = ["host"]
  device_permissions = ["/dev/fuse"]
  capabilities = ["CAP_SYS_ADMIN"]
  options = {
    key=value
    ...
  }
}

The resource should have attributes that include the values that would be returned by docker plugin inspect. You will also want to create a data source resource that also returns the values of docker inspect. Additionally you should produce a data source that returns a list similar to docker plugin ls with plugin ids as returned by the api. The inspect data source can then be used to request the details of the listed plugins.

If the docker API supports additional parameters it would be good to forward those too.

One thing you might want to consider is to create the same pattern that is used by the docker_image/docker_container interplay where a resource monitors and updates the plugin image while the other maintains the plugin deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request r/plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants