Skip to content

Commit

Permalink
Added source_code_hash for mta (#171)
Browse files Browse the repository at this point in the history
Signed-off-by: Ray <[email protected]>
Co-authored-by: Ray <[email protected]>
  • Loading branch information
Dray56 and debTheRay authored Aug 7, 2024
1 parent 83d7412 commit 7f3d789
Show file tree
Hide file tree
Showing 11 changed files with 9,368 additions and 1,762 deletions.
2 changes: 1 addition & 1 deletion docs/resources/buildpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ resource "cloudfoundry_buildpack" "mybuildpack" {
- `locked` (Boolean) Whether or not the buildpack is locked to prevent updating the bits
- `path` (String) Path of the zip file for the buildpack
- `position` (Number) The order in which the buildpacks are checked during buildpack auto-detection
- `source_code_hash` (String) source_code_hash
- `source_code_hash` (String) SHA256 hash of the file specified. Terraform relies on this to detect the file changes.
- `stack` (String) The name of the stack that the buildpack will use

### Read-Only
Expand Down
1 change: 1 addition & 0 deletions docs/resources/mta.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ resource "cloudfoundry_mta" "mtar" {
- `mtar_path` (String) The local path where the MTA archive is present. Either this attribute or mtar_url need to be set.
- `mtar_url` (String) The remote URL where the MTA archive is present
- `namespace` (String) The namespace of the MTA. Should be of valid host format
- `source_code_hash` (String) SHA256 hash of the file specified. Terraform relies on this to detect the file changes.

### Read-Only

Expand Down
4 changes: 4 additions & 0 deletions internal/provider/datasource_mta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type MtaResourceModelPtr struct {
Mta *string
Namespace *string
Id *string
SourceCodeHash *string
}

func hclDataSourceMta(mdsmp *MtaDataSourceModelPtr) string {
Expand Down Expand Up @@ -91,6 +92,9 @@ func hclResourceMta(mrmp *MtaResourceModelPtr) string {
{{if .ExtensionDescriptors}}
extension_descriptors = {{.ExtensionDescriptors}}
{{- end -}}
{{if .SourceCodeHash}}
source_code_hash = "{{.SourceCodeHash}}"
{{- end -}}
{{if .DeployUrl}}
deploy_url = "{{.DeployUrl}}"
{{- end }}
Expand Down
2,972 changes: 2,296 additions & 676 deletions internal/provider/fixtures/resource_mta.yaml

Large diffs are not rendered by default.

1,152 changes: 135 additions & 1,017 deletions internal/provider/fixtures/resource_mta_invalid_mta_path.yaml

Large diffs are not rendered by default.

184 changes: 122 additions & 62 deletions internal/provider/fixtures/resource_mta_invalid_namespace.yaml

Large diffs are not rendered by default.

Loading

0 comments on commit 7f3d789

Please sign in to comment.