Skip to content

Commit 14188ee

Browse files
changing text proxy to avoid integ test webhook spam (#122)
* updating text proxy timeplus2min to be static updating text proxy timeplus2min to be static * changed Local() to UTC()
1 parent d93f16d commit 14188ee

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/ec2-metadata-test-proxy/cmd/ec2-metadata-test-proxy.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const (
5151
)
5252

5353
var startTime int64 = time.Now().Unix()
54+
var spotInterruptionTime string = time.Now().UTC().Add(time.Minute * time.Duration(2)).Format(time.RFC3339)
5455

5556
// ScheduledEventDetail metadata structure for json parsing
5657
type ScheduledEventDetail struct {
@@ -143,9 +144,8 @@ func handleRequest(res http.ResponseWriter, req *http.Request) {
143144
http.Error(res, "ec2-metadata-test-proxy feature not enabled", http.StatusNotFound)
144145
return
145146
}
146-
timePlus2Min := time.Now().Local().Add(time.Minute * time.Duration(2)).Format(time.RFC3339)
147147
instanceAction := InstanceAction{
148-
Time: timePlus2Min,
148+
Time: spotInterruptionTime,
149149
Action: "terminate",
150150
}
151151
js, err := json.Marshal(instanceAction)
@@ -184,8 +184,8 @@ func handleRequest(res http.ResponseWriter, req *http.Request) {
184184
// "State" : "active"
185185
// }
186186
// ]
187-
timePlus2Min := time.Now().Local().Add(time.Minute * 2).Format(scheduledActionDateFormat)
188-
timePlus4Min := time.Now().Local().Add(time.Minute * 4).Format(scheduledActionDateFormat)
187+
timePlus2Min := time.Now().UTC().Add(time.Minute * 2).Format(scheduledActionDateFormat)
188+
timePlus4Min := time.Now().UTC().Add(time.Minute * 4).Format(scheduledActionDateFormat)
189189
scheduledEvent := ScheduledEventDetail{
190190
NotBefore: timePlus2Min,
191191
Code: "system-reboot",

0 commit comments

Comments
 (0)