diff --git a/mmv1/third_party/terraform/tests/resource_os_config_os_policy_assignment_test.go.erb b/mmv1/third_party/terraform/tests/resource_os_config_os_policy_assignment_test.go.erb deleted file mode 100644 index ebfb1aa1741a..000000000000 --- a/mmv1/third_party/terraform/tests/resource_os_config_os_policy_assignment_test.go.erb +++ /dev/null @@ -1,102 +0,0 @@ -// ---------------------------------------------------------------------------- -// -// *** AUTO GENERATED CODE *** Type: DCL *** -// -// ---------------------------------------------------------------------------- -// -// This file is managed by Magic Modules (https://github.com/GoogleCloudPlatform/magic-modules) -// and is based on the DCL (https://github.com/GoogleCloudPlatform/declarative-resource-client-library). -// Changes will need to be made to the DCL or Magic Modules instead of here. -// -// We are not currently able to accept contributions to this file. If changes -// are required, please file an issue at https://github.com/hashicorp/terraform-provider-google/issues/new/choose -// -// ---------------------------------------------------------------------------- - -package google - -import ( - "context" - "fmt" - dcl "github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl" - osconfig "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/osconfig<%= dcl_version(version) -%>" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "strings" - "testing" -) - -func TestAccOsConfigOsPolicyAssignment_policyBasic(t *testing.T) { - t.Parallel() - - context := map[string]interface{}{ - "project_name": getTestProjectFromEnv(), - "zone": getTestZoneFromEnv(), - "random_suffix": randString(t, 10), - } - - vcrTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckOsConfigOsPolicyAssignmentDestroyProducer(t), - Steps: []resource.TestStep{ - { - Config: testAccOsConfigOsPolicyAssignment_basic(context), - }, - { - ResourceName: "google_os_config_os_policy_assignment.primary", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"rollout.0.min_wait_duration"}, - }, - }, - }) -} - -func testAccOsConfigOsPolicyAssignment_basic(context map[string]interface{}) string { - return Nprintf(` -resource "google_os_config_os_policy_assignment" "primary" { - instance_filter { - all = false - } - - location = "%{zone}" - name = "tf-test-assignment%{random_suffix}" - - os_policies { - id = "policy" - mode = "VALIDATION" - - resource_groups { - resources { - id = "apt" - - pkg { - desired_state = "INSTALLED" - - apt { - name = "bazel" - } - } - } - } - - allow_no_resource_group_match = true - description = "A test os policy" - } - - rollout { - disruption_budget { - fixed = 100 - } - - min_wait_duration = "3.5s" - } - - description = "A test os policy assignment" - project = "%{project_name}" -} - - -`, context) -} diff --git a/tpgtools/api/osconfig/samples/fixed.os_policy_assignment.json b/tpgtools/api/osconfig/samples/fixed.os_policy_assignment.json index 5974c3936ef9..d46724f8502f 100755 --- a/tpgtools/api/osconfig/samples/fixed.os_policy_assignment.json +++ b/tpgtools/api/osconfig/samples/fixed.os_policy_assignment.json @@ -25,185 +25,6 @@ "name": "bazel" } } - }, - { - "id": "deb1", - "pkg": { - "desiredState": "INSTALLED", - "deb": { - "source": { - "localPath": "$HOME/package.deb" - } - } - } - }, - { - "id": "deb2", - "pkg": { - "desiredState": "INSTALLED", - "deb": { - "pullDeps": true, - "source": { - "allowInsecure": true, - "remote": { - "uri": "ftp.us.debian.org/debian/package.deb", - "sha256Checksum": "3bbfd1043cd7afdb78cf9afec36c0c5370d2fea98166537b4e67f3816f256025" - } - } - } - } - }, - { - "id": "deb3", - "pkg": { - "desiredState": "INSTALLED", - "deb": { - "pullDeps": true, - "source": { - "gcs": { - "bucket": "test-bucket", - "object": "test-object", - "generation": 1 - } - } - } - } - }, - { - "id": "yum", - "pkg": { - "desiredState": "INSTALLED", - "yum": { - "name": "gstreamer-plugins-base-devel.x86_64" - } - } - }, - { - "id": "zypper", - "pkg": { - "desiredState": "INSTALLED", - "zypper": { - "name": "gcc" - } - } - }, - { - "id": "rpm1", - "pkg": { - "desiredState": "INSTALLED", - "rpm": { - "pullDeps": true, - "source": { - "localPath": "$HOME/package.rpm" - } - } - } - }, - { - "id": "rpm2", - "pkg": { - "desiredState": "INSTALLED", - "rpm": { - "source": { - "allowInsecure": true, - "remote": { - "uri": "https://mirror.jaleco.com/centos/8.3.2011/BaseOS/x86_64/os/Packages/efi-filesystem-3-2.el8.noarch.rpm", - "sha256Checksum": "3bbfd1043cd7afdb78cf9afec36c0c5370d2fea98166537b4e67f3816f256025" - } - } - } - } - }, - { - "id": "rpm3", - "pkg": { - "desiredState": "INSTALLED", - "rpm": { - "source": { - "gcs": { - "bucket": "test-bucket", - "object": "test-object", - "generation": 1 - } - } - } - } - } - ] - }, - { - "resources": [ - { - "id": "apt-to-deb", - "pkg": { - "desiredState": "INSTALLED", - "apt": { - "name": "bazel" - } - } - }, - { - "id": "deb-local-path-to-gcs", - "pkg": { - "desiredState": "INSTALLED", - "deb": { - "source": { - "localPath": "$HOME/package.deb" - } - } - } - }, - { - "id": "googet", - "pkg": { - "desiredState": "INSTALLED", - "googet": { - "name": "gcc" - } - } - }, - { - "id": "msi1", - "pkg": { - "desiredState": "INSTALLED", - "msi": { - "source": { - "localPath": "$HOME/package.msi" - }, - "properties": ["REBOOT=ReallySuppress"] - } - } - }, - { - "id": "msi2", - "pkg": { - "desiredState": "INSTALLED", - "msi": { - "source": { - "allowInsecure": true, - "remote": { - "uri": "https://remote.uri.com/package.msi", - "sha256Checksum": "3bbfd1043cd7afdb78cf9afec36c0c5370d2fea98166537b4e67f3816f256025" - }, - "sha256Checksum": "3bbfd1043cd7afdb78cf9afec36c0c5370d2fea98166537b4e67f3816f256025" - } - } - } - }, - { - "id": "msi3", - "pkg": { - "desiredState": "INSTALLED", - "msi": { - "source": { - "gcs": { - "bucket": "test-bucket", - "object": "test-object", - "generation": 1 - } - } - } - } } ] } @@ -220,13 +41,6 @@ } } ], - "exclusionLabels": [ - { - "labels": { - "label-two": "value-two" - } - } - ], "inventories": [ { "osShortName": "centos", @@ -236,7 +50,7 @@ }, "rollout": { "disruptionBudget": { - "fixed": 1 + "fixed": 100 }, "minWaitDuration": "3.5s" } diff --git a/tpgtools/api/osconfig/samples/percent.os_policy_assignment.json b/tpgtools/api/osconfig/samples/percent.os_policy_assignment.json index ab0b00ea5165..70f94b8927d9 100755 --- a/tpgtools/api/osconfig/samples/percent.os_policy_assignment.json +++ b/tpgtools/api/osconfig/samples/percent.os_policy_assignment.json @@ -22,182 +22,6 @@ } } }, - { - "id": "yum", - "repository": { - "yum": { - "id": "yum", - "displayName": "yum", - "baseUrl": "http://centos.s.uw.edu/centos/", - "gpgKeys": ["RPM-GPG-KEY-CentOS-7"] - } - } - }, - { - "id": "zypper", - "repository": { - "zypper": { - "id": "zypper", - "displayName": "zypper", - "baseUrl": "http://mirror.dal10.us.leaseweb.net/opensuse", - "gpgKeys": ["sample-key-uri"] - } - } - }, - { - "id": "goo", - "repository": { - "goo": { - "name": "goo", - "url": "https://foo.com/googet/bar" - } - } - }, - { - "id": "exec1", - "exec": { - "validate": { - "args": ["arg1"], - "interpreter": "SHELL", - "outputFilePath": "$HOME/out", - "file": { - "localPath": "$HOME/script.sh" - } - }, - "enforce": { - "args": ["arg1"], - "interpreter": "SHELL", - "outputFilePath": "$HOME/out", - "file": { - "allowInsecure": true, - "remote": { - "uri": "https://www.example.com/script.sh", - "sha256Checksum": "c7938fed83afdccbb0e86a2a2e4cad7d5035012ca3214b4a61268393635c3063" - } - } - } - } - }, - { - "id": "exec2", - "exec": { - "validate": { - "args": ["arg1"], - "interpreter": "SHELL", - "outputFilePath": "$HOME/out", - "file": { - "allowInsecure": true, - "remote": { - "uri": "https://www.example.com/script.sh", - "sha256Checksum": "c7938fed83afdccbb0e86a2a2e4cad7d5035012ca3214b4a61268393635c3063" - } - } - }, - "enforce": { - "args": ["arg1"], - "interpreter": "SHELL", - "outputFilePath": "$HOME/out", - "file": { - "localPath": "$HOME/script.sh" - } - } - } - }, - { - "id": "exec3", - "exec": { - "validate": { - "interpreter": "SHELL", - "outputFilePath": "$HOME/out", - "file": { - "allowInsecure": true, - "gcs": { - "bucket": "test-bucket", - "object": "test-object", - "generation": 1 - } - } - }, - "enforce": { - "interpreter": "SHELL", - "outputFilePath": "$HOME/out", - "script": "pwd" - } - } - }, - { - "id": "exec4", - "exec": { - "validate": { - "interpreter": "SHELL", - "outputFilePath": "$HOME/out", - "script": "pwd" - }, - "enforce": { - "interpreter": "SHELL", - "outputFilePath": "$HOME/out", - "file": { - "allowInsecure": true, - "gcs": { - "bucket": "test-bucket", - "object": "test-object", - "generation": 1 - } - } - } - } - }, - { - "id": "file1", - "file": { - "path": "$HOME/file", - "state": "PRESENT", - "file": { - "localPath": "$HOME/file" - } - } - } - ] - }, - { - "resources": [ - { - "id": "file2", - "file": { - "path": "$HOME/file", - "state": "PRESENT", - "permissions": "755", - "file": { - "allowInsecure": true, - "remote": { - "uri": "https://www.example.com/file", - "sha256Checksum": "c7938fed83afdccbb0e86a2a2e4cad7d5035012ca3214b4a61268393635c3063" - } - } - } - }, - { - "id": "file3", - "file": { - "path": "$HOME/file", - "state": "PRESENT", - "file": { - "gcs": { - "bucket": "test-bucket", - "object": "test-object", - "generation": 1 - } - } - } - }, - { - "id": "file4", - "file": { - "path": "$HOME/file", - "state": "PRESENT", - "content": "sample-content" - } - } ] } ] @@ -211,7 +35,7 @@ }, "rollout": { "disruptionBudget": { - "percent": 1 + "percent": 100 }, "minWaitDuration": "3.5s" } diff --git a/tpgtools/api/osconfig/samples/update_fixed.os_policy_assignment.json b/tpgtools/api/osconfig/samples/update_fixed.os_policy_assignment.json index 88fd1edc3373..d27baee9cbc0 100755 --- a/tpgtools/api/osconfig/samples/update_fixed.os_policy_assignment.json +++ b/tpgtools/api/osconfig/samples/update_fixed.os_policy_assignment.json @@ -36,163 +36,6 @@ } } } - }, - { - "id": "new-deb2", - "pkg": { - "desiredState": "REMOVED", - "deb": { - "pullDeps": false, - "source": { - "allowInsecure": false, - "remote": { - "uri": "ftp.us.debian.org/debian/new-package.deb", - "sha256Checksum": "9f8e5818ccb47024d01000db713c0a333679b64678ff5fe2d9bea0a23014dd54" - } - } - } - } - }, - { - "id": "new-yum", - "pkg": { - "desiredState": "REMOVED", - "yum": { - "name": "vlc.x86_64" - } - } - }, - { - "id": "new-zypper", - "pkg": { - "desiredState": "REMOVED", - "zypper": { - "name": "ModemManager" - } - } - }, - { - "id": "new-rpm1", - "pkg": { - "desiredState": "REMOVED", - "rpm": { - "pullDeps": false, - "source": { - "localPath": "$HOME/new-package.rpm" - } - } - } - }, - { - "id": "new-rpm2", - "pkg": { - "desiredState": "REMOVED", - "rpm": { - "source": { - "allowInsecure": false, - "remote": { - "uri": "https://mirror.jaleco.com/centos/8.3.2011/BaseOS/x86_64/os/Packages/NetworkManager-adsl-1.26.0-12.el8_3.x86_64.rpm", - "sha256Checksum": "9f8e5818ccb47024d01000db713c0a333679b64678ff5fe2d9bea0a23014dd54" - } - } - } - } - }, - { - "id": "new-rpm3", - "pkg": { - "desiredState": "REMOVED", - "rpm": { - "source": { - "gcs": { - "bucket": "new-test-bucket", - "object": "new-test-object", - "generation": 2 - } - } - } - } - } - ] - }, - { - "resources": [ - { - "id": "apt-to-deb", - "pkg": { - "desiredState": "REMOVED", - "deb": { - "source": { - "localPath": "$HOME/new-package.deb" - } - } - } - }, - { - "id": "deb-local-path-to-gcs", - "pkg": { - "desiredState": "REMOVED", - "deb": { - "source": { - "gcs": { - "bucket": "new-test-bucket", - "object": "new-test-object", - "generation": 2 - } - } - } - } - }, - { - "id": "new-googet", - "pkg": { - "desiredState": "REMOVED", - "googet": { - "name": "julia" - } - } - }, - { - "id": "new-msi1", - "pkg": { - "desiredState": "REMOVED", - "msi": { - "source": { - "localPath": "$HOME/new-package.msi" - }, - "properties": ["ACTION=INSTALL"] - } - } - }, - { - "id": "new-msi2", - "pkg": { - "desiredState": "REMOVED", - "msi": { - "source": { - "allowInsecure": false, - "remote": { - "uri": "https://remote.uri.com/new-package.msi", - "sha256Checksum": "9f8e5818ccb47024d01000db713c0a333679b64678ff5fe2d9bea0a23014dd54" - } - } - } - } - }, - { - "id": "new-msi3", - "pkg": { - "desiredState": "REMOVED", - "msi": { - "source": { - "gcs": { - "bucket": "new-test-bucket", - "object": "new-test-object", - "generation": 2 - } - } - } - } } ] } @@ -213,7 +56,7 @@ }, "rollout": { "disruptionBudget": { - "fixed": 2 + "fixed": 100 }, "minWaitDuration": "7.5s" } diff --git a/tpgtools/api/osconfig/samples/update_percent.os_policy_assignment.json b/tpgtools/api/osconfig/samples/update_percent.os_policy_assignment.json index a228aa61eac1..3b9c6460c9e4 100755 --- a/tpgtools/api/osconfig/samples/update_percent.os_policy_assignment.json +++ b/tpgtools/api/osconfig/samples/update_percent.os_policy_assignment.json @@ -21,182 +21,6 @@ } } }, - { - "id": "new-yum", - "repository": { - "yum": { - "id": "new-yum", - "displayName": "new-yum", - "baseUrl": "http://mirrors.rcs.alaska.edu/centos/", - "gpgKeys": ["RPM-GPG-KEY-CentOS-Debug-7"] - } - } - }, - { - "id": "new-zypper", - "repository": { - "zypper": { - "id": "new-zypper", - "displayName": "new-zypper", - "baseUrl": "http://mirror.vtti.vt.edu/opensuse/", - "gpgKeys": ["new-sample-key-uri"] - } - } - }, - { - "id": "new-goo", - "repository": { - "goo": { - "name": "new-goo", - "url": "https://foo.com/googet/baz" - } - } - }, - { - "id": "new-exec1", - "exec": { - "validate": { - "args": ["arg2"], - "interpreter": "POWERSHELL", - "outputFilePath": "$HOME/out", - "file": { - "localPath": "$HOME/script.bat" - } - }, - "enforce": { - "args": ["arg2"], - "interpreter": "POWERSHELL", - "outputFilePath": "$HOME/out", - "file": { - "allowInsecure": false, - "remote": { - "uri": "https://www.example.com/script.bat", - "sha256Checksum": "9f8e5818ccb47024d01000db713c0a333679b64678ff5fe2d9bea0a23014dd54" - } - } - } - } - }, - { - "id": "new-exec2", - "exec": { - "validate": { - "args": ["arg2"], - "interpreter": "POWERSHELL", - "outputFilePath": "$HOME/out", - "file": { - "allowInsecure": false, - "remote": { - "uri": "https://www.example.com/script.bat", - "sha256Checksum": "9f8e5818ccb47024d01000db713c0a333679b64678ff5fe2d9bea0a23014dd54" - } - } - }, - "enforce": { - "args": ["arg2"], - "interpreter": "POWERSHELL", - "outputFilePath": "$HOME/out", - "file": { - "localPath": "$HOME/script.bat" - } - } - } - }, - { - "id": "new-exec3", - "exec": { - "validate": { - "interpreter": "POWERSHELL", - "outputFilePath": "$HOME/out", - "file": { - "allowInsecure": false, - "gcs": { - "bucket": "new-test-bucket", - "object": "new-test-object", - "generation": 2 - } - } - }, - "enforce": { - "interpreter": "POWERSHELL", - "outputFilePath": "$HOME/out", - "script": "dir" - } - } - }, - { - "id": "new-exec4", - "exec": { - "validate": { - "interpreter": "POWERSHELL", - "outputFilePath": "$HOME/out", - "script": "dir" - }, - "enforce": { - "interpreter": "POWERSHELL", - "outputFilePath": "$HOME/out", - "file": { - "allowInsecure": false, - "gcs": { - "bucket": "new-test-bucket", - "object": "new-test-object", - "generation": 2 - } - } - } - } - }, - { - "id": "new-file1", - "file": { - "path": "$HOME/new-file", - "state": "PRESENT", - "file": { - "localPath": "$HOME/new-file" - } - } - } - ] - }, - { - "resources": [ - { - "id": "new-file2", - "file": { - "path": "$HOME/new-file", - "state": "CONTENTS_MATCH", - "permissions": "655", - "file": { - "allowInsecure": false, - "remote": { - "uri": "https://www.example.com/new-file", - "sha256Checksum": "9f8e5818ccb47024d01000db713c0a333679b64678ff5fe2d9bea0a23014dd54" - } - } - } - }, - { - "id": "new-file3", - "file": { - "path": "$HOME/new-file", - "state": "CONTENTS_MATCH", - "file": { - "gcs": { - "bucket": "new-test-bucket", - "object": "new-test-object", - "generation": 2 - } - } - } - }, - { - "id": "new-file4", - "file": { - "path": "$HOME/new-file", - "state": "CONTENTS_MATCH", - "content": "new-sample-content" - } - } ] } ] @@ -222,7 +46,7 @@ }, "rollout": { "disruptionBudget": { - "percent": 2 + "percent": 100 }, "minWaitDuration": "3.5s" }