|
|
|
@ -517,66 +517,69 @@ func TestDecodeConfig(t *testing.T) {
|
|
|
|
|
in: `{"retry_join":["a","b"]}`, |
|
|
|
|
c: &Config{RetryJoin: []string{"a", "b"}}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
in: `{"retry_join_azure":{"client_id":"a"}}`, |
|
|
|
|
c: &Config{RetryJoin: []string{"provider=azure client_id=a"}}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
in: `{"retry_join_azure":{"tag_name":"a"}}`, |
|
|
|
|
c: &Config{RetryJoin: []string{"provider=azure tag_name=a"}}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
in: `{"retry_join_azure":{"tag_value":"a"}}`, |
|
|
|
|
c: &Config{RetryJoin: []string{"provider=azure tag_value=a"}}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
in: `{"retry_join_azure":{"secret_access_key":"a"}}`, |
|
|
|
|
c: &Config{RetryJoin: []string{"provider=azure secret_access_key=a"}}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
in: `{"retry_join_azure":{"subscription_id":"a"}}`, |
|
|
|
|
c: &Config{RetryJoin: []string{"provider=azure subscription_id=a"}}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
in: `{"retry_join_azure":{"tenant_id":"a"}}`, |
|
|
|
|
c: &Config{RetryJoin: []string{"provider=azure tenant_id=a"}}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
in: `{"retry_join_ec2":{"access_key_id":"a"}}`, |
|
|
|
|
c: &Config{RetryJoin: []string{"provider=aws access_key_id=a"}}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
in: `{"retry_join_ec2":{"region":"a"}}`, |
|
|
|
|
c: &Config{RetryJoin: []string{"provider=aws region=a"}}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
in: `{"retry_join_ec2":{"tag_key":"a"}}`, |
|
|
|
|
c: &Config{RetryJoin: []string{"provider=aws tag_key=a"}}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
in: `{"retry_join_ec2":{"tag_value":"a"}}`, |
|
|
|
|
c: &Config{RetryJoin: []string{"provider=aws tag_value=a"}}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
in: `{"retry_join_ec2":{"secret_access_key":"a"}}`, |
|
|
|
|
c: &Config{RetryJoin: []string{"provider=aws secret_access_key=a"}}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
in: `{"retry_join_gce":{"credentials_file":"a"}}`, |
|
|
|
|
c: &Config{RetryJoin: []string{"provider=gce credentials_file=a"}}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
in: `{"retry_join_gce":{"project_name":"a"}}`, |
|
|
|
|
c: &Config{RetryJoin: []string{"provider=gce project_name=a"}}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
in: `{"retry_join_gce":{"tag_value":"a"}}`, |
|
|
|
|
c: &Config{RetryJoin: []string{"provider=gce tag_value=a"}}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
in: `{"retry_join_gce":{"zone_pattern":"a"}}`, |
|
|
|
|
c: &Config{RetryJoin: []string{"provider=gce zone_pattern=a"}}, |
|
|
|
|
}, |
|
|
|
|
// todo(fs): temporarily disabling tests after moving the code
|
|
|
|
|
// todo(fs): to patch the deprecated retry-join flags to command/agent.go
|
|
|
|
|
// todo(fs): where it cannot be tested.
|
|
|
|
|
// {
|
|
|
|
|
// in: `{"retry_join_azure":{"client_id":"a"}}`,
|
|
|
|
|
// c: &Config{RetryJoin: []string{"provider=azure client_id=a"}},
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// in: `{"retry_join_azure":{"tag_name":"a"}}`,
|
|
|
|
|
// c: &Config{RetryJoin: []string{"provider=azure tag_name=a"}},
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// in: `{"retry_join_azure":{"tag_value":"a"}}`,
|
|
|
|
|
// c: &Config{RetryJoin: []string{"provider=azure tag_value=a"}},
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// in: `{"retry_join_azure":{"secret_access_key":"a"}}`,
|
|
|
|
|
// c: &Config{RetryJoin: []string{"provider=azure secret_access_key=a"}},
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// in: `{"retry_join_azure":{"subscription_id":"a"}}`,
|
|
|
|
|
// c: &Config{RetryJoin: []string{"provider=azure subscription_id=a"}},
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// in: `{"retry_join_azure":{"tenant_id":"a"}}`,
|
|
|
|
|
// c: &Config{RetryJoin: []string{"provider=azure tenant_id=a"}},
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// in: `{"retry_join_ec2":{"access_key_id":"a"}}`,
|
|
|
|
|
// c: &Config{RetryJoin: []string{"provider=aws access_key_id=a"}},
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// in: `{"retry_join_ec2":{"region":"a"}}`,
|
|
|
|
|
// c: &Config{RetryJoin: []string{"provider=aws region=a"}},
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// in: `{"retry_join_ec2":{"tag_key":"a"}}`,
|
|
|
|
|
// c: &Config{RetryJoin: []string{"provider=aws tag_key=a"}},
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// in: `{"retry_join_ec2":{"tag_value":"a"}}`,
|
|
|
|
|
// c: &Config{RetryJoin: []string{"provider=aws tag_value=a"}},
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// in: `{"retry_join_ec2":{"secret_access_key":"a"}}`,
|
|
|
|
|
// c: &Config{RetryJoin: []string{"provider=aws secret_access_key=a"}},
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// in: `{"retry_join_gce":{"credentials_file":"a"}}`,
|
|
|
|
|
// c: &Config{RetryJoin: []string{"provider=gce credentials_file=a"}},
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// in: `{"retry_join_gce":{"project_name":"a"}}`,
|
|
|
|
|
// c: &Config{RetryJoin: []string{"provider=gce project_name=a"}},
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// in: `{"retry_join_gce":{"tag_value":"a"}}`,
|
|
|
|
|
// c: &Config{RetryJoin: []string{"provider=gce tag_value=a"}},
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// in: `{"retry_join_gce":{"zone_pattern":"a"}}`,
|
|
|
|
|
// c: &Config{RetryJoin: []string{"provider=gce zone_pattern=a"}},
|
|
|
|
|
// },
|
|
|
|
|
{ |
|
|
|
|
in: `{"retry_join_wan":["a","b"]}`, |
|
|
|
|
c: &Config{RetryJoinWan: []string{"a", "b"}}, |
|
|
|
|