Compare commits
12 Commits
6ce5f8bf9f
...
v0.13.0
Author | SHA1 | Date | |
---|---|---|---|
bc28fe186f | |||
19062e27f0 | |||
322ad2d3c4 | |||
9e34636c29 | |||
b4b13dc3ca | |||
e5a6132b9d | |||
d71cbbd0b6 | |||
0a85957c50 | |||
f87515a453 | |||
0e8aa2bf9b | |||
1162650a73 | |||
abc332958b |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -28,7 +28,7 @@ jobs:
|
|||||||
go-version: 1.18
|
go-version: 1.18
|
||||||
- name: Import GPG key
|
- name: Import GPG key
|
||||||
id: import_gpg
|
id: import_gpg
|
||||||
uses: crazy-max/ghaction-import-gpg@v5.2.0
|
uses: crazy-max/ghaction-import-gpg@v5.3.0
|
||||||
with:
|
with:
|
||||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
passphrase: ${{ secrets.PASSPHRASE }}
|
passphrase: ${{ secrets.PASSPHRASE }}
|
||||||
|
10
Makefile
10
Makefile
@ -1,9 +1,11 @@
|
|||||||
TEST?=./gitea
|
TEST?=./gitea
|
||||||
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
|
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
|
||||||
|
ARCH?=$$(uname -m)
|
||||||
|
KERNEL?=$$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
GOFMT ?= gofmt -s
|
GOFMT ?= gofmt -s
|
||||||
|
|
||||||
VERSION = 0.12.2
|
VERSION = 0.13.0
|
||||||
|
|
||||||
test: fmt-check
|
test: fmt-check
|
||||||
go test -i $(TEST) || exit 1
|
go test -i $(TEST) || exit 1
|
||||||
@ -34,8 +36,8 @@ build:
|
|||||||
go build -ldflags="-X 'main.Version=${VERSION}'" -o terraform-provider-gitea_${VERSION}
|
go build -ldflags="-X 'main.Version=${VERSION}'" -o terraform-provider-gitea_${VERSION}
|
||||||
install: build
|
install: build
|
||||||
@echo installing to
|
@echo installing to
|
||||||
@echo ~/.terraform.d/plugins/terraform.local/lerentis/gitea/${VERSION}/linux_amd64/terraform-provider-gitea_${VERSION}
|
@echo ~/.terraform.d/plugins/terraform.local/lerentis/gitea/${VERSION}/${KERNEL}_${ARCH}/terraform-provider-gitea_${VERSION}
|
||||||
@mkdir -p ~/.terraform.d/plugins/terraform.local/lerentis/gitea/${VERSION}/linux_amd64
|
@mkdir -p ~/.terraform.d/plugins/terraform.local/lerentis/gitea/${VERSION}/${KERNEL}_${ARCH}
|
||||||
@mv terraform-provider-gitea_${VERSION} ~/.terraform.d/plugins/terraform.local/lerentis/gitea/${VERSION}/linux_amd64/terraform-provider-gitea_${VERSION}
|
@mv terraform-provider-gitea_${VERSION} ~/.terraform.d/plugins/terraform.local/lerentis/gitea/${VERSION}/${KERNEL}_${ARCH}/terraform-provider-gitea_${VERSION}
|
||||||
doc:
|
doc:
|
||||||
tfplugindocs
|
tfplugindocs
|
||||||
|
@ -17,7 +17,7 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
gitea = {
|
gitea = {
|
||||||
source = "Lerentis/gitea"
|
source = "Lerentis/gitea"
|
||||||
version = "0.12.2"
|
version = "0.13.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
gitea = {
|
gitea = {
|
||||||
source = "Lerentis/gitea"
|
source = "Lerentis/gitea"
|
||||||
version = "0.12.2"
|
version = "0.13.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ description: |-
|
|||||||
Per default this repository will be initializiled with the provided configuration (gitignore, License etc.).
|
Per default this repository will be initializiled with the provided configuration (gitignore, License etc.).
|
||||||
If the username property is set to a organisation name, the provider will try to look if this organisation exists and create the repository under the organisation scope.
|
If the username property is set to a organisation name, the provider will try to look if this organisation exists and create the repository under the organisation scope.
|
||||||
Repository migrations have some properties that are not available to regular repositories. These are all prefixed with migration_.
|
Repository migrations have some properties that are not available to regular repositories. These are all prefixed with migration_.
|
||||||
|
Codeberg.org does currently not allow mirrors to be created. See FAQ Section of CodeBerg for more information: https://docs.codeberg.org/getting-started/faq/#why-am-i-not-allowed-to-set-up-an-automatic-mirror
|
||||||
---
|
---
|
||||||
|
|
||||||
# gitea_repository (Resource)
|
# gitea_repository (Resource)
|
||||||
@ -17,6 +18,7 @@ Per default this repository will be initializiled with the provided configuratio
|
|||||||
If the `username` property is set to a organisation name, the provider will try to look if this organisation exists and create the repository under the organisation scope.
|
If the `username` property is set to a organisation name, the provider will try to look if this organisation exists and create the repository under the organisation scope.
|
||||||
|
|
||||||
Repository migrations have some properties that are not available to regular repositories. These are all prefixed with `migration_`.
|
Repository migrations have some properties that are not available to regular repositories. These are all prefixed with `migration_`.
|
||||||
|
Codeberg.org does currently not allow mirrors to be created. See FAQ Section of CodeBerg for more information: https://docs.codeberg.org/getting-started/faq/#why-am-i-not-allowed-to-set-up-an-automatic-mirror
|
||||||
|
|
||||||
## Example Usage
|
## Example Usage
|
||||||
|
|
||||||
|
@ -34,6 +34,26 @@ resource "gitea_team" "test_team" {
|
|||||||
permission = "write"
|
permission = "write"
|
||||||
members = [gitea_user.test.username]
|
members = [gitea_user.test.username]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
resource "gitea_repository" "test" {
|
||||||
|
username = gitea_org.test_org.name
|
||||||
|
name = "test"
|
||||||
|
private = true
|
||||||
|
issue_labels = "Default"
|
||||||
|
license = "MIT"
|
||||||
|
gitignores = "Go"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "gitea_team" "test_team_restricted" {
|
||||||
|
name = "Restricted Devs"
|
||||||
|
organisation = gitea_org.test_org.name
|
||||||
|
description = "Restricted Devs of Test Org"
|
||||||
|
permission = "write"
|
||||||
|
members = [gitea_user.test.username]
|
||||||
|
include_all_repositories = false
|
||||||
|
repositories = [gitea_repository.test.name]
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
<!-- schema generated by tfplugindocs -->
|
||||||
@ -52,6 +72,7 @@ resource "gitea_team" "test_team" {
|
|||||||
- `members` (List of String) List of Users that should be part of this team
|
- `members` (List of String) List of Users that should be part of this team
|
||||||
- `permission` (String) Permissions associated with this Team
|
- `permission` (String) Permissions associated with this Team
|
||||||
Can be `none`, `read`, `write`, `admin` or `owner`
|
Can be `none`, `read`, `write`, `admin` or `owner`
|
||||||
|
- `repositories` (List of String) List of Repositories that should be part of this team
|
||||||
- `units` (String) List of types of Repositories that should be allowed to be created from Team members.
|
- `units` (String) List of types of Repositories that should be allowed to be created from Team members.
|
||||||
Can be `repo.code`, `repo.issues`, `repo.ext_issues`, `repo.wiki`, `repo.pulls`, `repo.releases`, `repo.projects` and/or `repo.ext_wiki`
|
Can be `repo.code`, `repo.issues`, `repo.ext_issues`, `repo.wiki`, `repo.pulls`, `repo.releases`, `repo.projects` and/or `repo.ext_wiki`
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
gitea = {
|
gitea = {
|
||||||
source = "terraform.local/lerentis/gitea"
|
source = "terraform.local/lerentis/gitea"
|
||||||
version = "0.12.2"
|
version = "0.13.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
gitea = {
|
gitea = {
|
||||||
source = "Lerentis/gitea"
|
source = "Lerentis/gitea"
|
||||||
version = "0.12.2"
|
version = "0.13.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,3 +19,23 @@ resource "gitea_team" "test_team" {
|
|||||||
permission = "write"
|
permission = "write"
|
||||||
members = [gitea_user.test.username]
|
members = [gitea_user.test.username]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
resource "gitea_repository" "test" {
|
||||||
|
username = gitea_org.test_org.name
|
||||||
|
name = "test"
|
||||||
|
private = true
|
||||||
|
issue_labels = "Default"
|
||||||
|
license = "MIT"
|
||||||
|
gitignores = "Go"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "gitea_team" "test_team_restricted" {
|
||||||
|
name = "Restricted Devs"
|
||||||
|
organisation = gitea_org.test_org.name
|
||||||
|
description = "Restricted Devs of Test Org"
|
||||||
|
permission = "write"
|
||||||
|
members = [gitea_user.test.username]
|
||||||
|
include_all_repositories = false
|
||||||
|
repositories = [gitea_repository.test.name]
|
||||||
|
}
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
package gitea
|
package gitea
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"code.gitea.io/sdk/gitea"
|
"code.gitea.io/sdk/gitea"
|
||||||
|
"github.com/hashicorp/terraform-plugin-log/tflog"
|
||||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -108,15 +111,21 @@ func resourceRepoCreate(d *schema.ResourceData, meta interface{}) (err error) {
|
|||||||
|
|
||||||
var repo *gitea.Repository
|
var repo *gitea.Repository
|
||||||
var resp *gitea.Response
|
var resp *gitea.Response
|
||||||
var orgRepo bool
|
var orgRepo, hasAdmin bool
|
||||||
|
|
||||||
_, resp, err = client.GetOrg(d.Get(repoOwner).(string))
|
_, resp, err = client.GetOrg(d.Get(repoOwner).(string))
|
||||||
|
|
||||||
if resp.StatusCode == 404 {
|
if resp.StatusCode == 404 {
|
||||||
_, err := searchUserByName(client, d.Get(repoOwner).(string))
|
_, err := searchUserByName(client, d.Get(repoOwner).(string))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if strings.Contains(err.Error(), "could not be found") {
|
||||||
return errors.New(fmt.Sprintf("Creation of repository cound not proceed as owner %s is not present in gitea", d.Get(repoOwner).(string)))
|
return errors.New(fmt.Sprintf("Creation of repository cound not proceed as owner %s is not present in gitea", d.Get(repoOwner).(string)))
|
||||||
}
|
}
|
||||||
|
tflog.Warn(context.Background(), "Error query for users. Assuming missing permissions and proceding with user permissions")
|
||||||
|
hasAdmin = false
|
||||||
|
} else {
|
||||||
|
hasAdmin = true
|
||||||
|
}
|
||||||
orgRepo = false
|
orgRepo = false
|
||||||
} else {
|
} else {
|
||||||
orgRepo = true
|
orgRepo = true
|
||||||
@ -180,7 +189,11 @@ func resourceRepoCreate(d *schema.ResourceData, meta interface{}) (err error) {
|
|||||||
if orgRepo {
|
if orgRepo {
|
||||||
repo, _, err = client.CreateOrgRepo(d.Get(repoOwner).(string), opts)
|
repo, _, err = client.CreateOrgRepo(d.Get(repoOwner).(string), opts)
|
||||||
} else {
|
} else {
|
||||||
|
if hasAdmin {
|
||||||
repo, _, err = client.AdminCreateRepo(d.Get(repoOwner).(string), opts)
|
repo, _, err = client.AdminCreateRepo(d.Get(repoOwner).(string), opts)
|
||||||
|
} else {
|
||||||
|
repo, _, err = client.CreateRepo(opts)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -580,6 +593,8 @@ func resourceGiteaRepository() *schema.Resource {
|
|||||||
"Per default this repository will be initializiled with the provided configuration (gitignore, License etc.).\n" +
|
"Per default this repository will be initializiled with the provided configuration (gitignore, License etc.).\n" +
|
||||||
"If the `username` property is set to a organisation name, the provider will try to look if this organisation exists " +
|
"If the `username` property is set to a organisation name, the provider will try to look if this organisation exists " +
|
||||||
"and create the repository under the organisation scope.\n\n" +
|
"and create the repository under the organisation scope.\n\n" +
|
||||||
"Repository migrations have some properties that are not available to regular repositories. These are all prefixed with `migration_`.",
|
"Repository migrations have some properties that are not available to regular repositories. These are all prefixed with `migration_`.\n" +
|
||||||
|
"Codeberg.org does currently not allow mirrors to be created. See FAQ Section of CodeBerg for more information: " +
|
||||||
|
"https://docs.codeberg.org/getting-started/faq/#why-am-i-not-allowed-to-set-up-an-automatic-mirror",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package gitea
|
package gitea
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -18,6 +19,7 @@ const (
|
|||||||
TeamIncludeAllReposFlag string = "include_all_repositories"
|
TeamIncludeAllReposFlag string = "include_all_repositories"
|
||||||
TeamUnits string = "units"
|
TeamUnits string = "units"
|
||||||
TeamMembers string = "members"
|
TeamMembers string = "members"
|
||||||
|
TeamRepositories string = "repositories"
|
||||||
)
|
)
|
||||||
|
|
||||||
func resourceTeamRead(d *schema.ResourceData, meta interface{}) (err error) {
|
func resourceTeamRead(d *schema.ResourceData, meta interface{}) (err error) {
|
||||||
@ -75,12 +77,14 @@ func resourceTeamCreate(d *schema.ResourceData, meta interface{}) (err error) {
|
|||||||
units = append(units, gitea.RepoUnitProjects)
|
units = append(units, gitea.RepoUnitProjects)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
includeAllRepos := d.Get(TeamIncludeAllReposFlag).(bool)
|
||||||
|
|
||||||
opts := gitea.CreateTeamOption{
|
opts := gitea.CreateTeamOption{
|
||||||
Name: d.Get(TeamName).(string),
|
Name: d.Get(TeamName).(string),
|
||||||
Description: d.Get(TeamDescription).(string),
|
Description: d.Get(TeamDescription).(string),
|
||||||
Permission: gitea.AccessMode(d.Get(TeamPermissions).(string)),
|
Permission: gitea.AccessMode(d.Get(TeamPermissions).(string)),
|
||||||
CanCreateOrgRepo: d.Get(TeamCreateRepoFlag).(bool),
|
CanCreateOrgRepo: d.Get(TeamCreateRepoFlag).(bool),
|
||||||
IncludesAllRepositories: d.Get(TeamIncludeAllReposFlag).(bool),
|
IncludesAllRepositories: includeAllRepos,
|
||||||
Units: units,
|
Units: units,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,6 +105,13 @@ func resourceTeamCreate(d *schema.ResourceData, meta interface{}) (err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !includeAllRepos {
|
||||||
|
err = setTeamRepositories(team, d, meta, false)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
err = setTeamResourceData(team, d)
|
err = setTeamResourceData(team, d)
|
||||||
|
|
||||||
return
|
return
|
||||||
@ -181,6 +192,13 @@ func resourceTeamUpdate(d *schema.ResourceData, meta interface{}) (err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !includeAllRepos {
|
||||||
|
err = setTeamRepositories(team, d, meta, true)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
team, _, _ = client.GetTeam(id)
|
team, _, _ = client.GetTeam(id)
|
||||||
|
|
||||||
err = setTeamResourceData(team, d)
|
err = setTeamResourceData(team, d)
|
||||||
@ -218,6 +236,7 @@ func setTeamResourceData(team *gitea.Team, d *schema.ResourceData) (err error) {
|
|||||||
d.Set(TeamUnits, d.Get(TeamUnits).(string))
|
d.Set(TeamUnits, d.Get(TeamUnits).(string))
|
||||||
d.Set(TeamOrg, d.Get(TeamOrg).(string))
|
d.Set(TeamOrg, d.Get(TeamOrg).(string))
|
||||||
d.Set(TeamMembers, d.Get(TeamMembers))
|
d.Set(TeamMembers, d.Get(TeamMembers))
|
||||||
|
d.Set(TeamRepositories, d.Get(TeamRepositories))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,7 +309,75 @@ func resourceGiteaTeam() *schema.Resource {
|
|||||||
Computed: true,
|
Computed: true,
|
||||||
Description: "List of Users that should be part of this team",
|
Description: "List of Users that should be part of this team",
|
||||||
},
|
},
|
||||||
|
"repositories": {
|
||||||
|
Type: schema.TypeList,
|
||||||
|
Elem: &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
},
|
||||||
|
Optional: true,
|
||||||
|
Required: false,
|
||||||
|
Computed: true,
|
||||||
|
Description: "List of Repositories that should be part of this team",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Description: "`gitea_team` manages Team that are part of an organisation.",
|
Description: "`gitea_team` manages Team that are part of an organisation.",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setTeamRepositories(team *gitea.Team, d *schema.ResourceData, meta interface{}, update bool) (err error) {
|
||||||
|
client := meta.(*gitea.Client)
|
||||||
|
|
||||||
|
org := d.Get(TeamOrg).(string)
|
||||||
|
|
||||||
|
repositories := make(map[string]bool)
|
||||||
|
for _, repo := range d.Get(TeamRepositories).([]interface{}) {
|
||||||
|
if repo != "" {
|
||||||
|
repositories[repo.(string)] = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if update {
|
||||||
|
page := 1
|
||||||
|
|
||||||
|
for {
|
||||||
|
var existingRepositories []*gitea.Repository
|
||||||
|
existingRepositories, _, err = client.ListTeamRepositories(team.ID, gitea.ListTeamRepositoriesOptions{
|
||||||
|
ListOptions: gitea.ListOptions{
|
||||||
|
Page: page,
|
||||||
|
PageSize: 50,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return errors.New(fmt.Sprintf("[ERROR] Error listeng team repositories: %s", err))
|
||||||
|
}
|
||||||
|
if len(existingRepositories) == 0 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, exr := range existingRepositories {
|
||||||
|
_, exists := repositories[exr.Name]
|
||||||
|
if exists {
|
||||||
|
repositories[exr.Name] = false
|
||||||
|
} else {
|
||||||
|
_, err = client.RemoveTeamRepository(team.ID, org, exr.Name)
|
||||||
|
if err != nil {
|
||||||
|
return errors.New(fmt.Sprintf("[ERROR] Error removing team repository %q: %s", exr.Name, err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
page += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for repo, flag := range repositories {
|
||||||
|
if flag {
|
||||||
|
_, err = client.AddTeamRepository(team.ID, org, repo)
|
||||||
|
if err != nil {
|
||||||
|
return errors.New(fmt.Sprintf("[ERROR] Error adding team repository %q: %s", repo, err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
10
go.mod
10
go.mod
@ -4,8 +4,9 @@ go 1.18
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
code.gitea.io/sdk/gitea v0.15.1
|
code.gitea.io/sdk/gitea v0.15.1
|
||||||
github.com/hashicorp/terraform-plugin-docs v0.13.0
|
github.com/hashicorp/terraform-plugin-docs v0.14.1
|
||||||
github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.0
|
github.com/hashicorp/terraform-plugin-log v0.8.0
|
||||||
|
github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@ -35,14 +36,13 @@ require (
|
|||||||
github.com/hashicorp/terraform-exec v0.18.1 // indirect
|
github.com/hashicorp/terraform-exec v0.18.1 // indirect
|
||||||
github.com/hashicorp/terraform-json v0.16.0 // indirect
|
github.com/hashicorp/terraform-json v0.16.0 // indirect
|
||||||
github.com/hashicorp/terraform-plugin-go v0.14.3 // indirect
|
github.com/hashicorp/terraform-plugin-go v0.14.3 // indirect
|
||||||
github.com/hashicorp/terraform-plugin-log v0.8.0 // indirect
|
|
||||||
github.com/hashicorp/terraform-registry-address v0.1.0 // indirect
|
github.com/hashicorp/terraform-registry-address v0.1.0 // indirect
|
||||||
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect
|
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect
|
||||||
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
|
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
|
||||||
github.com/huandu/xstrings v1.3.2 // indirect
|
github.com/huandu/xstrings v1.3.2 // indirect
|
||||||
github.com/imdario/mergo v0.3.13 // indirect
|
github.com/imdario/mergo v0.3.13 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.12 // indirect
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
github.com/mattn/go-isatty v0.0.16 // indirect
|
||||||
github.com/mitchellh/cli v1.1.5 // indirect
|
github.com/mitchellh/cli v1.1.5 // indirect
|
||||||
github.com/mitchellh/copystructure v1.2.0 // indirect
|
github.com/mitchellh/copystructure v1.2.0 // indirect
|
||||||
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
|
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
|
||||||
|
15
go.sum
15
go.sum
@ -118,14 +118,14 @@ github.com/hashicorp/terraform-exec v0.18.1 h1:LAbfDvNQU1l0NOQlTuudjczVhHj061fNX
|
|||||||
github.com/hashicorp/terraform-exec v0.18.1/go.mod h1:58wg4IeuAJ6LVsLUeD2DWZZoc/bYi6dzhLHzxM41980=
|
github.com/hashicorp/terraform-exec v0.18.1/go.mod h1:58wg4IeuAJ6LVsLUeD2DWZZoc/bYi6dzhLHzxM41980=
|
||||||
github.com/hashicorp/terraform-json v0.16.0 h1:UKkeWRWb23do5LNAFlh/K3N0ymn1qTOO8c+85Albo3s=
|
github.com/hashicorp/terraform-json v0.16.0 h1:UKkeWRWb23do5LNAFlh/K3N0ymn1qTOO8c+85Albo3s=
|
||||||
github.com/hashicorp/terraform-json v0.16.0/go.mod h1:v0Ufk9jJnk6tcIZvScHvetlKfiNTC+WS21mnXIlc0B0=
|
github.com/hashicorp/terraform-json v0.16.0/go.mod h1:v0Ufk9jJnk6tcIZvScHvetlKfiNTC+WS21mnXIlc0B0=
|
||||||
github.com/hashicorp/terraform-plugin-docs v0.13.0 h1:6e+VIWsVGb6jYJewfzq2ok2smPzZrt1Wlm9koLeKazY=
|
github.com/hashicorp/terraform-plugin-docs v0.14.1 h1:MikFi59KxrP/ewrZoaowrB9he5Vu4FtvhamZFustiA4=
|
||||||
github.com/hashicorp/terraform-plugin-docs v0.13.0/go.mod h1:W0oCmHAjIlTHBbvtppWHe8fLfZ2BznQbuv8+UD8OucQ=
|
github.com/hashicorp/terraform-plugin-docs v0.14.1/go.mod h1:k2NW8+t113jAus6bb5tQYQgEAX/KueE/u8X2Z45V1GM=
|
||||||
github.com/hashicorp/terraform-plugin-go v0.14.3 h1:nlnJ1GXKdMwsC8g1Nh05tK2wsC3+3BL/DBBxFEki+j0=
|
github.com/hashicorp/terraform-plugin-go v0.14.3 h1:nlnJ1GXKdMwsC8g1Nh05tK2wsC3+3BL/DBBxFEki+j0=
|
||||||
github.com/hashicorp/terraform-plugin-go v0.14.3/go.mod h1:7ees7DMZ263q8wQ6E4RdIdR6nHHJtrdt4ogX5lPkX1A=
|
github.com/hashicorp/terraform-plugin-go v0.14.3/go.mod h1:7ees7DMZ263q8wQ6E4RdIdR6nHHJtrdt4ogX5lPkX1A=
|
||||||
github.com/hashicorp/terraform-plugin-log v0.8.0 h1:pX2VQ/TGKu+UU1rCay0OlzosNKe4Nz1pepLXj95oyy0=
|
github.com/hashicorp/terraform-plugin-log v0.8.0 h1:pX2VQ/TGKu+UU1rCay0OlzosNKe4Nz1pepLXj95oyy0=
|
||||||
github.com/hashicorp/terraform-plugin-log v0.8.0/go.mod h1:1myFrhVsBLeylQzYYEV17VVjtG8oYPRFdaZs7xdW2xs=
|
github.com/hashicorp/terraform-plugin-log v0.8.0/go.mod h1:1myFrhVsBLeylQzYYEV17VVjtG8oYPRFdaZs7xdW2xs=
|
||||||
github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.0 h1:We3H/dXP7Q0YH4YsBY6DAVj+Ur6PDFC+Yt1btGhTeMs=
|
github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 h1:G9WAfb8LHeCxu7Ae8nc1agZlQOSCUWsb610iAogBhCs=
|
||||||
github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.0/go.mod h1:xcOSYlRVdPLmDUoqPhO9fiO/YCN/l6MGYeTzGt5jgkQ=
|
github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1/go.mod h1:xcOSYlRVdPLmDUoqPhO9fiO/YCN/l6MGYeTzGt5jgkQ=
|
||||||
github.com/hashicorp/terraform-registry-address v0.1.0 h1:W6JkV9wbum+m516rCl5/NjKxCyTVaaUBbzYcMzBDO3U=
|
github.com/hashicorp/terraform-registry-address v0.1.0 h1:W6JkV9wbum+m516rCl5/NjKxCyTVaaUBbzYcMzBDO3U=
|
||||||
github.com/hashicorp/terraform-registry-address v0.1.0/go.mod h1:EnyO2jYO6j29DTHbJcm00E5nQTFeTtyZH3H5ycydQ5A=
|
github.com/hashicorp/terraform-registry-address v0.1.0/go.mod h1:EnyO2jYO6j29DTHbJcm00E5nQTFeTtyZH3H5ycydQ5A=
|
||||||
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0=
|
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0=
|
||||||
@ -158,12 +158,14 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
|
|||||||
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
|
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
|
||||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||||
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||||
github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
|
|
||||||
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||||
|
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||||
|
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||||
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
|
|
||||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||||
|
github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ=
|
||||||
|
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||||
github.com/mitchellh/cli v1.1.5 h1:OxRIeJXpAMztws/XHlN2vu6imG5Dpq+j61AzAX5fLng=
|
github.com/mitchellh/cli v1.1.5 h1:OxRIeJXpAMztws/XHlN2vu6imG5Dpq+j61AzAX5fLng=
|
||||||
github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4=
|
github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4=
|
||||||
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
|
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
|
||||||
@ -292,6 +294,7 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||||||
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
|
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
|
||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
2
vendor/github.com/hashicorp/terraform-plugin-docs/LICENSE
generated
vendored
2
vendor/github.com/hashicorp/terraform-plugin-docs/LICENSE
generated
vendored
@ -1,3 +1,5 @@
|
|||||||
|
Copyright (c) 2020 HashiCorp, Inc.
|
||||||
|
|
||||||
Mozilla Public License Version 2.0
|
Mozilla Public License Version 2.0
|
||||||
==================================
|
==================================
|
||||||
|
|
||||||
|
2
vendor/github.com/hashicorp/terraform-plugin-docs/internal/cmd/generate.go
generated
vendored
2
vendor/github.com/hashicorp/terraform-plugin-docs/internal/cmd/generate.go
generated
vendored
@ -42,7 +42,7 @@ func (cmd *generateCmd) Help() string {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
strBuilder.WriteString(fmt.Sprintf("\nUsage: tfplugindocs generate [<args>]\n\n"))
|
strBuilder.WriteString("\nUsage: tfplugindocs generate [<args>]\n\n")
|
||||||
cmd.Flags().VisitAll(func(f *flag.Flag) {
|
cmd.Flags().VisitAll(func(f *flag.Flag) {
|
||||||
if f.DefValue != "" {
|
if f.DefValue != "" {
|
||||||
strBuilder.WriteString(fmt.Sprintf(" --%s <ARG> %s%s%s (default: %q)\n",
|
strBuilder.WriteString(fmt.Sprintf(" --%s <ARG> %s%s%s (default: %q)\n",
|
||||||
|
2
vendor/github.com/hashicorp/terraform-plugin-docs/internal/cmd/validate.go
generated
vendored
2
vendor/github.com/hashicorp/terraform-plugin-docs/internal/cmd/validate.go
generated
vendored
@ -30,7 +30,7 @@ func (cmd *validateCmd) Help() string {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
strBuilder.WriteString(fmt.Sprintf("\nUsage: tfplugindocs validate [<args>]\n\n"))
|
strBuilder.WriteString("\nUsage: tfplugindocs validate [<args>]\n\n")
|
||||||
cmd.Flags().VisitAll(func(f *flag.Flag) {
|
cmd.Flags().VisitAll(func(f *flag.Flag) {
|
||||||
if f.DefValue != "" {
|
if f.DefValue != "" {
|
||||||
strBuilder.WriteString(fmt.Sprintf(" --%s <ARG> %s%s%s (default: %q)\n",
|
strBuilder.WriteString(fmt.Sprintf(" --%s <ARG> %s%s%s (default: %q)\n",
|
||||||
|
37
vendor/github.com/hashicorp/terraform-plugin-docs/internal/mdplain/renderer.go
generated
vendored
37
vendor/github.com/hashicorp/terraform-plugin-docs/internal/mdplain/renderer.go
generated
vendored
@ -130,13 +130,9 @@ func (options *Text) Emphasis(out *bytes.Buffer, text []byte) {
|
|||||||
out.Write(text)
|
out.Write(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Text) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) {
|
func (options *Text) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) {}
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (options *Text) LineBreak(out *bytes.Buffer) {
|
func (options *Text) LineBreak(out *bytes.Buffer) {}
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (options *Text) Link(out *bytes.Buffer, link []byte, title []byte, content []byte) {
|
func (options *Text) Link(out *bytes.Buffer, link []byte, title []byte, content []byte) {
|
||||||
out.Write(content)
|
out.Write(content)
|
||||||
@ -144,12 +140,9 @@ func (options *Text) Link(out *bytes.Buffer, link []byte, title []byte, content
|
|||||||
out.WriteString(" ")
|
out.WriteString(" ")
|
||||||
out.Write(link)
|
out.Write(link)
|
||||||
}
|
}
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Text) RawHtmlTag(out *bytes.Buffer, text []byte) {
|
func (options *Text) RawHtmlTag(out *bytes.Buffer, text []byte) {}
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (options *Text) TripleEmphasis(out *bytes.Buffer, text []byte) {
|
func (options *Text) TripleEmphasis(out *bytes.Buffer, text []byte) {
|
||||||
out.Write(text)
|
out.Write(text)
|
||||||
@ -159,9 +152,7 @@ func (options *Text) StrikeThrough(out *bytes.Buffer, text []byte) {
|
|||||||
out.Write(text)
|
out.Write(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Text) FootnoteRef(out *bytes.Buffer, ref []byte, id int) {
|
func (options *Text) FootnoteRef(out *bytes.Buffer, ref []byte, id int) {}
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (options *Text) Entity(out *bytes.Buffer, entity []byte) {
|
func (options *Text) Entity(out *bytes.Buffer, entity []byte) {
|
||||||
out.Write(entity)
|
out.Write(entity)
|
||||||
@ -171,25 +162,15 @@ func (options *Text) NormalText(out *bytes.Buffer, text []byte) {
|
|||||||
out.Write(text)
|
out.Write(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Text) Smartypants(out *bytes.Buffer, text []byte) {
|
func (options *Text) Smartypants(out *bytes.Buffer, text []byte) {}
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (options *Text) DocumentHeader(out *bytes.Buffer) {
|
func (options *Text) DocumentHeader(out *bytes.Buffer) {}
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (options *Text) DocumentFooter(out *bytes.Buffer) {
|
func (options *Text) DocumentFooter(out *bytes.Buffer) {}
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (options *Text) TocHeader(text []byte, level int) {
|
func (options *Text) TocHeader(text []byte, level int) {}
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (options *Text) TocFinalize() {
|
func (options *Text) TocFinalize() {}
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func doubleSpace(out *bytes.Buffer) {
|
func doubleSpace(out *bytes.Buffer) {
|
||||||
if out.Len() > 0 {
|
if out.Len() > 0 {
|
||||||
|
11
vendor/github.com/hashicorp/terraform-plugin-docs/internal/provider/generate.go
generated
vendored
11
vendor/github.com/hashicorp/terraform-plugin-docs/internal/provider/generate.go
generated
vendored
@ -3,7 +3,6 @@ package provider
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -128,7 +127,7 @@ func (g *generator) Generate(ctx context.Context) error {
|
|||||||
|
|
||||||
switch {
|
switch {
|
||||||
case g.websiteTmpDir == "":
|
case g.websiteTmpDir == "":
|
||||||
g.websiteTmpDir, err = ioutil.TempDir("", "tfws")
|
g.websiteTmpDir, err = os.MkdirTemp("", "tfws")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -249,7 +248,7 @@ func (g *generator) renderMissingResourceDoc(providerName, name, typeName string
|
|||||||
fallbackTmplPath = filepath.Join(g.websiteTmpDir, g.websiteSourceDir, fallbackTmplPath)
|
fallbackTmplPath = filepath.Join(g.websiteTmpDir, g.websiteSourceDir, fallbackTmplPath)
|
||||||
if fileExists(fallbackTmplPath) {
|
if fileExists(fallbackTmplPath) {
|
||||||
g.infof("resource %q fallback template exists", name)
|
g.infof("resource %q fallback template exists", name)
|
||||||
tmplData, err := ioutil.ReadFile(fallbackTmplPath)
|
tmplData, err := os.ReadFile(fallbackTmplPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to read file %q: %w", fallbackTmplPath, err)
|
return fmt.Errorf("unable to read file %q: %w", fallbackTmplPath, err)
|
||||||
}
|
}
|
||||||
@ -377,7 +376,7 @@ func (g *generator) renderStaticWebsite(providerName string, providerSchema *tfj
|
|||||||
|
|
||||||
g.infof("rendering templated website to static markdown")
|
g.infof("rendering templated website to static markdown")
|
||||||
|
|
||||||
err = filepath.Walk(g.websiteTmpDir, func(path string, info os.FileInfo, err error) error {
|
err = filepath.Walk(g.websiteTmpDir, func(path string, info os.FileInfo, _ error) error {
|
||||||
if info.IsDir() {
|
if info.IsDir() {
|
||||||
// skip directories
|
// skip directories
|
||||||
return nil
|
return nil
|
||||||
@ -410,7 +409,7 @@ func (g *generator) renderStaticWebsite(providerName string, providerSchema *tfj
|
|||||||
|
|
||||||
renderedPath = strings.TrimSuffix(renderedPath, ext)
|
renderedPath = strings.TrimSuffix(renderedPath, ext)
|
||||||
|
|
||||||
tmplData, err := ioutil.ReadFile(path)
|
tmplData, err := os.ReadFile(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to read file %q: %w", rel, err)
|
return fmt.Errorf("unable to read file %q: %w", rel, err)
|
||||||
}
|
}
|
||||||
@ -492,7 +491,7 @@ func (g *generator) terraformProviderSchema(ctx context.Context, providerName st
|
|||||||
|
|
||||||
shortName := providerShortName(providerName)
|
shortName := providerShortName(providerName)
|
||||||
|
|
||||||
tmpDir, err := ioutil.TempDir("", "tfws")
|
tmpDir, err := os.MkdirTemp("", "tfws")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
5
vendor/github.com/hashicorp/terraform-plugin-docs/internal/provider/util.go
generated
vendored
5
vendor/github.com/hashicorp/terraform-plugin-docs/internal/provider/util.go
generated
vendored
@ -3,7 +3,6 @@ package provider
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
@ -78,7 +77,7 @@ func writeFile(path string, data string) error {
|
|||||||
return fmt.Errorf("unable to make dir %q: %w", dir, err)
|
return fmt.Errorf("unable to make dir %q: %w", dir, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = ioutil.WriteFile(path, []byte(data), 0644)
|
err = os.WriteFile(path, []byte(data), 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to write file %q: %w", path, err)
|
return fmt.Errorf("unable to write file %q: %w", path, err)
|
||||||
}
|
}
|
||||||
@ -90,7 +89,7 @@ func runCmd(cmd *exec.Cmd) ([]byte, error) {
|
|||||||
output, err := cmd.CombinedOutput()
|
output, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("error executing %q, %v", cmd.Path, cmd.Args)
|
log.Printf("error executing %q, %v", cmd.Path, cmd.Args)
|
||||||
log.Printf(string(output))
|
log.Print(string(output))
|
||||||
return nil, fmt.Errorf("error executing %q: %w", cmd.Path, err)
|
return nil, fmt.Errorf("error executing %q: %w", cmd.Path, err)
|
||||||
}
|
}
|
||||||
return output, nil
|
return output, nil
|
||||||
|
3
vendor/github.com/hashicorp/terraform-plugin-docs/internal/tmplfuncs/tmplfuncs.go
generated
vendored
3
vendor/github.com/hashicorp/terraform-plugin-docs/internal/tmplfuncs/tmplfuncs.go
generated
vendored
@ -2,7 +2,6 @@ package tmplfuncs
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@ -21,7 +20,7 @@ func CodeFile(format, file string) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fullPath := filepath.Join(wd, file)
|
fullPath := filepath.Join(wd, file)
|
||||||
content, err := ioutil.ReadFile(fullPath)
|
content, err := os.ReadFile(fullPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("unable to read content from %q: %w", file, err)
|
return "", fmt.Errorf("unable to read content from %q: %w", file, err)
|
||||||
}
|
}
|
||||||
|
2
vendor/github.com/hashicorp/terraform-plugin-docs/schemamd/render.go
generated
vendored
2
vendor/github.com/hashicorp/terraform-plugin-docs/schemamd/render.go
generated
vendored
@ -12,6 +12,7 @@ import (
|
|||||||
|
|
||||||
// Render writes a Markdown formatted Schema definition to the specified writer.
|
// Render writes a Markdown formatted Schema definition to the specified writer.
|
||||||
// A Schema contains a Version and the root Block, for example:
|
// A Schema contains a Version and the root Block, for example:
|
||||||
|
//
|
||||||
// "aws_accessanalyzer_analyzer": {
|
// "aws_accessanalyzer_analyzer": {
|
||||||
// "block": {
|
// "block": {
|
||||||
// },
|
// },
|
||||||
@ -178,6 +179,7 @@ func writeRootBlock(w io.Writer, block *tfjson.SchemaBlock) error {
|
|||||||
// * Description(Kind)
|
// * Description(Kind)
|
||||||
// * Deprecated flag
|
// * Deprecated flag
|
||||||
// For example:
|
// For example:
|
||||||
|
//
|
||||||
// "block": {
|
// "block": {
|
||||||
// "attributes": {
|
// "attributes": {
|
||||||
// "certificate_arn": {
|
// "certificate_arn": {
|
||||||
|
18
vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/aliases.go
generated
vendored
18
vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/aliases.go
generated
vendored
@ -42,19 +42,19 @@ func PrefixedUniqueId(prefix string) string {
|
|||||||
|
|
||||||
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
||||||
// testing to terraform-plugin-testing.
|
// testing to terraform-plugin-testing.
|
||||||
type NotFoundError retry.NotFoundError
|
type NotFoundError = retry.NotFoundError
|
||||||
|
|
||||||
// UnexpectedStateError is returned when Refresh returns a state that's neither in Target nor Pending
|
// UnexpectedStateError is returned when Refresh returns a state that's neither in Target nor Pending
|
||||||
//
|
//
|
||||||
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
||||||
// testing to terraform-plugin-testing.
|
// testing to terraform-plugin-testing.
|
||||||
type UnexpectedStateError retry.UnexpectedStateError
|
type UnexpectedStateError = retry.UnexpectedStateError
|
||||||
|
|
||||||
// TimeoutError is returned when WaitForState times out
|
// TimeoutError is returned when WaitForState times out
|
||||||
//
|
//
|
||||||
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
||||||
// testing to terraform-plugin-testing.
|
// testing to terraform-plugin-testing.
|
||||||
type TimeoutError retry.TimeoutError
|
type TimeoutError = retry.TimeoutError
|
||||||
|
|
||||||
// StateRefreshFunc is a function type used for StateChangeConf that is
|
// StateRefreshFunc is a function type used for StateChangeConf that is
|
||||||
// responsible for refreshing the item being watched for a state change.
|
// responsible for refreshing the item being watched for a state change.
|
||||||
@ -69,19 +69,19 @@ type TimeoutError retry.TimeoutError
|
|||||||
//
|
//
|
||||||
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
||||||
// testing to terraform-plugin-testing.
|
// testing to terraform-plugin-testing.
|
||||||
type StateRefreshFunc retry.StateRefreshFunc
|
type StateRefreshFunc = retry.StateRefreshFunc
|
||||||
|
|
||||||
// StateChangeConf is the configuration struct used for `WaitForState`.
|
// StateChangeConf is the configuration struct used for `WaitForState`.
|
||||||
//
|
//
|
||||||
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
||||||
// testing to terraform-plugin-testing.
|
// testing to terraform-plugin-testing.
|
||||||
type StateChangeConf retry.StateChangeConf
|
type StateChangeConf = retry.StateChangeConf
|
||||||
|
|
||||||
// RetryFunc is the function retried until it succeeds.
|
// RetryFunc is the function retried until it succeeds.
|
||||||
//
|
//
|
||||||
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
||||||
// testing to terraform-plugin-testing.
|
// testing to terraform-plugin-testing.
|
||||||
type RetryFunc retry.RetryFunc
|
type RetryFunc = retry.RetryFunc
|
||||||
|
|
||||||
// RetryContext is a basic wrapper around StateChangeConf that will just retry
|
// RetryContext is a basic wrapper around StateChangeConf that will just retry
|
||||||
// a function until it no longer returns an error.
|
// a function until it no longer returns an error.
|
||||||
@ -92,7 +92,7 @@ type RetryFunc retry.RetryFunc
|
|||||||
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
||||||
// testing to terraform-plugin-testing.
|
// testing to terraform-plugin-testing.
|
||||||
func RetryContext(ctx context.Context, timeout time.Duration, f RetryFunc) error {
|
func RetryContext(ctx context.Context, timeout time.Duration, f RetryFunc) error {
|
||||||
return retry.RetryContext(ctx, timeout, retry.RetryFunc(f))
|
return retry.RetryContext(ctx, timeout, f)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retry is a basic wrapper around StateChangeConf that will just retry
|
// Retry is a basic wrapper around StateChangeConf that will just retry
|
||||||
@ -101,7 +101,7 @@ func RetryContext(ctx context.Context, timeout time.Duration, f RetryFunc) error
|
|||||||
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
||||||
// testing to terraform-plugin-testing.
|
// testing to terraform-plugin-testing.
|
||||||
func Retry(timeout time.Duration, f RetryFunc) error {
|
func Retry(timeout time.Duration, f RetryFunc) error {
|
||||||
return retry.Retry(timeout, retry.RetryFunc(f))
|
return retry.Retry(timeout, f)
|
||||||
}
|
}
|
||||||
|
|
||||||
// RetryError is the required return type of RetryFunc. It forces client code
|
// RetryError is the required return type of RetryFunc. It forces client code
|
||||||
@ -109,7 +109,7 @@ func Retry(timeout time.Duration, f RetryFunc) error {
|
|||||||
//
|
//
|
||||||
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
|
||||||
// testing to terraform-plugin-testing.
|
// testing to terraform-plugin-testing.
|
||||||
type RetryError retry.RetryError
|
type RetryError = retry.RetryError
|
||||||
|
|
||||||
// RetryableError is a helper to create a RetryError that's retryable from a
|
// RetryableError is a helper to create a RetryError that's retryable from a
|
||||||
// given error. To prevent logic errors, will return an error when passed a
|
// given error. To prevent logic errors, will return an error when passed a
|
||||||
|
14
vendor/modules.txt
vendored
14
vendor/modules.txt
vendored
@ -108,8 +108,8 @@ github.com/hashicorp/terraform-exec/tfexec
|
|||||||
# github.com/hashicorp/terraform-json v0.16.0
|
# github.com/hashicorp/terraform-json v0.16.0
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
github.com/hashicorp/terraform-json
|
github.com/hashicorp/terraform-json
|
||||||
# github.com/hashicorp/terraform-plugin-docs v0.13.0
|
# github.com/hashicorp/terraform-plugin-docs v0.14.1
|
||||||
## explicit; go 1.17
|
## explicit; go 1.18
|
||||||
github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
|
github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
|
||||||
github.com/hashicorp/terraform-plugin-docs/internal/cmd
|
github.com/hashicorp/terraform-plugin-docs/internal/cmd
|
||||||
github.com/hashicorp/terraform-plugin-docs/internal/mdplain
|
github.com/hashicorp/terraform-plugin-docs/internal/mdplain
|
||||||
@ -141,7 +141,7 @@ github.com/hashicorp/terraform-plugin-log/internal/hclogutils
|
|||||||
github.com/hashicorp/terraform-plugin-log/internal/logging
|
github.com/hashicorp/terraform-plugin-log/internal/logging
|
||||||
github.com/hashicorp/terraform-plugin-log/tflog
|
github.com/hashicorp/terraform-plugin-log/tflog
|
||||||
github.com/hashicorp/terraform-plugin-log/tfsdklog
|
github.com/hashicorp/terraform-plugin-log/tfsdklog
|
||||||
# github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.0
|
# github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1
|
||||||
## explicit; go 1.19
|
## explicit; go 1.19
|
||||||
github.com/hashicorp/terraform-plugin-sdk/v2/diag
|
github.com/hashicorp/terraform-plugin-sdk/v2/diag
|
||||||
github.com/hashicorp/terraform-plugin-sdk/v2/helper/id
|
github.com/hashicorp/terraform-plugin-sdk/v2/helper/id
|
||||||
@ -176,11 +176,11 @@ github.com/huandu/xstrings
|
|||||||
# github.com/imdario/mergo v0.3.13
|
# github.com/imdario/mergo v0.3.13
|
||||||
## explicit; go 1.13
|
## explicit; go 1.13
|
||||||
github.com/imdario/mergo
|
github.com/imdario/mergo
|
||||||
# github.com/mattn/go-colorable v0.1.12
|
# github.com/mattn/go-colorable v0.1.13
|
||||||
## explicit; go 1.13
|
## explicit; go 1.15
|
||||||
github.com/mattn/go-colorable
|
github.com/mattn/go-colorable
|
||||||
# github.com/mattn/go-isatty v0.0.14
|
# github.com/mattn/go-isatty v0.0.16
|
||||||
## explicit; go 1.12
|
## explicit; go 1.15
|
||||||
github.com/mattn/go-isatty
|
github.com/mattn/go-isatty
|
||||||
# github.com/mitchellh/cli v1.1.5
|
# github.com/mitchellh/cli v1.1.5
|
||||||
## explicit; go 1.11
|
## explicit; go 1.11
|
||||||
|
Reference in New Issue
Block a user