Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCM-7517 | test: fix vpc client meet nil pointer when create subnets pair #43

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

xueli181114
Copy link
Contributor

Here is the log calling the vpc client

lixue@Xue-Lis-MacBook-Pro ocm-common % go run main/main.go
INFO[2024-04-22 08:43:44] Going to prepare a vpc with name xueli, on region us-east-1, with cidr 10.1.0.0/16  
INFO[2024-04-22 08:43:45] Got checkExisting set to true, will check if there is existing vpc in same name 
INFO[2024-04-22 08:43:46] Got no vpc with name xueli on region us-east-1. Going to create a new one 
INFO[2024-04-22 08:43:46] Going to create vpc and the follow resources on zones:  
INFO[2024-04-22 08:43:47] Create vpc success vpc-0e2ad6732a3511770     
INFO[2024-04-22 08:43:48] Tag resource vpc-0e2ad6732a3511770 successfully 
INFO[2024-04-22 08:43:48] Created vpc with ID vpc-0e2ad6732a3511770    
INFO[2024-04-22 08:43:48] VPC created on AWS with id: vpc-0e2ad6732a3511770 
INFO[2024-04-22 08:43:48] Modify vpc dns attribute DnsHostnames successfully for vpc-0e2ad6732a3511770 
INFO[2024-04-22 08:43:48] VPC DNS Updated on AWS with id: vpc-0e2ad6732a3511770 
INFO[2024-04-22 08:43:48] Create igw success: igw-0cffa58a930694bb5    
INFO[2024-04-22 08:43:49] Attach igw success: igw-0cffa58a930694bb5    
INFO[2024-04-22 08:43:49] Prepare vpc internetgateway for vpc vpc-0e2ad6732a3511770 
INFO[2024-04-22 08:43:49] Create subnets successfully                  
INFO[2024-04-22 08:43:49] Create vpc chain successfully. Enjoy it.     
INFO[2024-04-22 08:43:49] Going to prepare proper pair of subnets      
INFO[2024-04-22 08:43:49] Got no public subnet for current zone us-east-1a, going to create one 
INFO[2024-04-22 08:43:49] Created subnet subnet-0043b334c17de9d9f for vpc vpc-0e2ad6732a3511770 
INFO[2024-04-22 08:43:50] Created subnet with ID subnet-0043b334c17de9d9f 
INFO[2024-04-22 08:43:51] Associate route table success rtbassoc-061f2a047fd516735 
INFO[2024-04-22 08:43:52] Create route success for route table: rtb-080da11b9df5e062a 
INFO[2024-04-22 08:43:52] Tag resource subnet-0043b334c17de9d9f successfully 
INFO[2024-04-22 08:43:52] Got no proper private subnet for current zone us-east-1a, going to create one 
INFO[2024-04-22 08:43:53] Created subnet subnet-059713e54f2c26125 for vpc vpc-0e2ad6732a3511770 
INFO[2024-04-22 08:43:54] Created subnet with ID subnet-059713e54f2c26125 
INFO[2024-04-22 08:43:54] Associate route table success rtbassoc-0c2367db1fde4c885 
INFO[2024-04-22 08:43:55] Allocated EIP eipalloc-0b8a0b1de46a235a9 with ip 52.70.45.18 
INFO[2024-04-22 08:43:55] Create nat success: nat-044372149cea0116d    
INFO[2024-04-22 08:45:41] Create route success for route table: rtb-017d0643d78f20189 
INFO[2024-04-22 08:45:41] Tag resource subnet-059713e54f2c26125 successfully 
INFO[2024-04-22 08:45:41] Going to prepare proper pair of subnets      
INFO[2024-04-22 08:45:41] Subnet subnet-0043b334c17de9d9f in zone: us-east-1a, region us-east-1 
INFO[2024-04-22 08:45:41] Subnet subnet-059713e54f2c26125 in zone: us-east-1a, region us-east-1 
INFO[2024-04-22 08:45:41] Got no public subnet for current zone us-east-1b, going to create one 
INFO[2024-04-22 08:45:42] Created subnet subnet-0eba8979b2ad48cd4 for vpc vpc-0e2ad6732a3511770 
INFO[2024-04-22 08:45:42] Created subnet with ID subnet-0eba8979b2ad48cd4 
INFO[2024-04-22 08:45:43] Associate route table success rtbassoc-037fbf0ddfe82caf2 
INFO[2024-04-22 08:45:44] Create route success for route table: rtb-046df7ab6c5e5c587 
INFO[2024-04-22 08:45:44] Tag resource subnet-0eba8979b2ad48cd4 successfully 
INFO[2024-04-22 08:45:44] Got no proper private subnet for current zone us-east-1b, going to create one 
INFO[2024-04-22 08:45:45] Created subnet subnet-0597530ee22861528 for vpc vpc-0e2ad6732a3511770 
INFO[2024-04-22 08:45:46] Created subnet with ID subnet-0597530ee22861528 
INFO[2024-04-22 08:45:46] Associate route table success rtbassoc-05c21c88b9aac0fda 
INFO[2024-04-22 08:45:47] Found existing nat gateway: nat-044372149cea0116d 
INFO[2024-04-22 08:45:48] Create route success for route table: rtb-071fc4cffed6d09d3 
INFO[2024-04-22 08:45:48] Tag resource subnet-0597530ee22861528 successfully 
INFO[2024-04-22 08:45:48] Going to prepare proper pair of subnets      
INFO[2024-04-22 08:45:48] Subnet subnet-0043b334c17de9d9f in zone: us-east-1a, region us-east-1 
INFO[2024-04-22 08:45:48] Subnet subnet-059713e54f2c26125 in zone: us-east-1a, region us-east-1 
INFO[2024-04-22 08:45:48] Subnet subnet-0eba8979b2ad48cd4 in zone: us-east-1b, region us-east-1 
INFO[2024-04-22 08:45:48] Subnet subnet-0597530ee22861528 in zone: us-east-1b, region us-east-1 
INFO[2024-04-22 08:45:48] Got no public subnet for current zone us-east-1c, going to create one 
INFO[2024-04-22 08:45:49] Created subnet subnet-052b9c5ccc1cd3950 for vpc vpc-0e2ad6732a3511770 
INFO[2024-04-22 08:45:49] Created subnet with ID subnet-052b9c5ccc1cd3950 
INFO[2024-04-22 08:45:51] Associate route table success rtbassoc-09310936e40c60348 
INFO[2024-04-22 08:45:52] Create route success for route table: rtb-090b0603935e923c0 
INFO[2024-04-22 08:45:52] Tag resource subnet-052b9c5ccc1cd3950 successfully 
INFO[2024-04-22 08:45:52] Got no proper private subnet for current zone us-east-1c, going to create one 
INFO[2024-04-22 08:45:53] Created subnet subnet-05044a13b30f448fa for vpc vpc-0e2ad6732a3511770 
INFO[2024-04-22 08:45:54] Created subnet with ID subnet-05044a13b30f448fa 
INFO[2024-04-22 08:45:54] Associate route table success rtbassoc-0b6d8d600f1f1e704 
INFO[2024-04-22 08:45:55] Found existing nat gateway: nat-044372149cea0116d 
INFO[2024-04-22 08:45:56] Create route success for route table: rtb-000a387db76f5d057 
INFO[2024-04-22 08:45:56] Tag resource subnet-05044a13b30f448fa successfully 
INFO[2024-04-22 08:45:56] Cannot find proxy image of region us-east-1 in map ProxyImageMap, will copy from existing region 
INFO[2024-04-22 08:45:57] Waiting for image ami-09965289a3c4623bf status to active. Timeout after 0.000000 mins 
INFO[2024-04-22 08:51:00] Create security group sg-03cde7626a69bc498 success for vpc-0e2ad6732a3511770 
INFO[2024-04-22 08:51:00] Tag resource sg-03cde7626a69bc498 successfully 
INFO[2024-04-22 08:51:00] Created tagged security group with ID sg-03cde7626a69bc498 
INFO[2024-04-22 08:51:01] Authorize security group success sg-03cde7626a69bc498 
INFO[2024-04-22 08:51:01] Authorize security group success sg-03cde7626a69bc498 
INFO[2024-04-22 08:51:01] Authorize SG sg-03cde7626a69bc498 prepared successfully for proxy. 
INFO[2024-04-22 08:51:03] Waiting for below instances ready: i-0efbb098b76ec1927 
INFO[2024-04-22 08:51:03] Check instances status of i-0efbb098b76ec1927 
INFO[2024-04-22 08:51:03] Instance ID i-0efbb098b76ec1927 is in status of not-applicable 
INFO[2024-04-22 08:51:03] Instance ID i-0efbb098b76ec1927 is in state of pending 
INFO[2024-04-22 08:52:03] Check instances status of i-0efbb098b76ec1927 
INFO[2024-04-22 08:52:04] Instance ID i-0efbb098b76ec1927 is in status of initializing 
INFO[2024-04-22 08:52:04] Instance ID i-0efbb098b76ec1927 is in state of running 
INFO[2024-04-22 08:52:04] All instances running                        
INFO[2024-04-22 08:52:04] Launch proxy instance i-0efbb098b76ec1927 succeed 
INFO[2024-04-22 08:52:04] Tag resource i-0efbb098b76ec1927 successfully 
INFO[2024-04-22 08:52:04] Allocated EIP eipalloc-071894f5cc3801422 with ip 35.153.32.242 
INFO[2024-04-22 08:52:04] Successfully allocated EIP: 35.153.32.242    
INFO[2024-04-22 08:52:06] Successfully allocated 35.153.32.242 with instance i-0efbb098b76ec1927.
        allocation id: eipalloc-071894f5cc3801422, association id: eipassoc-0cb897d9a06fb576d 
INFO[2024-04-22 08:52:06] Prepare EIP successfully for the proxy preparation. Launch with IP: 35.153.32.242 
INFO[2024-04-22 08:54:13] Create security group sg-001080f5634e11326 success for vpc-0e2ad6732a3511770 
INFO[2024-04-22 08:54:14] Tag resource sg-001080f5634e11326 successfully 
INFO[2024-04-22 08:54:14] Created tagged security group with ID sg-001080f5634e11326 
INFO[2024-04-22 08:54:14] Authorize security group success sg-001080f5634e11326 
INFO[2024-04-22 08:54:14] Authorize security group success sg-001080f5634e11326 
INFO[2024-04-22 08:54:15] Create security group sg-0d8e3c438b9223a59 success for vpc-0e2ad6732a3511770 
INFO[2024-04-22 08:54:16] Tag resource sg-0d8e3c438b9223a59 successfully 
INFO[2024-04-22 08:54:16] Created tagged security group with ID sg-0d8e3c438b9223a59 
INFO[2024-04-22 08:54:16] Authorize security group success sg-0d8e3c438b9223a59 
INFO[2024-04-22 08:54:16] Authorize security group success sg-0d8e3c438b9223a59 
INFO[2024-04-22 08:54:16] Going to delete the vpc and follow resources by ID: vpc-0e2ad6732a3511770 
INFO[2024-04-22 08:54:16] Going to terminate proxy instances if existing 
INFO[2024-04-22 08:54:17] Terminate instances i-0efbb098b76ec1927 successfully 
INFO[2024-04-22 08:54:17] Waiting for below instances terminated: i-0efbb098b76ec1927  
INFO[2024-04-22 08:54:17] Check instances status of i-0efbb098b76ec1927 
INFO[2024-04-22 08:54:17] Instance ID i-0efbb098b76ec1927 is in status of not-applicable 
INFO[2024-04-22 08:54:17] Instance ID i-0efbb098b76ec1927 is in state of shutting-down 
INFO[2024-04-22 08:55:17] Check instances status of i-0efbb098b76ec1927 
INFO[2024-04-22 08:55:18] Instance ID i-0efbb098b76ec1927 is in status of not-applicable 
INFO[2024-04-22 08:55:18] Instance ID i-0efbb098b76ec1927 is in state of terminated 
INFO[2024-04-22 08:55:18] Terminating instances i-0efbb098b76ec1927 successfully 
INFO[2024-04-22 08:55:18] Delete vpc instances successfully            
INFO[2024-04-22 08:55:18] Going to delete proxy security group         
INFO[2024-04-22 08:55:19] Release rules successfully for SG sg-03cde7626a69bc498 
INFO[2024-04-22 08:55:20] Delete security group sg-03cde7626a69bc498 success  
INFO[2024-04-22 08:55:21] Release rules successfully for SG sg-0d8e3c438b9223a59 
INFO[2024-04-22 08:55:21] Delete security group sg-0d8e3c438b9223a59 success  
INFO[2024-04-22 08:55:22] Release rules successfully for SG sg-001080f5634e11326 
INFO[2024-04-22 08:55:23] Delete security group sg-001080f5634e11326 success  
INFO[2024-04-22 08:55:23] Delete vpc proxy security group successfully 
INFO[2024-04-22 08:55:23] Got custom rt rtb-080da11b9df5e062a          
INFO[2024-04-22 08:55:23] Got custom rt rtb-046df7ab6c5e5c587          
INFO[2024-04-22 08:55:23] Got custom rt rtb-071fc4cffed6d09d3          
INFO[2024-04-22 08:55:23] Got custom rt rtb-090b0603935e923c0          
INFO[2024-04-22 08:55:23] Got custom rt rtb-017d0643d78f20189          
INFO[2024-04-22 08:55:23] Got custom rt rtb-000a387db76f5d057          
INFO[2024-04-22 08:55:23] Got main association for rt rtb-0659fe119528d7a60 
INFO[2024-04-22 08:55:23] Disassociate route table success rtbassoc-061f2a047fd516735 
INFO[2024-04-22 08:55:25] Disassociate route table success rtbassoc-037fbf0ddfe82caf2 
INFO[2024-04-22 08:55:27] Disassociate route table success rtbassoc-05c21c88b9aac0fda 
INFO[2024-04-22 08:55:29] Disassociate route table success rtbassoc-09310936e40c60348 
INFO[2024-04-22 08:55:30] Disassociate route table success rtbassoc-0c2367db1fde4c885 
INFO[2024-04-22 08:55:33] Disassociate route table success rtbassoc-0b6d8d600f1f1e704 
INFO[2024-04-22 08:55:33] Delete vpc route tables successfully         
INFO[2024-04-22 08:55:34] Deleting nat gateway nat-044372149cea0116d   
INFO[2024-04-22 08:56:28] Delete Nat Gateway success nat-044372149cea0116d 
INFO[2024-04-22 08:56:28] Delete vpc nat gateways successfully         
INFO[2024-04-22 08:56:28] Got total clean set, going to delete other possible resource leak 
INFO[2024-04-22 08:56:32] Detach igw igw-0cffa58a930694bb5 success from vpc vpc-0e2ad6732a3511770 
INFO[2024-04-22 08:56:32] Delete igw success: igw-0cffa58a930694bb5    
INFO[2024-04-22 08:56:33] Delete subnet subnet-0eba8979b2ad48cd4 successfully  
INFO[2024-04-22 08:56:34] Delete subnet subnet-059713e54f2c26125 successfully  
INFO[2024-04-22 08:56:34] Delete subnet subnet-052b9c5ccc1cd3950 successfully  
INFO[2024-04-22 08:56:35] Delete subnet subnet-0043b334c17de9d9f successfully  
INFO[2024-04-22 08:56:35] Delete subnet subnet-0597530ee22861528 successfully  
INFO[2024-04-22 08:56:36] Delete subnet subnet-05044a13b30f448fa successfully  
INFO[2024-04-22 08:56:37] Delete vpc vpc-0e2ad6732a3511770 successfuly 

…pair

remove the testing code

Enhance

Fix failure

Fix golint check
@xueli181114
Copy link
Contributor Author

/assign @ciaranRoche @hunterkepley Can you please help to review?

Copy link
Collaborator

@ciaranRoche ciaranRoche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@ciaranRoche ciaranRoche merged commit 765ad84 into openshift-online:main Apr 22, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants