However, starting in version v1.1.2 of the packer’s "googlecompute" plugin, they have changed the string representation of the artifact to be as follows:
"A disk image was created in the '%v' project: %v"
Here is how it looks in v1.1.2 and later, and here is how it looks in v1.1.1 and previous.
Even though this does not affect the baking, as Spinnaker can create and push the images to GCP, any posterior deployment stage fails as the image name cannot be extracted, because the string filtering no longer matches.
I believe this bug can be fixed simply by removing the colon at the end of the string in this line, e.g. like this:
private static final String IMAGE_NAME_TOKEN = "googlecompute: A disk image was created"
This should cause a match for both cases, although I'm not fully familiarized with the code to know if the proposed fix can have an impact in other section.
Cloud Provider(s):
GCP
Environment:
Previously, we were running version 1.26.5, and this was not an issue as the embedded packer version was not using plugins (1.6.x), but recently updated to the latest stable version (1.35.4), which is when we started experiencing this problem.
Feature Area:
Image Baking (Rosco).
Steps to Reproduce:
Create a pipeline that Bakes an image and then deploys it in GCP, using Spinnaker v1.35.4 (but potentially more previous versions).
Additional Details:
Error reflected in the UI:
Here is a portion of the Json logs extracted from the UI for a failed execution:
You can see in the failed execution, stages.context.artifacts.reference has a "null" reference, also the fields: stages.context.artifacts[ami, imageId, imageName] are not populated.
SO short answer would be to restrict the plugin version... e.g. change packer configs. That said, would welcome some PRs & tests around this to help fix it :)
Issue Summary:
Currently, Rosco obtains the image name by scrapping the logs for a certain string:
“googlecompute: A disk image was created:”
Here are the code portions responsible for this task:
However, starting in version v1.1.2 of the packer’s "googlecompute" plugin, they have changed the string representation of the artifact to be as follows:
"A disk image was created in the '%v' project: %v"
Here is how it looks in v1.1.2 and later, and here is how it looks in v1.1.1 and previous.
Even though this does not affect the baking, as Spinnaker can create and push the images to GCP, any posterior deployment stage fails as the image name cannot be extracted, because the string filtering no longer matches.
I believe this bug can be fixed simply by removing the colon at the end of the string in this line, e.g. like this:
private static final String IMAGE_NAME_TOKEN = "googlecompute: A disk image was created"
This should cause a match for both cases, although I'm not fully familiarized with the code to know if the proposed fix can have an impact in other section.
Cloud Provider(s):
GCP
Environment:
Previously, we were running version 1.26.5, and this was not an issue as the embedded packer version was not using plugins (1.6.x), but recently updated to the latest stable version (1.35.4), which is when we started experiencing this problem.
Feature Area:
Image Baking (Rosco).
Steps to Reproduce:
Create a pipeline that Bakes an image and then deploys it in GCP, using Spinnaker v1.35.4 (but potentially more previous versions).
Additional Details:
Error reflected in the UI:
Here is a portion of the Json logs extracted from the UI for a failed execution:
And here is the equivalent log for a pre-update (v1.26.5) execution:
You can see in the failed execution, stages.context.artifacts.reference has a "null" reference, also the fields: stages.context.artifacts[ami, imageId, imageName] are not populated.