-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OCM-6318 | ci: Build up deprovision step
- Loading branch information
1 parent
e232b45
commit a1b23ac
Showing
4 changed files
with
123 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package profilehandler | ||
|
||
import ( | ||
"github.com/openshift-online/ocm-common/pkg/aws/aws_client" | ||
"github.com/openshift-online/ocm-common/pkg/test/kms_key" | ||
"github.com/openshift-online/ocm-common/pkg/test/vpc_client" | ||
) | ||
|
||
func DeleteVPCChain(vpcID string, region string) error { | ||
vpcClient, err := vpc_client.GenerateVPCByID(vpcID, region) | ||
if err != nil { | ||
return err | ||
} | ||
return vpcClient.DeleteVPCChain() | ||
} | ||
|
||
func ScheduleKMSDesiable(kmsKey string, region string) error { | ||
|
||
return kms_key.ScheduleKeyDeletion(kmsKey, region) | ||
|
||
} | ||
|
||
func DeleteAuditLogRoleArn(arn string, region string) error { | ||
awsClent, err := aws_client.CreateAWSClient("", region) | ||
if err != nil { | ||
return err | ||
} | ||
return awsClent.DeleteRoleAndPolicy(arn, false) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package profilehandler | ||
|
||
import ( | ||
"encoding/json" | ||
"github.com/openshift/rosa/tests/ci/config" | ||
"github.com/openshift/rosa/tests/utils/common" | ||
"github.com/openshift/rosa/tests/utils/log" | ||
) | ||
|
||
// ParseUserData Get user data from resources.json file | ||
func ParseUserData() (*UserData, error) { | ||
var ud *UserData | ||
udContent, err := common.ReadFileContent(config.Test.UserDataFile) | ||
if err != nil { | ||
log.Logger.Errorf("Error happened when read user data: %s", err.Error()) | ||
return nil, err | ||
} | ||
err = json.Unmarshal([]byte(udContent), &ud) | ||
if err != nil { | ||
log.Logger.Errorf("Error happend when parse resource file data to UserData struct: %s", err.Error()) | ||
return nil, err | ||
} | ||
return ud, err | ||
} | ||
|
||
// ParserClusterDetail Get the cluster info from cluster-detail.json file | ||
func ParserClusterDetail() (*ClusterDetail, error) { | ||
var cd *ClusterDetail | ||
cdContent, err := common.ReadFileContent(config.Test.ClusterDetailFile) | ||
if err != nil { | ||
log.Logger.Errorf("Error happened when read cluster detail: %s", err.Error()) | ||
return nil, err | ||
} | ||
err = json.Unmarshal([]byte(cdContent), &cd) | ||
if err != nil { | ||
log.Logger.Errorf("Error happend when parse cluster detail file to ClusterDetail struct: %s", err.Error()) | ||
return nil, err | ||
} | ||
return cd, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters