From 4b432be1d8eb8b98440bfbb285262f3c8dc9a1c1 Mon Sep 17 00:00:00 2001 From: skotambkar Date: Mon, 21 Dec 2020 00:14:24 -0800 Subject: [PATCH] add documentation --- config/load_options.go | 12 ++++++++++-- internal/ini/testdata/valid/commented_profile | 1 + .../ini/testdata/valid/commented_profile_expected | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/config/load_options.go b/config/load_options.go index b9f8d29d19e..8fc7055f896 100644 --- a/config/load_options.go +++ b/config/load_options.go @@ -58,11 +58,19 @@ type LoadOptions struct { SharedConfigProfile string // SharedConfigFiles is the slice of custom shared config files to use when loading the SharedConfig. - // The profile name used within config file must prefix 'profile'. + // A non-default profile used within config file must have name defined with prefix 'profile '. + // eg [profile xyz] indicates a profile with name 'xyz'. + // If duplicate profiles are provided with a same, or across multiple shared config files, the next parsed + // profile will override only properties that conflict with the previously defined profile. SharedConfigFiles []string // SharedCredentialsFile is the slice of custom shared credentials files to use when loading the SharedConfig. - // The profile name used within credentials file must not prefix 'profile'. + // The profile name used within credentials file must not prefix 'profile '. + // eg [xyz] indicates a profile with name 'xyz'. Profile declared as [profile xyz] will be ignored. + // If duplicate profiles are provided with a same, or across multiple shared credentials files, the next parsed + // profile will override only properties that conflict with the previously defined profile. + // If duplicate profiles are provided within a shared credentials and shared config files, the properties + // defined in shared credentials file take precedence. SharedCredentialsFiles []string // CustomCABundle is CA bundle PEM bytes reader diff --git a/internal/ini/testdata/valid/commented_profile b/internal/ini/testdata/valid/commented_profile index 85e7792170a..f40a405042e 100644 --- a/internal/ini/testdata/valid/commented_profile +++ b/internal/ini/testdata/valid/commented_profile @@ -2,3 +2,4 @@ [ default ] region = "foo-region" # another comment output = json # comment again +bar = 123 ; comment with semi-colon diff --git a/internal/ini/testdata/valid/commented_profile_expected b/internal/ini/testdata/valid/commented_profile_expected index dbf5571cf6f..de7b26c6d7e 100644 --- a/internal/ini/testdata/valid/commented_profile_expected +++ b/internal/ini/testdata/valid/commented_profile_expected @@ -1,6 +1,7 @@ { "default": { "region": "foo-region", - "output": "json" + "output": "json", + "bar": "123" } }