Skip to content

Commit

Permalink
Rename ConvertToVCS on project resource, update variables to use new …
Browse files Browse the repository at this point in the history
…function
  • Loading branch information
mik-ky committed Oct 10, 2023
1 parent 268ddd3 commit 181bb8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions octopusdeploy/resource_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func resourceProjectCreate(ctx context.Context, d *schema.ResourceData, m interf
if persistenceSettings != nil && persistenceSettings.Type() == projects.PersistenceSettingsTypeVersionControlled {
tflog.Info(ctx, "converting project to use VCS")

vcsProject, err := projects.ConvertProjectToVcs(client, createdProject, "converting project to use VCS", "", persistenceSettings.(projects.GitPersistenceSettings))
vcsProject, err := projects.ConvertToVCS(client, createdProject, "converting project to use VCS", "", persistenceSettings.(projects.GitPersistenceSettings))
if err != nil {
projects.DeleteByID(client, spaceID, createdProject.GetID())
return diag.FromErr(err)
Expand Down Expand Up @@ -132,7 +132,7 @@ func resourceProjectUpdate(ctx context.Context, d *schema.ResourceData, m interf
tflog.Info(ctx, fmt.Sprintf("converting project to use VCS (%s)", d.Id()))

project.Links["ConvertToVcs"] = convertToVcsLink
vcsProject, err := projects.ConvertProjectToVcs(client, project, "converting project to use VCS", "", versionControlSettings)
vcsProject, err := projects.ConvertToVCS(client, project, "converting project to use VCS", "", versionControlSettings)
if err != nil {
return diag.FromErr(err)
}
Expand Down
4 changes: 2 additions & 2 deletions octopusdeploy/resource_variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func resourceVariableCreate(ctx context.Context, d *schema.ResourceData, m inter

for _, v := range variableSet.Variables {
if v.Name == variable.Name && v.Type == variable.Type && (v.IsSensitive || v.Value == variable.Value) && v.Description == variable.Description && v.IsSensitive == variable.IsSensitive {
scopeMatches, _, err := client.Variables.MatchesScope(v.Scope, &variable.Scope)
scopeMatches, _, err := variables.MatchesScope(v.Scope, &variable.Scope)
if err != nil {
return diag.FromErr(err)
}
Expand Down Expand Up @@ -177,7 +177,7 @@ func resourceVariableUpdate(ctx context.Context, d *schema.ResourceData, m inter

for _, v := range variableSet.Variables {
if v.Name == variable.Name && v.Type == variable.Type && (v.IsSensitive || v.Value == variable.Value) && v.Description == variable.Description && v.IsSensitive == variable.IsSensitive {
scopeMatches, _, _ := client.Variables.MatchesScope(v.Scope, &variable.Scope)
scopeMatches, _, _ := variables.MatchesScope(v.Scope, &variable.Scope)
if scopeMatches {
if err := setVariable(ctx, d, v); err != nil {
return diag.FromErr(err)
Expand Down

0 comments on commit 181bb8b

Please sign in to comment.