feat(gce): add partnerMetadata in instanceProperties for GCE deployment #6297
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Support partnerMetadata in GCE deployment. See https://cloud.google.com/compute/docs/metadata/overview#partner_attributes
Basically clouddriver will receive partnerMetadata from the execution context and it will add it in the instanceProperties if partnerMetadata is defined.
PartnerMetadata is a feature under Preview but clouddriver currently uses beta google compute client and it recognizes it.
If there is an error in the structure of the parterMetadata the deployment will fail and it will describe the error like the following:
![Captura de pantalla 2024-10-17 a la(s) 2 04 04 p m](https://private-user-images.githubusercontent.com/63310723/377617591-1e8a7a60-ff9f-4543-b50a-2fa7e06b3f31.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MTYxMzcsIm5iZiI6MTczODkxNTgzNywicGF0aCI6Ii82MzMxMDcyMy8zNzc2MTc1OTEtMWU4YTdhNjAtZmY5Zi00NTQzLWI1MGEtMmZhN2UwNmIzZjMxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDA4MTAzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlkNzg4ZTVkZjE4ZGM0ZjkwNGNhOGExZGNiNmYxNzU1OGZiMTcxZTcxNjA4NjU3MWI0NDcwOTZjNjdjMzQ5OTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.rHsqcdna3gcGN4tAuevgNLyOnQGkxKh21PMPCsg2pXw)
We can validate that the instance template & instance itself has the partnerMetadata by using the following beta command in gcloud.
gcloud beta compute instance-templates describe armorytests-v005-92753465 --view=FULL
gcloud beta compute instances describe armorytests-v005-5mxg --view=FULL
Issue related: spinnaker/spinnaker#6931
PartnerMetadata is available in clouddriver because the newer client version: spinnaker/kork#1208