@@ -40,40 +40,64 @@ func (p *Provider) Create() error {
4040 // Single-node deployment
4141 cache := new (AWS )
4242
43- p .updateProgressingCondition (* p .Environment .DeepCopy (), cache , "v1alpha1.Creating" , "Creating AWS resources" ) // nolint:errcheck, gosec, staticcheck
43+ if err := p .updateProgressingCondition (* p .DeepCopy (), cache , "v1alpha1.Creating" , "Creating AWS resources" ); err != nil {
44+ p .log .Warning ("Failed to update progressing condition: %v" , err )
45+ }
4446
4547 if err := p .createVPC (cache ); err != nil {
46- p .updateDegradedCondition (* p .Environment .DeepCopy (), cache , "v1alpha1.Creating" , "Error creating VPC" ) // nolint:errcheck, gosec, staticcheck
48+ if updateErr := p .updateDegradedCondition (* p .DeepCopy (), cache , "v1alpha1.Creating" , "Error creating VPC" ); updateErr != nil {
49+ p .log .Warning ("Failed to update degraded condition: %v" , updateErr )
50+ }
4751 return fmt .Errorf ("error creating VPC: %w" , err )
4852 }
49- p .updateProgressingCondition (* p .Environment .DeepCopy (), cache , "v1alpha1.Creating" , "VPC created" ) // nolint:errcheck, gosec, staticcheck
53+ if err := p .updateProgressingCondition (* p .DeepCopy (), cache , "v1alpha1.Creating" , "VPC created" ); err != nil {
54+ p .log .Warning ("Failed to update progressing condition: %v" , err )
55+ }
5056
5157 if err := p .createSubnet (cache ); err != nil {
52- p .updateDegradedCondition (* p .Environment .DeepCopy (), cache , "v1alpha1.Creating" , "Error creating subnet" ) // nolint:errcheck, gosec, staticcheck
58+ if updateErr := p .updateDegradedCondition (* p .DeepCopy (), cache , "v1alpha1.Creating" , "Error creating subnet" ); updateErr != nil {
59+ p .log .Warning ("Failed to update degraded condition: %v" , updateErr )
60+ }
5361 return fmt .Errorf ("error creating subnet: %w" , err )
5462 }
55- p .updateProgressingCondition (* p .Environment .DeepCopy (), cache , "v1alpha1.Creating" , "Subnet created" ) // nolint:errcheck, gosec, staticcheck
63+ if err := p .updateProgressingCondition (* p .DeepCopy (), cache , "v1alpha1.Creating" , "Subnet created" ); err != nil {
64+ p .log .Warning ("Failed to update progressing condition: %v" , err )
65+ }
5666
5767 if err := p .createInternetGateway (cache ); err != nil {
58- p .updateDegradedCondition (* p .Environment .DeepCopy (), cache , "v1alpha1.Creating" , "Error creating Internet Gateway" ) // nolint:errcheck, gosec, staticcheck
68+ if updateErr := p .updateDegradedCondition (* p .DeepCopy (), cache , "v1alpha1.Creating" , "Error creating Internet Gateway" ); updateErr != nil {
69+ p .log .Warning ("Failed to update degraded condition: %v" , updateErr )
70+ }
5971 return fmt .Errorf ("error creating Internet Gateway: %w" , err )
6072 }
61- p .updateProgressingCondition (* p .Environment .DeepCopy (), cache , "v1alpha1.Creating" , "Internet Gateway created" ) // nolint:errcheck, gosec, staticcheck
73+ if err := p .updateProgressingCondition (* p .DeepCopy (), cache , "v1alpha1.Creating" , "Internet Gateway created" ); err != nil {
74+ p .log .Warning ("Failed to update progressing condition: %v" , err )
75+ }
6276
6377 if err := p .createRouteTable (cache ); err != nil {
64- p .updateDegradedCondition (* p .Environment .DeepCopy (), cache , "v1alpha1.Creating" , "Error creating route table" ) // nolint:errcheck, gosec, staticcheck
78+ if updateErr := p .updateDegradedCondition (* p .DeepCopy (), cache , "v1alpha1.Creating" , "Error creating route table" ); updateErr != nil {
79+ p .log .Warning ("Failed to update degraded condition: %v" , updateErr )
80+ }
6581 return fmt .Errorf ("error creating route table: %w" , err )
6682 }
67- p .updateProgressingCondition (* p .Environment .DeepCopy (), cache , "v1alpha1.Creating" , "Route Table created" ) // nolint:errcheck, gosec, staticcheck
83+ if err := p .updateProgressingCondition (* p .DeepCopy (), cache , "v1alpha1.Creating" , "Route Table created" ); err != nil {
84+ p .log .Warning ("Failed to update progressing condition: %v" , err )
85+ }
6886
6987 if err := p .createSecurityGroup (cache ); err != nil {
70- p .updateDegradedCondition (* p .Environment .DeepCopy (), cache , "v1alpha1.Creating" , "Error creating security group" ) // nolint:errcheck, gosec, staticcheck
88+ if updateErr := p .updateDegradedCondition (* p .DeepCopy (), cache , "v1alpha1.Creating" , "Error creating security group" ); updateErr != nil {
89+ p .log .Warning ("Failed to update degraded condition: %v" , updateErr )
90+ }
7191 return fmt .Errorf ("error creating security group: %w" , err )
7292 }
73- p .updateProgressingCondition (* p .Environment .DeepCopy (), cache , "v1alpha1.Creating" , "Security Group created" ) // nolint:errcheck, gosec, staticcheck
93+ if err := p .updateProgressingCondition (* p .DeepCopy (), cache , "v1alpha1.Creating" , "Security Group created" ); err != nil {
94+ p .log .Warning ("Failed to update progressing condition: %v" , err )
95+ }
7496
7597 if err := p .createEC2Instance (cache ); err != nil {
76- p .updateDegradedCondition (* p .Environment .DeepCopy (), cache , "v1alpha1.Creating" , "Error creating EC2 instance" ) // nolint:errcheck, gosec, staticcheck
98+ if updateErr := p .updateDegradedCondition (* p .DeepCopy (), cache , "v1alpha1.Creating" , "Error creating EC2 instance" ); updateErr != nil {
99+ p .log .Warning ("Failed to update degraded condition: %v" , updateErr )
100+ }
77101 return fmt .Errorf ("error creating EC2 instance: %w" , err )
78102 }
79103
0 commit comments