Repository: chanzuckerberg/fogg
Pull request #546 (2021-02-24 19:23:52)

[fix] okta registry namespace

codecov[bot]: # [Codecov](https://codecov.io/gh/chanzuckerberg/fogg/pull/546?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`main@067c437`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/chanzuckerberg/fogg/pull/546/graphs/tree.svg?width=650&height=150&src=pr&token=57DhtZ7g2A)](https://codecov.io/gh/chanzuckerberg/fogg/pull/546?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##             main     #546   +/-   ##
=======================================
  Coverage        ?   55.27%           
=======================================
  Files           ?       21           
  Lines           ?     2039           
  Branches        ?        0           
=======================================
  Hits            ?     1127           
  Misses          ?      755           
  Partials        ?      157           
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/chanzuckerberg/fogg/pull/546?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/chanzuckerberg/fogg/pull/546?src=pr&el=footer). Last update [067c437...a4d3051](https://codecov.io/gh/chanzuckerberg/fogg/pull/546?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/config/v2/resolvers.go b/config/v2/resolvers.go
index b62983ed..fab3d1f4 100644
--- a/config/v2/resolvers.go
+++ b/config/v2/resolvers.go
@@ -236,7 +236,7 @@ func ResolveSnowflakeProvider(commons ...Common) *SnowflakeProvider {
 func ResolveOktaProvider(commons ...Common) *OktaProvider {
 	orgName := lastNonNil(OktaProviderOrgNameGetter, commons...)
 	baseURL := lastNonNil(OktaProviderBaseURLGetter, commons...)
-	registryNamespace := lastNonNil(OktaProviderBaseURLGetter, commons...)
+	registryNamespace := lastNonNil(OktaProviderRegistryNamespaceGetter, commons...)
 
 	// required fields
 	if orgName == nil {
@@ -785,6 +785,13 @@ func OktaProviderBaseURLGetter(comm Common) *string {
 	return comm.Providers.Okta.BaseURL
 }
 
+func OktaProviderRegistryNamespaceGetter(comm Common) *string {
+	if comm.Providers == nil || comm.Providers.Okta == nil {
+		return nil
+	}
+	return comm.Providers.Okta.RegistryNamespace
+}
+
 func OktaProviderRegistryNamespacegetter(comm Common) *string {
 	if comm.Providers == nil || comm.Providers.Okta == nil {
 		return nil


Test patch:
diff --git a/testdata/okta_provider_yaml/terraform/accounts/foo/fogg.tf b/testdata/okta_provider_yaml/terraform/accounts/foo/fogg.tf
index a6eacc6c..32ed64cd 100644
--- a/testdata/okta_provider_yaml/terraform/accounts/foo/fogg.tf
+++ b/testdata/okta_provider_yaml/terraform/accounts/foo/fogg.tf
@@ -43,7 +43,7 @@ terraform {
     }
 
     okta = {
-      source = "oktapreview.com/okta"
+      source = "oktadeveloper/okta"
 
       version = "aversion"
 
diff --git a/testdata/okta_provider_yaml/terraform/envs/bar/bam/fogg.tf b/testdata/okta_provider_yaml/terraform/envs/bar/bam/fogg.tf
index 73664b3d..768c5781 100644
--- a/testdata/okta_provider_yaml/terraform/envs/bar/bam/fogg.tf
+++ b/testdata/okta_provider_yaml/terraform/envs/bar/bam/fogg.tf
@@ -43,7 +43,7 @@ terraform {
     }
 
     okta = {
-      source = "oktapreview.com/okta"
+      source = "oktadeveloper/okta"
 
       version = "aversion"
 
diff --git a/testdata/okta_provider_yaml/terraform/global/fogg.tf b/testdata/okta_provider_yaml/terraform/global/fogg.tf
index 3f026748..f15fc7d8 100644
--- a/testdata/okta_provider_yaml/terraform/global/fogg.tf
+++ b/testdata/okta_provider_yaml/terraform/global/fogg.tf
@@ -43,7 +43,7 @@ terraform {
     }
 
     okta = {
-      source = "oktapreview.com/okta"
+      source = "oktadeveloper/okta"
 
       version = "aversion"
 
diff --git a/testdata/v2_full_yaml/terraform/envs/prod/okta/fogg.tf b/testdata/v2_full_yaml/terraform/envs/prod/okta/fogg.tf
index 756ba4c9..40138982 100644
--- a/testdata/v2_full_yaml/terraform/envs/prod/okta/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/prod/okta/fogg.tf
@@ -59,7 +59,7 @@ terraform {
     }
 
     okta = {
-      source = "https://foo.okta.com//okta"
+      source = "acme/okta"
 
     }