hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
15.11k stars 3.33k forks source link

Set retention period for image versions in SIG #8492

Closed ata18 closed 4 years ago

ata18 commented 4 years ago

Overview of the Issue

GalleryImageVersionPublishingProfile definition in Azure SDK allows to specify endOfLifeDate for an image version. GalleryImageVersionsRestAPI AzureSDKCode

In packer, here is where a new gallery image version is created and published to sig. In this step, when specifying the GalleryImageVersionPublishingProfile, endOfLifeDate is not populated. This needs to be fixed in order to be able to set endOfLifeDate for image versions in SIG.

PublishingProfile: &compute.GalleryImageVersionPublishingProfile
{
  Source: &compute.GalleryArtifactSource
  { 
    ManagedImage: &compute.ManagedArtifact
    { 
      ID: &mdiID,
    }, 
  },
  TargetRegions: &replicationRegions,
}

Packer version

From packer version 1.4.3

ata18 commented 4 years ago

I will work on this.

ata18 commented 4 years ago

Looks like packer still uses an older version of Azure SDK. Is there a plan to move to newer version of AzureSDK?

Will it be okay to move to a newer version of SDK for this file alone?

SwampDragons commented 4 years ago

Go ahead and update the SDK for everything.

ata18 commented 4 years ago

@SwampDragons I suspect that there could be some breaking changes with moving to a newer SDK version. I am not familiar with this code base. I will give it a try.

SwampDragons commented 4 years ago

I don't want to have to maintain several separate versions of the SDK. If there are breaking changes, the compiler will catch them.

ata18 commented 4 years ago

The old sdk itself has the support for setting end-of-life-date for image versions in sig. I made the required changes on the packer side and tested by doing a packer build. It successfully sets the end-of -life date on the image version. Will open a PR for this.

ghost commented 4 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.