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

feat: migrate to tf-sdk2 #102

Merged
merged 59 commits into from
Mar 18, 2021
Merged
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
a991d03
chore: runs v2 upgrade cmd
mavogel Mar 8, 2021
e10e1b1
chore: moves all files into the internal provider dir
mavogel Mar 8, 2021
325ad03
chore: renames internal package from docker to provider
mavogel Dec 27, 2020
e2761c9
feat: migrates main and provider
mavogel Mar 8, 2021
27b526c
fix: migrates tests to provider factories
mavogel Dec 27, 2020
331cd6c
fix: upgrades funcs with context
mavogel Dec 27, 2020
c92b621
fix: label migration test
mavogel Dec 27, 2020
cd54dd6
fix: reg image funcs test
mavogel Dec 27, 2020
c72a236
feat: migrates to resource context aware funcs
mavogel Mar 8, 2021
ea3b5ea
fix: context propagation in resources
mavogel Mar 8, 2021
c294281
fix: adds missing ctx
mavogel Dec 28, 2020
7753bfe
chore: adapts internal provider directory path
mavogel Dec 28, 2020
251a999
fix: replace import state passthrough ctx func
mavogel Dec 28, 2020
6c227ba
fix: replace wait for state ctx
mavogel Dec 28, 2020
4c27132
fix: ignores lint check for schema.SchemaValidateFunc
mavogel Dec 29, 2020
62019c2
fix: adapts v2 path for linter errcheck settings
mavogel Dec 29, 2020
e736734
feat: adds context param to tests
mavogel Dec 29, 2020
4cbf4fc
fix: swiches registry_auth to TypeList maxItems 1
mavogel Dec 29, 2020
25fbafc
fix: switches service auth, restart_policy from Map to List
mavogel Mar 8, 2021
4566618
fix: acc test setup
mavogel Dec 29, 2020
f8dc9c0
fix: auth element from set to list parsing
mavogel Dec 29, 2020
30129eb
fix: flattener for container.HostConfig.ExtraHosts
mavogel Jan 4, 2021
cad9954
fix: adapts impl of service auth map to list switch
mavogel Jan 4, 2021
2220d5b
fix: service restart_policy map to list with one item
mavogel Jan 4, 2021
3f60dfa
fix: dockerconfig file path in tests after go files migration
mavogel Jan 4, 2021
a2903ab
fix: image context file path in tests after go files migration
mavogel Jan 4, 2021
a3fff81
fix: catch non-existing restart policy
mavogel Jan 4, 2021
e072968
chore: bumps docker to v20.10.0 and tmp fixes build
mavogel Mar 8, 2021
75bd236
fix: merge conflicts
mavogel Mar 8, 2021
b798fd6
fix: test with providerFactories
mavogel Mar 9, 2021
62714f6
fix: add docker plugin resource and datasource
mavogel Mar 9, 2021
f8fa0d4
fix: test file path for new structure
mavogel Mar 9, 2021
3020f19
fix: add name attribute eto ds docker plugin schema
mavogel Mar 9, 2021
77a2d07
test: skip image build and keep
mavogel Mar 9, 2021
b6b5c3e
chore: bump tf-sdk to v2.4.4
mavogel Mar 9, 2021
b1bd97f
fix: add stop grace period for tests of 10s
mavogel Mar 9, 2021
1bc2df7
fix: linter tmp
mavogel Mar 9, 2021
6c4f1e1
fix: acc test by adding stop grace period
mavogel Mar 9, 2021
c7b26aa
feat: set descriptions to markdown and show an example builder
mavogel Mar 11, 2021
78ee421
feat: replace first base64 encoder wirh diag func
mavogel Mar 11, 2021
0d0232d
chore: remove diag suffix from validator
mavogel Mar 13, 2021
6a107c6
fix: update validateIntegerInRange to SchemaValidateDiagFunc
mavogel Mar 13, 2021
576be5d
fix: make base64 validator return a func
mavogel Mar 13, 2021
1d7fc6e
fix: make validateIntegerGeqThan with diag
mavogel Mar 13, 2021
5444a2e
fix: remove validateFloatRatio due to unusage
mavogel Mar 13, 2021
999aeac
fix: remove validateIntegerInRange due to unusage
mavogel Mar 13, 2021
6106905
fix: make validateStringIsFloatRatio with diag
mavogel Mar 13, 2021
229e753
fix: make validateDurationGeq0 diag
mavogel Mar 13, 2021
f098d3e
fix: make validateStringMatchesPattern diag
mavogel Mar 13, 2021
27fbadd
fix: make validateDockerContainerPath diag
mavogel Mar 13, 2021
ca0c2d1
fix: validator error output format to %v
mavogel Mar 13, 2021
d867b20
fix: remove staticlink check skip for validators funcs
mavogel Mar 13, 2021
9aca4fe
test: switch from ctx TODO to Background
mavogel Mar 15, 2021
14ee44f
fix: change param of providerSetToRegistryAuth to list
mavogel Mar 15, 2021
27454eb
chore: use diags.HasError() instead of len(diags)
mavogel Mar 15, 2021
8e3d832
feat: add state upgrade for restart_policy
mavogel Mar 16, 2021
4744283
feat: add state upgrade for auth
mavogel Mar 16, 2021
41a3c79
chore: fix linting
mavogel Mar 16, 2021
ac3579e
Merge branch 'master' into feat-migrate-tf-sdk2
suzuki-shunsuke Mar 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func configure(version string, p *schema.Provider) func(context.Context, *schema
authConfigs := &AuthConfigs{}

if v, ok := d.GetOk("registry_auth"); ok { // TODO load them anyway
authConfigs, err = providerSetToRegistryAuth(v.(*schema.Set))
authConfigs, err = providerSetToRegistryAuth(v)

if err != nil {
return nil, diag.Errorf("Error loading registry auth config: %s", err)
Expand All @@ -171,12 +171,12 @@ type AuthConfigs struct {
}

// Take the given registry_auth schemas and return a map of registry auth configurations
func providerSetToRegistryAuth(authSet *schema.Set) (*AuthConfigs, error) {
func providerSetToRegistryAuth(authList interface{}) (*AuthConfigs, error) {
suzuki-shunsuke marked this conversation as resolved.
Show resolved Hide resolved
authConfigs := AuthConfigs{
Configs: make(map[string]types.AuthConfig),
}

for _, authInt := range authSet.List() {
for _, authInt := range authList.([]interface{}) {
auth := authInt.(map[string]interface{})
authConfig := types.AuthConfig{}
authConfig.ServerAddress = normalizeRegistryAddress(auth["address"].(string))
Expand Down