mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
remove iteration revocation check (#11624)
This commit is contained in:
parent
0ed3e1529c
commit
c15d3a2e89
1 changed files with 0 additions and 15 deletions
|
|
@ -4,7 +4,6 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/preview/2021-04-30/client/packer_service"
|
||||
"github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/preview/2021-04-30/models"
|
||||
|
|
@ -127,13 +126,6 @@ func (client *Client) GetIteration(ctx context.Context, bucketSlug string, opts
|
|||
}
|
||||
|
||||
if resp.Payload.Iteration != nil {
|
||||
revokeAt := time.Time(resp.Payload.Iteration.RevokeAt)
|
||||
if !revokeAt.IsZero() && revokeAt.Before(time.Now().UTC()) {
|
||||
// If RevokeAt is not a zero date and is before NOW, it means this iteration is revoked and should not be used
|
||||
// to build new images.
|
||||
return nil, fmt.Errorf("the iteration %s is revoked and can not be used on Packer builds",
|
||||
resp.Payload.Iteration.ID)
|
||||
}
|
||||
return resp.Payload.Iteration, nil
|
||||
}
|
||||
|
||||
|
|
@ -255,13 +247,6 @@ func (client *Client) GetIterationFromChannel(
|
|||
|
||||
if resp.Payload.Channel != nil {
|
||||
if resp.Payload.Channel.Iteration != nil {
|
||||
revokeAt := time.Time(resp.Payload.Channel.Iteration.RevokeAt)
|
||||
if !revokeAt.IsZero() && revokeAt.Before(time.Now().UTC()) {
|
||||
// If RevokeAt is not a zero date and is before NOW, it means this iteration is revoked and should not be used
|
||||
// to build new images.
|
||||
return nil, fmt.Errorf("the iteration associated with the channel %s is revoked and can not be used on Packer builds",
|
||||
channelName)
|
||||
}
|
||||
return resp.Payload.Channel.Iteration, nil
|
||||
}
|
||||
return nil, fmt.Errorf("there is no iteration associated with the channel %s",
|
||||
|
|
|
|||
Loading…
Reference in a new issue