Skip to content

Commit e973839

Browse files
Merge pull request #163 from NVIDIA/main
V0.2.4
2 parents df00ba4 + 50e2452 commit e973839

56 files changed

Lines changed: 921 additions & 304 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/e2e.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,27 @@ jobs:
2828
runs-on: pdx01-arc-runners
2929
if: ${{ github.event.workflow_run.conclusion == 'success' }} && ${{ github.event.workflow_run.event == 'push' }}
3030
steps:
31-
- uses: actions/checkout@v4
32-
name: Checkout code
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
3334
- name: Install Go
3435
uses: actions/setup-go@v5
3536
with:
3637
go-version: 'stable'
3738
check-latest: true
39+
3840
- name: Install dependencies
39-
run: sudo apt-get update && sudo apt-get install -y make
41+
run: |
42+
sudo apt-get update
43+
sudo apt-get install -y make
44+
make ginkgo
45+
4046
- name: Run e2e-aws tests
41-
run: make -f tests/Makefile e2e-aws
47+
run: ./hack/e2e_tests.sh aws
48+
4249
- name: Run e2e-vsphere tests
43-
run: make -f tests/Makefile e2e-vsphere
50+
run: ./hack/e2e_tests.sh vsphere
51+
4452
- name: Archive test logs
4553
if: ${{ failure() }}
4654
uses: actions/upload-artifact@v4

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ GO_SRC := $(shell find . -type f -name '*.go' -not -path "./vendor/*")
1717
BINARY_NAME ?= holodeck
1818

1919
VERSION := 0.0.1
20+
GINKGO_VERSION ?= $(shell $(GO_CMD) list -m -f '{{.Version}}' github.com/onsi/ginkgo/v2)
2021

2122
IMAGE_REGISTRY ?= ghcr.io/arangogutierrez
2223
IMAGE_TAG_NAME ?= $(VERSION)
@@ -67,3 +68,8 @@ controller-gen: ## Download controller-gen locally if necessary.
6768
.PHONY: manifests
6869
manifests: controller-gen
6970
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
71+
72+
GINKGO = $(PROJECT_DIR)/bin/ginkgo
73+
.PHONY: ginkgo
74+
ginkgo: ## Download ginkgo locally if necessary.
75+
@GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on $(GO_CMD) install github.com/onsi/ginkgo/v2/ginkgo@$(GINKGO_VERSION)

api/holodeck/v1alpha1/types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ const (
5353
// ProviderSSH means the user already has a running instance
5454
// and wants to use it as the infra provider via SSH
5555
ProviderSSH Provider = "ssh"
56+
57+
// Possible values for the Conditions field
58+
ConditionProgressing string = "Progressing"
59+
ConditionDegraded string = "Degraded"
60+
ConditionAvailable string = "Available"
61+
ConditionTerminated string = "Terminated"
5662
)
5763

5864
// Instance defines and AWS instance

cmd/action/ci/ci.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,14 @@ func Run(log *logger.FunLogger) error {
4141
}
4242

4343
if _, err := os.Stat(cachedir); err == nil {
44-
if err := cleanup(log); err != nil {
45-
return err
44+
// Check if cache condition is Terminated
45+
if ok, err := isTerminated(log); ok {
46+
log.Info("Environment condition is Terminated no need to run Holodeck")
47+
return nil
48+
} else if err != nil {
49+
if err := cleanup(log); err != nil {
50+
return err
51+
}
4652
}
4753
} else {
4854
if err := entrypoint(log); err != nil {

cmd/action/ci/cleanup.go

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,38 @@ func cleanup(log *logger.FunLogger) error {
7474
}
7575
}
7676

77-
if err := os.RemoveAll(cachedir); err != nil {
78-
log.Error(fmt.Errorf("error deleting cache directory: %s", err))
79-
}
80-
8177
log.Info("Successfully deleted environment %s\n", cfg.Name)
8278

8379
return nil
8480
}
81+
82+
func isTerminated(log *logger.FunLogger) (bool, error) {
83+
log.Info("Checking for Terminated condition")
84+
85+
// Read the config file
86+
configFile := os.Getenv("INPUT_HOLODECK_CONFIG")
87+
if configFile == "" {
88+
log.Error(fmt.Errorf("config file not provided"))
89+
os.Exit(1)
90+
}
91+
configFile = "/github/workspace/" + configFile
92+
cfg, err := jyaml.UnmarshalFromFile[v1alpha1.Environment](configFile)
93+
if err != nil {
94+
return false, fmt.Errorf("error reading config file: %s", err)
95+
}
96+
97+
// Set env name
98+
setCfgName(&cfg)
99+
100+
provider, err := newProvider(log, &cfg)
101+
if err != nil {
102+
return false, fmt.Errorf("failed to create provider: %v", err)
103+
}
104+
105+
status, err := provider.Status()
106+
if err != nil {
107+
return false, fmt.Errorf("failed to get status: %v", err)
108+
}
109+
110+
return status == "Terminated", nil
111+
}

go.mod

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ require (
88
github.com/NVIDIA/k8s-test-infra v0.0.0-20240730082043-e950c133bd0b
99
github.com/aws/aws-sdk-go v1.55.5
1010
github.com/aws/aws-sdk-go-v2 v1.30.4
11-
github.com/aws/aws-sdk-go-v2/config v1.27.27
12-
github.com/aws/aws-sdk-go-v2/service/ec2 v1.175.1
13-
github.com/aws/aws-sdk-go-v2/service/route53 v1.42.3
14-
github.com/aws/aws-sdk-go-v2/service/ssm v1.52.5
11+
github.com/aws/aws-sdk-go-v2/config v1.27.31
12+
github.com/aws/aws-sdk-go-v2/service/ec2 v1.177.0
13+
github.com/aws/aws-sdk-go-v2/service/route53 v1.43.0
14+
github.com/aws/aws-sdk-go-v2/service/ssm v1.52.6
1515
github.com/mattn/go-isatty v0.0.20
1616
github.com/onsi/ginkgo/v2 v2.20.0
1717
github.com/onsi/gomega v1.34.1
18-
github.com/urfave/cli/v2 v2.27.3
18+
github.com/urfave/cli/v2 v2.27.4
1919
github.com/vmware/govmomi v0.39.0
2020
golang.org/x/crypto v0.26.0
2121
k8s.io/apimachinery v0.31.0
@@ -34,16 +34,16 @@ require (
3434
github.com/Masterminds/squirrel v1.5.4 // indirect
3535
github.com/Microsoft/hcsshim v0.11.4 // indirect
3636
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
37-
github.com/aws/aws-sdk-go-v2/credentials v1.17.27 // indirect
38-
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 // indirect
37+
github.com/aws/aws-sdk-go-v2/credentials v1.17.30 // indirect
38+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12 // indirect
3939
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16 // indirect
4040
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16 // indirect
41-
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
41+
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
4242
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect
4343
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18 // indirect
44-
github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 // indirect
45-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 // indirect
46-
github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 // indirect
44+
github.com/aws/aws-sdk-go-v2/service/sso v1.22.5 // indirect
45+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5 // indirect
46+
github.com/aws/aws-sdk-go-v2/service/sts v1.30.5 // indirect
4747
github.com/aws/smithy-go v1.20.4 // indirect
4848
github.com/beorn7/perks v1.0.1 // indirect
4949
github.com/cespare/xxhash/v2 v2.2.0 // indirect

go.sum

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,34 @@ github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU
3535
github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
3636
github.com/aws/aws-sdk-go-v2 v1.30.4 h1:frhcagrVNrzmT95RJImMHgabt99vkXGslubDaDagTk8=
3737
github.com/aws/aws-sdk-go-v2 v1.30.4/go.mod h1:CT+ZPWXbYrci8chcARI3OmI/qgd+f6WtuLOoaIA8PR0=
38-
github.com/aws/aws-sdk-go-v2/config v1.27.27 h1:HdqgGt1OAP0HkEDDShEl0oSYa9ZZBSOmKpdpsDMdO90=
39-
github.com/aws/aws-sdk-go-v2/config v1.27.27/go.mod h1:MVYamCg76dFNINkZFu4n4RjDixhVr51HLj4ErWzrVwg=
40-
github.com/aws/aws-sdk-go-v2/credentials v1.17.27 h1:2raNba6gr2IfA0eqqiP2XiQ0UVOpGPgDSi0I9iAP+UI=
41-
github.com/aws/aws-sdk-go-v2/credentials v1.17.27/go.mod h1:gniiwbGahQByxan6YjQUMcW4Aov6bLC3m+evgcoN4r4=
42-
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 h1:KreluoV8FZDEtI6Co2xuNk/UqI9iwMrOx/87PBNIKqw=
43-
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11/go.mod h1:SeSUYBLsMYFoRvHE0Tjvn7kbxaUhl75CJi1sbfhMxkU=
38+
github.com/aws/aws-sdk-go-v2/config v1.27.31 h1:kxBoRsjhT3pq0cKthgj6RU6bXTm/2SgdoUMyrVw0rAI=
39+
github.com/aws/aws-sdk-go-v2/config v1.27.31/go.mod h1:z04nZdSWFPaDwK3DdJOG2r+scLQzMYuJeW0CujEm9FM=
40+
github.com/aws/aws-sdk-go-v2/credentials v1.17.30 h1:aau/oYFtibVovr2rDt8FHlU17BTicFEMAi29V1U+L5Q=
41+
github.com/aws/aws-sdk-go-v2/credentials v1.17.30/go.mod h1:BPJ/yXV92ZVq6G8uYvbU0gSl8q94UB63nMT5ctNO38g=
42+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12 h1:yjwoSyDZF8Jth+mUk5lSPJCkMC0lMy6FaCD51jm6ayE=
43+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12/go.mod h1:fuR57fAgMk7ot3WcNQfb6rSEn+SUffl7ri+aa8uKysI=
4444
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16 h1:TNyt/+X43KJ9IJJMjKfa3bNTiZbUP7DeCxfbTROESwY=
4545
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16/go.mod h1:2DwJF39FlNAUiX5pAc0UNeiz16lK2t7IaFcm0LFHEgc=
4646
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16 h1:jYfy8UPmd+6kJW5YhY0L1/KftReOGxI/4NtVSTh9O/I=
4747
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16/go.mod h1:7ZfEPZxkW42Afq4uQB8H2E2e6ebh6mXTueEpYzjCzcs=
48-
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU=
49-
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY=
50-
github.com/aws/aws-sdk-go-v2/service/ec2 v1.175.1 h1:7B5ppg4i5N2B6t+aH77WLbAu8sD98MLlzruWzq5scyY=
51-
github.com/aws/aws-sdk-go-v2/service/ec2 v1.175.1/go.mod h1:ISODge3zgdwOEa4Ou6WM9PKbxJWJ15DYKnr2bfmCAIA=
48+
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ=
49+
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc=
50+
github.com/aws/aws-sdk-go-v2/service/ec2 v1.177.0 h1:LAdDRIj5BEZM9fLDTUWUyPzWvv5A++nCEps/RGmZNOo=
51+
github.com/aws/aws-sdk-go-v2/service/ec2 v1.177.0/go.mod h1:ISODge3zgdwOEa4Ou6WM9PKbxJWJ15DYKnr2bfmCAIA=
5252
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 h1:KypMCbLPPHEmf9DgMGw51jMj77VfGPAN2Kv4cfhlfgI=
5353
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4/go.mod h1:Vz1JQXliGcQktFTN/LN6uGppAIRoLBR2bMvIMP0gOjc=
5454
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18 h1:tJ5RnkHCiSH0jyd6gROjlJtNwov0eGYNz8s8nFcR0jQ=
5555
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18/go.mod h1:++NHzT+nAF7ZPrHPsA+ENvsXkOO8wEu+C6RXltAG4/c=
56-
github.com/aws/aws-sdk-go-v2/service/route53 v1.42.3 h1:MmLCRqP4U4Cw9gJ4bNrCG0mWqEtBlmAVleyelcHARMU=
57-
github.com/aws/aws-sdk-go-v2/service/route53 v1.42.3/go.mod h1:AMPjK2YnRh0YgOID3PqhJA1BRNfXDfGOnSsKHtAe8yA=
58-
github.com/aws/aws-sdk-go-v2/service/ssm v1.52.5 h1:eY1n+pyBbgqRBRnpVUg0QguAGMWVLQp2n+SfjjOJuQI=
59-
github.com/aws/aws-sdk-go-v2/service/ssm v1.52.5/go.mod h1:Bw2YSeqq/I4VyVs9JSfdT9ArqyAbQkJEwj13AVm0heg=
60-
github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 h1:BXx0ZIxvrJdSgSvKTZ+yRBeSqqgPM89VPlulEcl37tM=
61-
github.com/aws/aws-sdk-go-v2/service/sso v1.22.4/go.mod h1:ooyCOXjvJEsUw7x+ZDHeISPMhtwI3ZCB7ggFMcFfWLU=
62-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 h1:yiwVzJW2ZxZTurVbYWA7QOrAaCYQR72t0wrSBfoesUE=
63-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4/go.mod h1:0oxfLkpz3rQ/CHlx5hB7H69YUpFiI1tql6Q6Ne+1bCw=
64-
github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 h1:ZsDKRLXGWHk8WdtyYMoGNO7bTudrvuKpDKgMVRlepGE=
65-
github.com/aws/aws-sdk-go-v2/service/sts v1.30.3/go.mod h1:zwySh8fpFyXp9yOr/KVzxOl8SRqgf/IDw5aUt9UKFcQ=
56+
github.com/aws/aws-sdk-go-v2/service/route53 v1.43.0 h1:xtp7jye7KhWu4ptBs5yh1Vep0vLAGSNGmArOUp997DU=
57+
github.com/aws/aws-sdk-go-v2/service/route53 v1.43.0/go.mod h1:QN7tFo/W8QjLCR6aPZqMZKaVQJiAp95r/g78x1LWtkA=
58+
github.com/aws/aws-sdk-go-v2/service/ssm v1.52.6 h1:uvd3OF/3jt2csfs2xZ64NIOukDY/YJYZiHqT9vP3Mhg=
59+
github.com/aws/aws-sdk-go-v2/service/ssm v1.52.6/go.mod h1:Bw2YSeqq/I4VyVs9JSfdT9ArqyAbQkJEwj13AVm0heg=
60+
github.com/aws/aws-sdk-go-v2/service/sso v1.22.5 h1:zCsFCKvbj25i7p1u94imVoO447I/sFv8qq+lGJhRN0c=
61+
github.com/aws/aws-sdk-go-v2/service/sso v1.22.5/go.mod h1:ZeDX1SnKsVlejeuz41GiajjZpRSWR7/42q/EyA/QEiM=
62+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5 h1:SKvPgvdvmiTWoi0GAJ7AsJfOz3ngVkD/ERbs5pUnHNI=
63+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5/go.mod h1:20sz31hv/WsPa3HhU3hfrIet2kxM4Pe0r20eBZ20Tac=
64+
github.com/aws/aws-sdk-go-v2/service/sts v1.30.5 h1:OMsEmCyz2i89XwRwPouAJvhj81wINh+4UK+k/0Yo/q8=
65+
github.com/aws/aws-sdk-go-v2/service/sts v1.30.5/go.mod h1:vmSqFK+BVIwVpDAGZB3CoCXHzurt4qBE8lf+I/kRTh0=
6666
github.com/aws/smithy-go v1.20.4 h1:2HK1zBdPgRbjFOHlfeQZfpC4r72MOb9bZkiFwggKO+4=
6767
github.com/aws/smithy-go v1.20.4/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
6868
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
@@ -373,8 +373,8 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
373373
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
374374
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
375375
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
376-
github.com/urfave/cli/v2 v2.27.3 h1:/POWahRmdh7uztQ3CYnaDddk0Rm90PyOgIxgW2rr41M=
377-
github.com/urfave/cli/v2 v2.27.3/go.mod h1:m4QzxcD2qpra4z7WhzEGn74WZLViBnMpb1ToCAKdGRQ=
376+
github.com/urfave/cli/v2 v2.27.4 h1:o1owoI+02Eb+K107p27wEX9Bb8eqIoZCfLXloLUSWJ8=
377+
github.com/urfave/cli/v2 v2.27.4/go.mod h1:m4QzxcD2qpra4z7WhzEGn74WZLViBnMpb1ToCAKdGRQ=
378378
github.com/vmware/govmomi v0.39.0 h1:soLZ08Q2zvjRSinNup8xVlw0KDDCJPPA1rIDmBhi7As=
379379
github.com/vmware/govmomi v0.39.0/go.mod h1:oHzAQ1r6152zYDGcUqeK+EO8LhKo5wjtvWZBGHws2Hc=
380380
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=

hack/e2e_tests.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2022 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -o errexit
18+
set -o nounset
19+
set -o pipefail
20+
21+
SOURCE_DIR="$(cd "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
22+
ROOT_DIR="$SOURCE_DIR/.."
23+
24+
GINKGO="$ROOT_DIR"/bin/ginkgo
25+
GINKGO_ARGS=${GINKGO_ARGS:-}
26+
27+
CI=${CI:-"true"}
28+
29+
LOG_ARTIFACT_DIR=${LOG_ARTIFACT_DIR:-${ROOT_DIR}/e2e_logs}
30+
ENV_FILE=${ENV_FILE:-}
31+
GINKGO_FOCUS=${GINKGO_FOCUS:-}
32+
33+
if [ "$1" == "aws" ]; then
34+
ENV_FILE=${ROOT_DIR}/tests/test_aws.yml
35+
GINKGO_FOCUS=${GINKGO_FOCUS:-"AWS"}
36+
elif [ "$1" == "vsphere" ]; then
37+
ENV_FILE=${ROOT_DIR}/tests/test_vsphere.yml
38+
GINKGO_FOCUS=${GINKGO_FOCUS:-"VSPHERE"}
39+
fi
40+
41+
# Set all ENV variables for e2e tests
42+
export LOG_ARTIFACT_DIR ENV_FILE GINKGO_FOCUS CI
43+
44+
# shellcheck disable=SC2086
45+
$GINKGO $GINKGO_ARGS -v --focus $GINKGO_FOCUS ./tests/...

pkg/provider/aws/create.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,38 @@ import (
3030
// VPC, Subnet, Internet Gateway, Route Table, Security Group
3131
func (p *Provider) Create() error {
3232
cache := new(AWS)
33-
defer p.dumpCache(cache)
3433

3534
p.updateProgressingCondition(*p.Environment.DeepCopy(), cache, "v1alpha1.Creating", "Creating AWS resources")
3635

3736
if err := p.createVPC(cache); err != nil {
3837
p.updateDegradedCondition(*p.Environment.DeepCopy(), cache, "v1alpha1.Creating", "Error creating VPC")
3938
return fmt.Errorf("error creating VPC: %v", err)
4039
}
40+
p.updateProgressingCondition(*p.Environment.DeepCopy(), cache, "v1alpha1.Creating", "VPC created")
4141

4242
if err := p.createSubnet(cache); err != nil {
4343
p.updateDegradedCondition(*p.Environment.DeepCopy(), cache, "v1alpha1.Creating", "Error creating subnet")
4444
return fmt.Errorf("error creating subnet: %v", err)
4545
}
46+
p.updateProgressingCondition(*p.Environment.DeepCopy(), cache, "v1alpha1.Creating", "Subnet created")
4647

4748
if err := p.createInternetGateway(cache); err != nil {
4849
p.updateDegradedCondition(*p.Environment.DeepCopy(), cache, "v1alpha1.Creating", "Error creating Internet Gateway")
4950
return fmt.Errorf("error creating Internet Gateway: %v", err)
5051
}
52+
p.updateProgressingCondition(*p.Environment.DeepCopy(), cache, "v1alpha1.Creating", "Internet Gateway created")
5153

5254
if err := p.createRouteTable(cache); err != nil {
5355
p.updateDegradedCondition(*p.Environment.DeepCopy(), cache, "v1alpha1.Creating", "Error creating route table")
5456
return fmt.Errorf("error creating route table: %v", err)
5557
}
58+
p.updateProgressingCondition(*p.Environment.DeepCopy(), cache, "v1alpha1.Creating", "Route Table created")
5659

5760
if err := p.createSecurityGroup(cache); err != nil {
5861
p.updateDegradedCondition(*p.Environment.DeepCopy(), cache, "v1alpha1.Creating", "Error creating security group")
5962
return fmt.Errorf("error creating security group: %v", err)
6063
}
64+
p.updateProgressingCondition(*p.Environment.DeepCopy(), cache, "v1alpha1.Creating", "Security Group created")
6165

6266
if err := p.createEC2Instance(cache); err != nil {
6367
p.updateDegradedCondition(*p.Environment.DeepCopy(), cache, "v1alpha1.Creating", "Error creating EC2 instance")

0 commit comments

Comments
 (0)