Commit Graph

559 Commits

Author SHA1 Message Date
Adrien Delorme 87ba7258b3
Use packer-sdc in packer + remove mapstructure-to-hcl2 & struct-markdown (#10913)
* start using `go:generate packer-sdc struct-markdown`

* Update Makefile

remove @go install ./cmd/struct-markdown

* run go generate for struct-markdown

* use //go:generate packer-sdc mapstructure-to-hcl2

* run go generate for mapstructure-to-hcl2

* remove struct-markdown and mapstructure-to-hcl2

* vendor vendors
2021-04-16 11:52:03 +02:00
sylviamoss e0614cabf4 move acctest pkg from sdk to core and update acceptance tests 2021-04-07 11:52:19 +02:00
Qingchuan Hao f2f33fa344
Correct SIG timout (#10816) 2021-04-07 10:00:17 +02:00
Brian Farrell 80f807de4d
Fix issue with test breaking default value when client_cert_token_timeout is missing (#10783) 2021-03-19 15:17:41 +01:00
Ace Eldeib 3227d3da43
clean up azure temporary managed os disk (#10713)
* clean up temporary managed os disk

* improve message for skipping disk deletion

Co-authored-by: Wilken Rivera <dev@wilkenrivera.com>

* re-arrange osdisk/additional disk cleanup

Co-authored-by: Wilken Rivera <dev@wilkenrivera.com>

* remove additional disk cleanup

* add some validation on scenarios

* alway clean up resources inside template cleanup

* tidy to master

* clarify naming and comments

Co-authored-by: Wilken Rivera <dev@wilkenrivera.com>

* test: add acceptance testing for azure cleanup

* revert template changes

* fix err check

* delete resources in parallel with retry to avoid serial deletion

* nit: improve log message for transient deletion errors

* fix: typo

* remove unused func to make lint happy

Co-authored-by: Wilken Rivera <dev@wilkenrivera.com>
2021-03-18 12:09:57 -04:00
Brian Farrell 273a720440
Add client_cert_token_timeout to address GH-9465 (#10528) 2021-03-02 11:51:18 +01:00
Taylor Chaparro 317e2da000
azure client sig fix: don't overwrite subscription id if unset (#10659) 2021-02-19 11:16:31 +01:00
Megan Marsh 1cb9aea752 change markdown references to new pathing 2021-01-15 11:59:36 -08:00
Wilken Rivera 04dbbe2d8e Fix broken links detected by link checker
- Fix broken example links
- Fix broken provisioner links
- Ignore linode.com because of DDOS protection settings
2021-01-06 16:27:12 -05:00
Megan Marsh 28245ec143
Merge pull request #10134 from borancar/feat/azure_pfx_support
Add Azure PFX certificate support
2020-12-18 12:09:17 -08:00
Megan Marsh 88b7b0e14a remove sdk 2020-12-17 13:29:25 -08:00
Megan Marsh 5f34bbd56e add extra line before package declaration so this line does not become the synopsis of a package for godoc 2020-12-16 15:14:43 -08:00
Megan Marsh becf7723e6 move builder/testing to acctest inside sdk 2020-12-03 11:57:06 -08:00
Megan Marsh 8558d1241f move TestUi func to sdk 2020-12-03 10:15:30 -08:00
Megan Marsh 863e20ad65 move builder/testing framework into sdk; it imports the core but I think we just need to accept that. It doesn't expose the core directly to the SDK. 2020-12-02 09:46:42 -08:00
Megan Marsh 39354f64e5 move helper/communicator dir into packer-plugin-sdk
fix imports; fix website and generated partials
2020-12-02 08:41:32 -08:00
Megan Marsh faa3832537 extract builder interface to sdk 2020-12-02 08:41:31 -08:00
Megan Marsh 0eff73293a fix imports, vendoring, and linting 2020-11-30 14:30:30 -08:00
Megan Marsh d5971ca25e fix tests by moving mock hooks and communicators, and BasicUi definition, into SDK 2020-11-30 14:30:30 -08:00
Megan Marsh 56a45b04ab Move hook and communicator definitions to packer-plugin-sdk 2020-11-30 14:30:30 -08:00
Megan Marsh a6fdeca099 move logsecretfilter into packer sdk 2020-11-30 14:30:30 -08:00
Megan Marsh 14bdb9516c move Artifact and artifact mock to the sdk 2020-11-30 14:29:52 -08:00
Megan Marsh c70870cb83 move multierror and multierrorappend into sdk 2020-11-30 14:29:06 -08:00
Megan Marsh 001886670d move Ui definition into the packer plugin sdk. 2020-11-30 14:26:54 -08:00
Megan Marsh ea1ac530b0 move hcl2template kv types into the config/custom_types with trilean definitions 2020-11-18 15:46:59 -08:00
Megan Marsh f8f1ebf0c7 move version and useragent definitions into sdk 2020-11-18 11:42:02 -08:00
Megan Marsh 9e47696dff move helper/config to bundle with the other template definitions 2020-11-18 10:34:59 -08:00
Megan Marsh 3f6deb8828 move multistep into the plugin sdk 2020-11-17 16:31:03 -08:00
Megan Marsh 7d658149ea update tests and website and generated partials to reflect new package format 2020-11-17 10:36:01 -08:00
Megan Marsh e04eaa89e6 move steps and step configs from packer/common to packer/common/commonsteps 2020-11-13 11:15:04 -08:00
Megan Marsh 6402362018 create packer-plugin-sdk directory and begin moving the relevant folders into it. 2020-11-13 10:47:36 -08:00
Megan Marsh 3db40194af version files 2020-11-10 14:48:06 -08:00
Megan Marsh 8ecd16db81 regenerate code 2020-11-10 08:16:59 -08:00
Megan Marsh 1ecd715221 refactor code so that packer/version is not a dependency of sdk code or plugin code 2020-11-09 17:20:42 -08:00
Megan Marsh 88e03280b6
Extract plugin-specific examples to plugin directories (#10228)
* move alicloud examples from common example directory to alicloud builder

* move amazon examples to amazon builder dir

* move examples into ansible provisioner directory

* move azure examples to builder dir

* move hyperone examples into builder directory

* move jdcloud builder examples into builder directory

* move tencent cloud examples into the builder directory

* move ucloud examples into ucloud builder directory
2020-11-09 12:17:41 +01:00
Paul Meyer 5ea90fea5b
Merge pull request #10210 from sumit-kalra/master
[builder/azure-arm] Create keyvaults with SoftDelete enabled
2020-11-06 14:07:41 -08:00
Simon Gottschlag 65b7d3b604
Add Azure CLI authentication (#10157)
Adds the ability to use an active `az login` session for authenticating the Azure builder
2020-11-06 14:24:16 -05:00
Sumit Kalra 2b69a5f496 azure-arm builder: Create keyvaults with SoftDelete enabled 2020-11-02 20:42:55 -08:00
Megan Marsh 72fd763207 fix crash 2020-10-29 14:29:16 -07:00
Adrien Delorme f5e037e8b4 Merge remote-tracking branch 'origin/master' into azr_selectable_temp_keygen_type_gcp 2020-10-26 15:47:29 +01:00
Wilken Rivera a1d69bfe91 Fix liniting issues 2020-10-23 13:52:05 -04:00
Wilken Rivera afd33679f5 builder/azure_arm: Fix build failures due to the deletion of attached managed disks
Previously (prior to v1.6.2) the Azure ARM builder had two delete functions
one that would run before any of the StepDelete* types, and one on deployment template
cleanup. The refactored coded re-introduces the logic from the previously removed
step in v1.6.1 as the main delete logic for the whole deployment
template. Ensuring that all deployed items are deleted before trying to
remove any managed disks.

This change moves all the deletion logic into the
step_deployment_template#Cleanup function to ensure that dependent steps
are only called once the created deployment items (i.e
StepDelateAdditionalDisks) have been deleted.

Test results before change
```

    compute.DisksClient#Delete: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> Code="OperationNotAllowed" Message="Disk pkrdd02e9rzzu5k-1 is attached to VM /subscriptions/1f90521a-24f6-4758-ac3d-88d869fb0bf5/resourceGroups/packer-acceptance-test/providers/Microsoft.Compute/virtualMachines/pkrvm02e9rzzu5k."
--- FAIL: TestBuilderAcc_ManagedDisk_Windows_Build_Resource_Group_Additional_Disk (454.00s)
FAIL
FAIL    github.com/hashicorp/packer/builder/azure/arm   454.008s

```

Test results after change
```
--- PASS: TestBuilderAcc_ManagedDisk_Windows_Build_Resource_Group_Additional_Disk (563.56s)

```

Closes #10070
2020-10-23 13:44:27 -04:00
Megan Marsh 70cb4097e1 review comments, add plugin type for a few missing builders 2020-10-21 16:17:32 -07:00
Megan Marsh c0ce8a9414 rework fixer deprecation code so we know what plugins they relate to 2020-10-21 15:28:59 -07:00
Wilken Rivera a2ba700ac0 Remove deprecated object ids from configs 2020-10-21 13:56:22 -04:00
Adrien Delorme 522d122858 regen all code 2020-10-21 12:04:10 +02:00
Wilken Rivera 1621ab59d8
tests/azure/arm: Update test image name (#10133)
I've run into a few cases where running the full test suite for the ARM
builder would fail because of conflicting image names. This is a
workaround for now the bigger fix is to have the acceptance clean up any
created images.

Results before change
```
the managed image named testBuilderAccManagedDiskWindows-1603151855 already exists in the resource group packer-acceptance-test, use the -force option to automatically delete it.
--- FAIL: TestBuilderAcc_ManagedDisk_Windows_Build_Resource_Group (0.66s)
```

Results after change
```
PASS
ok      github.com/hashicorp/packer/builder/azure/arm   2431.115s

```
2020-10-21 11:12:50 +02:00
Boran Car 9b89439ec2 Rearrange cert add after err check for idiomatic 2020-10-20 22:20:57 +02:00
Boran Car 1082bffddd Add Azure PFX certificate support
Azure typically uses pfx files for service principal authentication.
These are PKCS#12 files so just try and read a cert file as such if we
can't already read it as PEM.
2020-10-20 22:15:38 +02:00
Adrien Delorme 54032d6c11 gen code and docs 2020-10-15 16:51:23 +02:00