Skip to content

Commit 93f1732

Browse files
authored
Export StackConfiguration#UploadTarGzip (#1219)
1 parent 2b32a70 commit 93f1732

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Unreleased
22

3+
## Enhancements
4+
* Exports the StackConfiguration UploadTarGzip receiver function[#1219](https://github.com/hashicorp/go-tfe/pull/1219)
5+
36
# v1.92.0
47

58
## Enhancements

stack_configuration.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ type StackConfigurations interface {
2121
// configuration files in association with a Stack.
2222
CreateAndUpload(ctx context.Context, stackID string, path string, opts *CreateStackConfigurationOptions) (*StackConfiguration, error)
2323

24+
// Upload a tar gzip archive to the specified stack configuration upload URL.
25+
UploadTarGzip(ctx context.Context, url string, archive io.Reader) error
26+
2427
// ReadConfiguration returns a stack configuration by its ID.
2528
Read(ctx context.Context, id string) (*StackConfiguration, error)
2629

@@ -195,7 +198,7 @@ func (s stackConfigurations) CreateAndUpload(ctx context.Context, stackID, path
195198
return nil, err
196199
}
197200

198-
err = s.uploadTarGzip(ctx, uploadURL, body)
201+
err = s.UploadTarGzip(ctx, uploadURL, body)
199202
if err != nil {
200203
return nil, err
201204
}
@@ -250,6 +253,6 @@ func (s stackConfigurations) pollForUploadURL(ctx context.Context, stackConfigur
250253
//
251254
// **Note**: This method does not validate the content being uploaded and is therefore the caller's
252255
// responsibility to ensure the raw content is a valid Terraform configuration.
253-
func (s stackConfigurations) uploadTarGzip(ctx context.Context, uploadURL string, archive io.Reader) error {
256+
func (s stackConfigurations) UploadTarGzip(ctx context.Context, uploadURL string, archive io.Reader) error {
254257
return s.client.doForeignPUTRequest(ctx, uploadURL, archive)
255258
}

0 commit comments

Comments
 (0)