Skip to content

Commit

Permalink
detect building image id strictly & update documents
Browse files Browse the repository at this point in the history
  • Loading branch information
sishihara committed Sep 26, 2019
1 parent 9415a9e commit 7249446
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Packer builder plugin for IIJ GIO P2 Public Resource
}],
"provisioners": [{
"type": "shell",
"inline": "touch /tmp/packer-builder-p2pub-sample"
"inline": "touch /var/tmp/packer-builder-p2pub-sample"
}]
}
```
Expand All @@ -49,13 +49,13 @@ After running this sample, the image is saved in [Storage Archive](https://manua
| ```gis_service_code``` | Service Code of P2 contract to use for building and save the artifact in ||
| ```storage_type``` | Built image's [Storage Type (System Storage)](https://manual.iij.jp/p2/pubapi/59949023.html). ||
| ```server_type``` | [Server Type](https://manual.iij.jp/p2/pubapi/59949011.html) used while build. Default is ```VB0-1```. | |
| ```base_image``` | | |
| ```base_image.gis_service_code``` | | |
| ```base_image.iar_service_code``` | | |
| ```base_image.image_id``` | | |
| ```base_image``` | Base image the artifact is built from. | |
| ```base_image.gis_service_code``` | Base image's Service Code (P2 root contract) | |
| ```base_image.iar_service_code``` | Base image's Service Code (Storage Archive) | |
| ```base_image.image_id``` | Base image's Image ID | |
| ```root_ssh_key``` | SSH public key for root user, used by provisioners. If it is empty, P2 PUB builder will generate temporary SSH key pair. | |
| ```label``` | Label text for build images. | |
| ```disable_global_address``` | If this is set true, P2 PUB builder connects VMs through [Standard Private Network](https://manual.iij.jp/p2/pub/b-5-1-1.html). Default is ```false``` (the builder allocate a global IP address and provisioning by using the Internet).| |
| ```disable_global_address``` | If this is set true, P2 PUB builder connects to VMs through [Standard Private Network](https://manual.iij.jp/p2/pub/b-5-1-1.html). Default is ```false``` (the builder allocate a global IP address and provisioning by using the Internet).| |

**Common parameters modified by P2 PUB builder**

Expand Down
3 changes: 1 addition & 2 deletions builder/p2pub/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ type Config struct {
// Public key ** for "root" ** (optional)
RootSSHKey string `mapstructure:"root_ssh_key"`

// The label set to built image
// This is optional parameter but P2 PUB builder may not work correctly when it is not set
// The label set to built image (optional)
Label string `mapstructure:"label"`

// If this is set true, P2 PUB builder connects VMs through Standard Private Network. (optional)
Expand Down
3 changes: 1 addition & 2 deletions builder/p2pub/step_archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ func (s *stepArchive) Run(ctx context.Context, state multistep.StateBag) multist
return multistep.ActionHalt
}

// FIXME:
for _, image := range listResp.ImageList {
if image.Label == config.Label {
if image.SrcServiceCode == serviceCode {
state.Put("ImageId", image.ImageId)
break
}
Expand Down

0 comments on commit 7249446

Please sign in to comment.