diff --git a/mmv1/products/artifactregistry/product.yaml b/mmv1/products/artifactregistry/product.yaml index aa5059f23354..5267fac9382c 100644 --- a/mmv1/products/artifactregistry/product.yaml +++ b/mmv1/products/artifactregistry/product.yaml @@ -17,9 +17,6 @@ display_name: Artifact Registry scopes: - https://www.googleapis.com/auth/cloud-platform versions: - - !ruby/object:Api::Product::Version - name: beta - base_url: https://artifactregistry.googleapis.com/v1beta2/ - !ruby/object:Api::Product::Version name: ga base_url: https://artifactregistry.googleapis.com/v1/ diff --git a/mmv1/third_party/terraform/tests/resource_artifact_registry_repository_test.go.erb b/mmv1/third_party/terraform/tests/resource_artifact_registry_repository_test.go.erb index 00a43fca8433..c6294c534503 100644 --- a/mmv1/third_party/terraform/tests/resource_artifact_registry_repository_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_artifact_registry_repository_test.go.erb @@ -1,6 +1,5 @@ <% autogen_exception -%> package google -<% unless version == 'ga' -%> import ( "fmt" @@ -16,7 +15,7 @@ func TestAccArtifactRegistryRepository_update(t *testing.T) { vcrTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProvidersOiCS, + Providers: testAccProviders, CheckDestroy: testAccCheckArtifactRegistryRepositoryDestroyProducer(t), Steps: []resource.TestStep{ { @@ -39,18 +38,18 @@ func TestAccArtifactRegistryRepository_update(t *testing.T) { }) } -func TestAccArtifactRegistryRepository_create_mvn_snapshot(t *testing.T) { +func TestAccArtifactRegistryRepository_createMvnSnapshot(t *testing.T) { t.Parallel() repositoryID := fmt.Sprintf("tf-test-%d", randInt(t)) vcrTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProvidersOiCS, + Providers: testAccProviders, CheckDestroy: testAccCheckArtifactRegistryRepositoryDestroyProducer(t), Steps: []resource.TestStep{ { - Config: testAccArtifactRegistryRepository_create(repositoryID, "SNAPSHOT"), + Config: testAccArtifactRegistryRepository_createMvnWithVersionPolicy(repositoryID, "SNAPSHOT"), }, { ResourceName: "google_artifact_registry_repository.test", @@ -61,18 +60,40 @@ func TestAccArtifactRegistryRepository_create_mvn_snapshot(t *testing.T) { }) } -func TestAccArtifactRegistryRepository_create_mvn_release(t *testing.T) { +func TestAccArtifactRegistryRepository_createMvnRelease(t *testing.T) { t.Parallel() repositoryID := fmt.Sprintf("tf-test-%d", randInt(t)) vcrTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProvidersOiCS, + Providers: testAccProviders, CheckDestroy: testAccCheckArtifactRegistryRepositoryDestroyProducer(t), Steps: []resource.TestStep{ { - Config: testAccArtifactRegistryRepository_create(repositoryID, "RELEASE"), + Config: testAccArtifactRegistryRepository_createMvnWithVersionPolicy(repositoryID, "RELEASE"), + }, + { + ResourceName: "google_artifact_registry_repository.test", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccArtifactRegistryRepository_kfp(t *testing.T) { + t.Parallel() + + repositoryID := fmt.Sprintf("tf-test-%d", randInt(t)) + + vcrTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckArtifactRegistryRepositoryDestroyProducer(t), + Steps: []resource.TestStep{ + { + Config: testAccArtifactRegistryRepository_kfp(repositoryID), }, { ResourceName: "google_artifact_registry_repository.test", @@ -86,8 +107,6 @@ func TestAccArtifactRegistryRepository_create_mvn_release(t *testing.T) { func testAccArtifactRegistryRepository_update(repositoryID string) string { return fmt.Sprintf(` resource "google_artifact_registry_repository" "test" { - provider = google-beta - repository_id = "%s" location = "us-central1" description = "pre-update" @@ -104,8 +123,6 @@ resource "google_artifact_registry_repository" "test" { func testAccArtifactRegistryRepository_update2(repositoryID string) string { return fmt.Sprintf(` resource "google_artifact_registry_repository" "test" { - provider = google-beta - repository_id = "%s" location = "us-central1" description = "post-update" @@ -119,11 +136,9 @@ resource "google_artifact_registry_repository" "test" { `, repositoryID) } -func testAccArtifactRegistryRepository_create(repositoryID string, versionPolicy string) string { +func testAccArtifactRegistryRepository_createMvnWithVersionPolicy(repositoryID string, versionPolicy string) string { return fmt.Sprintf(` resource "google_artifact_registry_repository" "test" { - provider = google-beta - repository_id = "%s" location = "us-central1" description = "post-update" @@ -134,4 +149,14 @@ resource "google_artifact_registry_repository" "test" { } `, repositoryID, versionPolicy) } -<% end -%> + +func testAccArtifactRegistryRepository_kfp(repositoryID string) string { + return fmt.Sprintf(` +resource "google_artifact_registry_repository" "test" { + repository_id = "%s" + location = "us-central1" + description = "my-kfp-repository"" + format = "KFP" +} +`, repositoryID) +}