From 4df9af05b98a1f19d04f36736796d208cc41b509 Mon Sep 17 00:00:00 2001 From: Josh Horwitz Date: Mon, 9 Jul 2018 13:20:20 -0400 Subject: [PATCH 1/2] Fixes #12 don't require region w/ instance principals --- pkg/oci/client/config.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/oci/client/config.go b/pkg/oci/client/config.go index 55906e4..3f4fbb9 100644 --- a/pkg/oci/client/config.go +++ b/pkg/oci/client/config.go @@ -165,9 +165,6 @@ func validateAuthConfig(c *Config, fldPath *field.Path) field.ErrorList { errList := field.ErrorList{} if c.UseInstancePrincipals { - if c.Auth.Region != "" { - errList = append(errList, field.Forbidden(fldPath.Child("region"), "cannot be used when useInstancePrincipals is enabled")) - } if c.Auth.TenancyOCID != "" { errList = append(errList, field.Forbidden(fldPath.Child("tenancy"), "cannot be used when useInstancePrincipals is enabled")) } From b07c122d965240db5a075bbf421a4662e9437396 Mon Sep 17 00:00:00 2001 From: Josh Horwitz Date: Mon, 9 Jul 2018 13:23:19 -0400 Subject: [PATCH 2/2] fix test --- pkg/oci/client/config_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/oci/client/config_test.go b/pkg/oci/client/config_test.go index 88272a5..9766c18 100644 --- a/pkg/oci/client/config_test.go +++ b/pkg/oci/client/config_test.go @@ -273,7 +273,6 @@ func TestValidateConfig(t *testing.T) { }, }, errs: field.ErrorList{ - &field.Error{Type: field.ErrorTypeForbidden, Field: "auth.region", Detail: "cannot be used when useInstancePrincipals is enabled", BadValue: ""}, &field.Error{Type: field.ErrorTypeForbidden, Field: "auth.tenancy", Detail: "cannot be used when useInstancePrincipals is enabled", BadValue: ""}, &field.Error{Type: field.ErrorTypeForbidden, Field: "auth.user", Detail: "cannot be used when useInstancePrincipals is enabled", BadValue: ""}, &field.Error{Type: field.ErrorTypeForbidden, Field: "auth.key", Detail: "cannot be used when useInstancePrincipals is enabled", BadValue: ""},