#14 deprecate migration_clone_addresse in favor of migration_clone_address
	
		
			
	
		
	
	
				
					
				
			This commit is contained in:
		
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							| @@ -3,7 +3,7 @@ GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) | ||||
|  | ||||
| GOFMT ?= gofmt -s | ||||
|  | ||||
| VERSION = 0.7.2 | ||||
| VERSION = 0.7.3 | ||||
|  | ||||
| test: fmt-check | ||||
| 	go test -i $(TEST) || exit 1 | ||||
|   | ||||
| @@ -17,7 +17,7 @@ terraform { | ||||
|   required_providers { | ||||
|     gitea = { | ||||
|       source = "Lerentis/gitea" | ||||
|       version = "0.7.2" | ||||
|       version = "0.7.3" | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -72,7 +72,8 @@ Need to exist in the gitea instance | ||||
| Need to exist in the gitea instance | ||||
| - `license` (String) The license under which the source code of this repository should be. | ||||
| Need to exist in the gitea instance | ||||
| - `migration_clone_addresse` (String) | ||||
| - `migration_clone_address` (String) | ||||
| - `migration_clone_addresse` (String) DEPRECATED in favor of `migration_clone_address` | ||||
| - `migration_issue_labels` (Boolean) | ||||
| - `migration_lfs` (Boolean) | ||||
| - `migration_lfs_endpoint` (String) | ||||
|   | ||||
| @@ -12,7 +12,7 @@ resource "gitea_repository" "mirror" { | ||||
|   name                         = "terraform-provider-gitea-mirror" | ||||
|   description                  = "Mirror of Terraform Provider" | ||||
|   mirror                       = true | ||||
|   migration_clone_addresse     = "https://git.uploadfilter24.eu/lerentis/terraform-provider-gitea.git" | ||||
|   migration_clone_address      = "https://git.uploadfilter24.eu/lerentis/terraform-provider-gitea.git" | ||||
|   migration_service            = "gitea" | ||||
|   migration_service_auth_token = var.gitea_mirror_token | ||||
| } | ||||
|   | ||||
| @@ -2,7 +2,7 @@ terraform { | ||||
|   required_providers { | ||||
|     gitea = { | ||||
|       source = "terraform.local/lerentis/gitea" | ||||
|       version = "0.7.2" | ||||
|       version = "0.8.0" | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -34,7 +34,8 @@ const ( | ||||
| 	repoAllowManualMerge         string = "allow_manual_merge" | ||||
| 	repoAutodetectManualMerge    string = "autodetect_manual_merge" | ||||
| 	repoMirror                   string = "mirror" | ||||
| 	migrationCloneAddress        string = "migration_clone_addresse" | ||||
| 	migrationCloneAddresse       string = "migration_clone_addresse" | ||||
| 	migrationCloneAddress        string = "migration_clone_address" | ||||
| 	migrationService             string = "migration_service" | ||||
| 	migrationServiceAuthName     string = "migration_service_auth_username" | ||||
| 	migrationServiceAuthPassword string = "migration_service_auth_password" | ||||
| @@ -89,10 +90,18 @@ func resourceRepoCreate(d *schema.ResourceData, meta interface{}) (err error) { | ||||
| 	} | ||||
|  | ||||
| 	if (d.Get(repoMirror)).(bool) { | ||||
|  | ||||
| 		var cloneAddr string | ||||
| 		if d.Get(migrationCloneAddresse).(string) != "" { | ||||
| 			cloneAddr = d.Get(migrationCloneAddresse).(string) | ||||
| 		} else { | ||||
| 			cloneAddr = d.Get(migrationCloneAddress).(string) | ||||
| 		} | ||||
|  | ||||
| 		opts := gitea.MigrateRepoOption{ | ||||
| 			RepoName:       d.Get(repoName).(string), | ||||
| 			RepoOwner:      d.Get(repoOwner).(string), | ||||
| 			CloneAddr:      d.Get(migrationCloneAddress).(string), | ||||
| 			CloneAddr:      cloneAddr, | ||||
| 			Service:        gitea.GitServiceType(d.Get(migrationService).(string)), | ||||
| 			Mirror:         d.Get(repoMirror).(bool), | ||||
| 			Private:        d.Get(repoPrivateFlag).(bool), | ||||
| @@ -445,6 +454,13 @@ func resourceGiteaRepository() *schema.Resource { | ||||
| 				Default:  false, | ||||
| 			}, | ||||
| 			"migration_clone_addresse": { | ||||
| 				Type:        schema.TypeString, | ||||
| 				Required:    false, | ||||
| 				Optional:    true, | ||||
| 				ForceNew:    true, | ||||
| 				Description: "DEPRECATED in favor of `migration_clone_address`", | ||||
| 			}, | ||||
| 			"migration_clone_address": { | ||||
| 				Type:     schema.TypeString, | ||||
| 				Required: false, | ||||
| 				Optional: true, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user