Commit Graph

36 Commits

Author SHA1 Message Date
Martin Atkins 8364383c35 Push plugin discovery down into command package
Previously we did plugin discovery in the main package, but as we move
towards versioned plugins we need more information available in order to
resolve plugins, so we move this responsibility into the command package
itself.

For the moment this is just preserving the existing behavior as long as
there are only internal and unversioned plugins present. This is the
final state for provisioners in 0.10, since we don't want to support
versioned provisioners yet. For providers this is just a checkpoint along
the way, since further work is required to apply version constraints from
configuration and support additional plugin search directories.

The automatic plugin discovery behavior is not desirable for tests because
we want to mock the plugins there, so we add a new backdoor for the tests
to use to skip the plugin discovery and just provide their own mock
implementations. Most of this diff is thus noisy rework of the tests to
use this new mechanism.
2017-06-09 14:03:59 -07:00
Mitchell Hashimoto 41a4235eb3
terraformrc can contain env var references
This allows the use case where installation of a plugin can simply say
to add `$GOPATH/bin/foo` to your terraformrc and the user can do that
verbatim. Additionally terraformrc files become portable for certain
environments which are self-contained.

I was hesitant at first about this because it diverges the syntax a bit
from our standard interpolation syntax. However, due to the special
nature of terraformrc and the strong use cases cited I'm okay with this.
2017-02-13 17:52:51 -08:00
Justin Nauman bf48d0132c Checkpoint signature fixes
- Currently the disable_checkpoint setting from $HOME/.terraformrc is never
respsected due to:
-- The runCheckpoint go routine being fired off prior to loading configuration
-- The config.Merge method not actually merging in the c2s settings
2016-11-17 17:54:14 -06:00
James Nugent a0a59d3fb7 core: Log local overrides as INFO rather than WARN
A user has at some point explicitly specified in .terraformrc that
overriding should take place (unlike PATH based overrides), so this
should log as INFO rather than WARN.

It is still of value for debugging purposes, however!
2016-09-14 09:19:03 +01:00
Jonty Wareing e0c068f09d Warn when plugins are locally overridden
It is currently very easy to miss that a provider/provisioner has a
local override in your .terraformrc, leading to unexpected behaviour
that can be difficult to debug as no information is output about the
overrides.
2016-09-13 13:05:37 +01:00
Chris Bednarski 8d50238f7a Added TF_PLUGIN_DEV to silence internal plugin warnings 2016-05-27 11:49:09 -07:00
Chris Bednarski 9d6326545a Hide plugin discovery log message when we are running a plugin 2016-05-27 10:51:23 -07:00
Chris Bednarski 3c774af9c2 Warn when an internal plugin is overridden
Also added documentation explaining what happened and how to fix it
2016-05-10 14:49:13 -04:00
Chris Bednarski 6360e6c8b6 Implemented internal plugin calls; which allows us to compile plugins into the main terraform binary 2016-05-10 14:40:11 -04:00
Mitchell Hashimoto 84214437b3 Use hashicorp/go-plugin for plugin system
This replaces this plugin system with the extracted hashicorp/go-plugin
library.

This doesn't introduce any new features such as binary flattening but
opens us up to that a lot more easily and removes a lot of code from TF
in favor of the upstream lib.

This will introduce a protocol change that will cause all existing
plugins to have to be recompiled to work properly. There is no actual
API changes so they just have to recompile, but it is technically
backwards incompatible.
2016-05-10 14:14:47 -04:00
Mitchell Hashimoto c2fdb7171e use upstream osext, which fixes some bugs 2015-10-17 17:33:45 -07:00
Jeff Mitchell f7512ca29f Initial commit. This adds the initial bits of a Docker provider.
Docker's API is huge and only a small subset is currently implemented,
but this is expected to grow over time. Currently it's enough to
satisfy the use cases of probably 95% of Docker users.

I'm preparing this initial pull request as a preview step for feedback.
My ideal scenario would be to develop this within a branch in the main
repository; the more eyes and testing and pitching in on the code, the
better (this would avoid a merge request-to-the-merge-request scenario,
as I figure this will be built up over the longer term, even before
a merge into master).

Unit tests do not exist yet. Right now I've just been focused on getting
initial functionality ported over. I've been testing each option
extensively via the Docker inspect capabilities.

This code (C)2014-2015 Akamai Technologies, Inc. <opensource@akamai.com>
2015-03-10 15:38:52 +00:00
Mitchell Hashimoto 70191d22a6 Add checkpoint 2014-10-13 14:05:43 -07:00
Mitchell Hashimoto 1e3dbee278 main: use new RPC mechanisms 2014-09-28 11:40:15 -07:00
Mitchell Hashimoto 2e39b8eaf3 config looks in a plugin directory if it exists 2014-09-27 12:36:13 -07:00
Mitchell Hashimoto eabd8b1cc5 Fix CWD plugin loading. 2014-09-25 22:39:46 -07:00
Mitchell Hashimoto 4fd3dff829 main: auto-discover plugins [GH-190]
/cc @pearkes @armon - exe dir and pwd
2014-08-28 17:27:15 -07:00
Mitchell Hashimoto bec5a2a9c5 main: look up executables locally before PATH [GH-157] 2014-08-27 20:46:50 -07:00
Mitchell Hashimoto efaedbabb0 fmt 2014-08-20 22:24:35 -07:00
Mitchell Hashimoto 2e2f6bf0f4 main: clean up the code surrounding config file loading 2014-08-19 10:58:23 -07:00
Mitchell Hashimoto 04975827ac Remove all traces of libucl 2014-08-19 09:57:04 -07:00
Armon Dadgar 61841467c4 provider/consul: Skeleton 2014-07-25 17:03:17 -04:00
Mitchell Hashimoto f82b0552e0 DRY up the config.go 2014-07-24 07:30:26 -07:00
Jack Pearkes d8c83a1a95 providers/dnsimple: init commit 2014-07-23 17:43:49 -04:00
Mitchell Hashimoto fa175113fe config: case sensitive templates 2014-07-23 08:38:43 -07:00
Jack Pearkes e81b3998ce heroku: initial commit 2014-07-23 00:03:30 -04:00
Jack Pearkes 4455a6120c providers/digitalocean: initial commit 2014-07-18 20:20:28 -04:00
Armon Dadgar a9cad200d8 provisioner/file: Skeleton files 2014-07-16 10:33:44 -07:00
Armon Dadgar 6381fbd226 provisioner/remote-exec: Adding initial skeleton 2014-07-15 12:34:06 -07:00
Armon Dadgar 1c4321a503 Setup provisioners for CLI 2014-07-10 11:38:57 -07:00
Mitchell Hashimoto 0e88867052 Compile 2014-07-03 12:01:20 -07:00
Mitchell Hashimoto a6ae7230d1 command: use new API 2014-07-03 11:46:40 -07:00
Mitchell Hashimoto 582229969e main: instantiate the config and set it up 2014-06-09 21:57:37 -07:00
Mitchell Hashimoto 61f4684931 Create resource provider factories and cleanup clients in main 2014-06-09 21:44:13 -07:00
Mitchell Hashimoto 6c6bc0ae3e commands/diff: starting up, got it loading a Terraform 2014-06-09 11:53:41 -07:00
Mitchell Hashimoto 5d40725139 main: add main config 2014-05-25 17:39:44 -07:00