Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Packer
Commits
c15d3a2e
Unverified
Commit
c15d3a2e
authored
3 years ago
by
Sylvia Moss
Committed by
GitHub
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
remove iteration revocation check (#11624)
parent
0ed3e152
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
internal/registry/service.go
+0
-15
internal/registry/service.go
with
0 additions
and
15 deletions
+0
-15
internal/registry/service.go
+
0
-
15
View file @
c15d3a2e
...
@@ -4,7 +4,6 @@ import (
...
@@ -4,7 +4,6 @@ import (
"context"
"context"
"errors"
"errors"
"fmt"
"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/client/packer_service"
"github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/preview/2021-04-30/models"
"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
...
@@ -127,13 +126,6 @@ func (client *Client) GetIteration(ctx context.Context, bucketSlug string, opts
}
}
if
resp
.
Payload
.
Iteration
!=
nil
{
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
return
resp
.
Payload
.
Iteration
,
nil
}
}
...
@@ -255,13 +247,6 @@ func (client *Client) GetIterationFromChannel(
...
@@ -255,13 +247,6 @@ func (client *Client) GetIterationFromChannel(
if
resp
.
Payload
.
Channel
!=
nil
{
if
resp
.
Payload
.
Channel
!=
nil
{
if
resp
.
Payload
.
Channel
.
Iteration
!=
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
resp
.
Payload
.
Channel
.
Iteration
,
nil
}
}
return
nil
,
fmt
.
Errorf
(
"there is no iteration associated with the channel %s"
,
return
nil
,
fmt
.
Errorf
(
"there is no iteration associated with the channel %s"
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment