Skip to content

Commit

Permalink
[fix]: [CDS-81549]: Fix Overrides V2 docs to use yaml format for yaml…
Browse files Browse the repository at this point in the history
… spec of overrides (#711)

* [fix]: [CDS-81550]: fix overrides v2 docs to use yaml format

* [feat]: [CDS-81550]: updated changelog

* [feat]: [CDS-81550]: updating data source tests

* [feat]: [CDS-81550]: updating data source tests - 2

* [feat]: [CDS-81550]: updating data source tests - 3
  • Loading branch information
lovish1999 committed Oct 19, 2023
1 parent d7a2631 commit 72c8ba2
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 151 deletions.
3 changes: 3 additions & 0 deletions .changelog/711.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
harness_platform_service_overrides_v2 - Updated docs to use yaml format for the yaml property of overrides instead of json format.
```
1 change: 0 additions & 1 deletion docs/data-sources/platform_service_overrides_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ data "harness_platform_service_overrides_v2" "test" {
### Read-Only

- `id` (String) The ID of this resource.
- `cluster_id` (String) The GitOps cluster ID to which the override entity is associated.
- `infra_id` (String) The infrastructure ID to which the override entity is associated.
- `service_id` (String) The service ID to which the override entity is associated.
- `env_id` (String) The environment ID to which the override entity is associated.
Expand Down
69 changes: 23 additions & 46 deletions docs/resources/platform_service_overrides_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,53 +19,31 @@ resource "harness_platform_service_overrides_v2" "test" {
env_id = "environmentIdentifier"
service_id = "serviceIdentifier"
infra_id = "infraIdentifier"
cluster_id = "clusterIdentifier"
type = "INFRA_SERVICE_OVERRIDE"
yaml = <<-EOT
{
"variables": [
{
"name": "v1",
"type": "String",
"value": "val1"
}
],
"configFiles": [
{
"configFile": {
"identifier": "sampleConfigFile",
"spec": {
"store": {
"type": "Harness",
"spec": {
"files": [
"/launchTemplate2"
]
}
}
}
}
}
],
"manifests": [
{
"manifest": {
"identifier": "sampleManifest",
"type": "AsgLaunchTemplate",
"spec": {
"store": {
"type": "Harness",
"spec": {
"files": [
"/launchTemplate1"
]
}
}
}
}
}
]
}
variables:
- name: var1
type: String
value: val1
configFiles:
- configFile:
identifier: sampleConfigFile
spec:
store:
type: Harness
spec:
files:
- account:/configFile1
manifests:
- manifest:
identifier: sampleManifestFile
type: Values
spec:
store:
type: Harness
spec:
files:
- account:/manifestFile1
EOT
}
```
Expand All @@ -85,7 +63,6 @@ resource "harness_platform_service_overrides_v2" "test" {

### Optional

- `cluster_id` (String) The GitOps cluster ID to which the override entity is associated. (This is required only when creating overrides for GitOps cluster infrastructure)
- `infra_id` (String) The infrastructure ID to which the override entity is associated.
- `org_id` (String) Unique identifier of the organization.
- `project_id` (String) Unique identifier of the project.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,30 @@ resource "harness_platform_service_overrides_v2" "test" {
env_id = "environmentIdentifier"
service_id = "serviceIdentifier"
infra_id = "infraIdentifier"
cluster_id = "clusterIdentifier"
type = "ENV_SERVICE_OVERRIDE"
type = "INFRA_SERVICE_OVERRIDE"
yaml = <<-EOT
{
"variables": [
{
"name": "v1",
"type": "String",
"value": "val1"
}
],
"configFiles": [
{
"configFile": {
"identifier": "sampleConfigFile",
"spec": {
"store": {
"type": "Harness",
"spec": {
"files": [
"/launchTemplate2"
]
}
}
}
}
}
],
"manifests": [
{
"manifest": {
"identifier": "sampleManifest",
"type": "AsgLaunchTemplate",
"spec": {
"store": {
"type": "Harness",
"spec": {
"files": [
"/launchTemplate1"
]
}
}
}
}
}
]
}
variables:
- name: var1
type: String
value: val1
configFiles:
- configFile:
identifier: sampleConfigFile
spec:
store:
type: Harness
spec:
files:
- account:/configFile1
manifests:
- manifest:
identifier: sampleManifestFile
type: Values
spec:
store:
type: Harness
spec:
files:
- account:/manifestFile1
EOT
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,55 +99,34 @@ func testAccDataSourceServiceOverrides(id string, name string) string {
service_id = harness_platform_service.test.id
type = "ENV_SERVICE_OVERRIDE"
yaml = <<-EOT
{
"variables": [
{
"name": "v1",
"type": "String",
"value": "val1"
}
],
"manifests": [
{
"manifest": {
"identifier": "manifest1",
"type": "K8sManifest",
"spec": {
"store": {
"type": "Github",
"spec": {
"connectorRef": "<+input>",
"gitFetchType": "Branch",
"paths": [
"files1"
],
"repoName": "<+input>",
"branch": "master"
}
},
"skipResourceVersioning": false
}
}
}
],
"configFiles": [
{
"configFile": {
"identifier": "configFile1",
"spec": {
"store": {
"type": "Harness",
"spec": {
"files": [
"<+org.description>"
]
}
}
}
}
}
]
}
variables:
- name: v1
type: String
value: val1
manifests:
- manifest:
identifier: manifest1
type: K8sManifest
spec:
store:
type: Github
spec:
connectorRef: "<+input>"
gitFetchType: Branch
paths:
- files1
repoName: "<+input>"
branch: master
skipResourceVersioning: false
configFiles:
- configFile:
identifier: configFile1
spec:
store:
type: Harness
spec:
files:
- "<+org.description>"
EOT
}
Expand All @@ -163,15 +142,10 @@ func testAccDataSourceServiceOverrides(id string, name string) string {
env_id = data.harness_platform_service_overrides_v2.test.env_id
type = "ENV_GLOBAL_OVERRIDE"
yaml = <<-EOT
{
"variables": [
{
"name": "v2",
"type": "String",
"value": "val2"
}
]
}
variables:
- name: v2
type: String
value: val2
EOT
}
`, id, name)
Expand Down

0 comments on commit 72c8ba2

Please sign in to comment.