@@ -147,6 +147,24 @@ func resourceTencentCloudTemWorkload() *schema.Resource {
147147 Description : "security groups." ,
148148 },
149149
150+ "repo_type" : {
151+ Type : schema .TypeInt ,
152+ Optional : true ,
153+ Description : "repo type when deploy: 0: tcr personal; 1: tcr enterprise; 2: public repository; 3: tem host tcr; 4: demo repo." ,
154+ },
155+
156+ "repo_server" : {
157+ Type : schema .TypeString ,
158+ Optional : true ,
159+ Description : "repo server addr when deploy by image." ,
160+ },
161+
162+ "tcr_instance_id" : {
163+ Type : schema .TypeString ,
164+ Optional : true ,
165+ Description : "tcr instance id when deploy by image." ,
166+ },
167+
150168 "env_conf" : {
151169 Type : schema .TypeList ,
152170 Optional : true ,
@@ -487,6 +505,18 @@ func resourceTencentCloudTemWorkloadCreate(d *schema.ResourceData, meta interfac
487505 }
488506 }
489507
508+ if v , ok := d .GetOk ("repo_type" ); ok {
509+ request .RepoType = helper .IntInt64 (v .(int ))
510+ }
511+
512+ if v , ok := d .GetOk ("repo_server" ); ok {
513+ request .RepoServer = helper .String (v .(string ))
514+ }
515+
516+ if v , ok := d .GetOk ("tcr_instance_id" ); ok {
517+ request .TcrInstanceId = helper .String (v .(string ))
518+ }
519+
490520 if v , ok := d .GetOk ("env_conf" ); ok {
491521 for _ , item := range v .([]interface {}) {
492522 dMap := item .(map [string ]interface {})
@@ -747,6 +777,18 @@ func resourceTencentCloudTemWorkloadRead(d *schema.ResourceData, meta interface{
747777 _ = d .Set ("security_group_ids" , workload .SecurityGroupIds )
748778 }
749779
780+ if workload .RepoType != nil {
781+ _ = d .Set ("repo_type" , workload .RepoType )
782+ }
783+
784+ if workload .RepoServer != nil {
785+ _ = d .Set ("repo_server" , workload .RepoServer )
786+ }
787+
788+ if workload .TcrInstanceId != nil {
789+ _ = d .Set ("tcr_instance_id" , workload .TcrInstanceId )
790+ }
791+
750792 if workload .EnvConf != nil {
751793 envConfList := []interface {}{}
752794 for _ , envConf := range workload .EnvConf {
@@ -924,8 +966,9 @@ func resourceTencentCloudTemWorkloadUpdate(d *schema.ResourceData, meta interfac
924966
925967 if d .HasChange ("deploy_version" ) || d .HasChange ("deploy_mode" ) || d .HasChange ("img_repo" ) || d .HasChange ("init_pod_num" ) ||
926968 d .HasChange ("cpu_spec" ) || d .HasChange ("memory_spec" ) || d .HasChange ("post_start" ) || d .HasChange ("pre_stop" ) || d .HasChange ("security_group_ids" ) ||
927- d .HasChange ("env_conf" ) || d .HasChange ("storage_confs" ) || d .HasChange ("storage_mount_confs" ) || d .HasChange ("liveness" ) ||
928- d .HasChange ("readiness" ) || d .HasChange ("startup_probe" ) || d .HasChange ("deploy_strategy_conf" ) {
969+ d .HasChange ("repo_type" ) || d .HasChange ("repo_server" ) || d .HasChange ("tcr_instance_id" ) || d .HasChange ("env_conf" ) || d .HasChange ("storage_confs" ) ||
970+ d .HasChange ("storage_mount_confs" ) || d .HasChange ("liveness" ) || d .HasChange ("readiness" ) || d .HasChange ("startup_probe" ) || d .HasChange ("deploy_strategy_conf" ) {
971+
929972 if v , ok := d .GetOk ("deploy_version" ); ok {
930973 request .DeployVersion = helper .String (v .(string ))
931974 }
@@ -966,6 +1009,18 @@ func resourceTencentCloudTemWorkloadUpdate(d *schema.ResourceData, meta interfac
9661009 }
9671010 }
9681011
1012+ if v , ok := d .GetOk ("repo_type" ); ok {
1013+ request .RepoType = helper .IntInt64 (v .(int ))
1014+ }
1015+
1016+ if v , ok := d .GetOk ("repo_server" ); ok {
1017+ request .RepoServer = helper .String (v .(string ))
1018+ }
1019+
1020+ if v , ok := d .GetOk ("tcr_instance_id" ); ok {
1021+ request .TcrInstanceId = helper .String (v .(string ))
1022+ }
1023+
9691024 if v , ok := d .GetOk ("env_conf" ); ok {
9701025 for _ , item := range v .([]interface {}) {
9711026 dMap := item .(map [string ]interface {})
0 commit comments