Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bin manager support #194

Merged
merged 6 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 2.7.0 (May 29, 2024). Tested on Artifactory 7.84.12 and Xray 3.96.1

FEATURES:

* resource/xray_binary_manager_repos and resource/xray_binary_manager_builds: Add new resources to support adding repositories or builds to binary manager indexing configuration. PR: [#194](https://github.com/jfrog/terraform-provider-xray/pull/194) Issue: [#129](https://github.com/jfrog/terraform-provider-xray/issues/129)

## 2.6.0 (May 6, 2024). Tested on Artifactory 7.84.11 and Xray 3.95.7

FEATURES:
Expand Down
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fmt:
@go fmt ./...

doc:
rm docs/debug.md
rm -f docs/debug.md
go generate

.PHONY: build fmt
29 changes: 29 additions & 0 deletions docs/resources/binary_manager_builds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "xray_binary_manager_builds Resource - terraform-provider-xray"
subcategory: ""
description: |-
Provides an Xray Binary Manager Builds Indexing configuration resource. See Indexing Xray Resources https://jfrog.com/help/r/jfrog-security-documentation/add-or-remove-resources-from-indexing and REST API https://jfrog.com/help/r/xray-rest-apis/update-builds-indexing-configuration for more details.
---

# xray_binary_manager_builds (Resource)

Provides an Xray Binary Manager Builds Indexing configuration resource. See [Indexing Xray Resources](https://jfrog.com/help/r/jfrog-security-documentation/add-or-remove-resources-from-indexing) and [REST API](https://jfrog.com/help/r/xray-rest-apis/update-builds-indexing-configuration) for more details.



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `id` (String) ID of the binary manager, e.g. 'default'
- `indexed_builds` (Set of String) Builds to be indexed.

### Optional

- `project_key` (String) For Xray version 3.21.2 and above with Projects, a Project Admin with Index Resources privilege can maintain the indexed and not indexed repositories in a given binary manger using this resource in the scope of a project.

### Read-Only

- `non_indexed_builds` (Set of String) Non-indexed builds for output.
48 changes: 48 additions & 0 deletions docs/resources/binary_manager_repos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "xray_binary_manager_repos Resource - terraform-provider-xray"
subcategory: ""
description: |-
Provides an Xray Binary Manager Repository Indexing configuration resource. See Indexing Xray Resources https://jfrog.com/help/r/jfrog-security-documentation/add-or-remove-resources-from-indexing and REST API https://jfrog.com/help/r/xray-rest-apis/update-repos-indexing-configuration for more details.
---

# xray_binary_manager_repos (Resource)

Provides an Xray Binary Manager Repository Indexing configuration resource. See [Indexing Xray Resources](https://jfrog.com/help/r/jfrog-security-documentation/add-or-remove-resources-from-indexing) and [REST API](https://jfrog.com/help/r/xray-rest-apis/update-repos-indexing-configuration) for more details.



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `id` (String) ID of the binary manager, e.g. 'default'
- `indexed_repos` (Attributes Set) Repositories to be indexed. (see [below for nested schema](#nestedatt--indexed_repos))

### Optional

- `project_key` (String) For Xray version 3.21.2 and above with Projects, a Project Admin with Index Resources privilege can maintain the indexed and not indexed repositories in a given binary manger using this resource in the scope of a project.

### Read-Only

- `non_indexed_repos` (Attributes Set) Non-indexed repositories for output. (see [below for nested schema](#nestedatt--non_indexed_repos))

<a id="nestedatt--indexed_repos"></a>
### Nested Schema for `indexed_repos`

Required:

- `name` (String) Name of the repository
- `package_type` (String) Artifactory package type. Valid value: Alpine, Bower, Cargo, Chef, Cocoapods, Composer, Conan, Conda, Cran, Debian, Docker, Gems, Generic, Gitlfs, Go, Gradle, Helm, Ivy, Maven, Npm, Nuget, Opkg, P2, Puppet, Pypi, Rpm, Sbt, Swift, Terraform, Terraformbackend, Vagrant, Vcs
- `type` (String) Repository type. Valid value: local, remote, federated


<a id="nestedatt--non_indexed_repos"></a>
### Nested Schema for `non_indexed_repos`

Required:

- `name` (String)
- `package_type` (String)
- `type` (String)
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module github.com/jfrog/terraform-provider-xray

require (
github.com/go-resty/resty/v2 v2.13.1
github.com/hashicorp/go-version v1.6.0
github.com/hashicorp/go-version v1.7.0
github.com/hashicorp/terraform-plugin-docs v0.19.2
github.com/hashicorp/terraform-plugin-framework v1.8.0
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
Expand All @@ -14,9 +14,10 @@ require (
github.com/hashicorp/terraform-plugin-mux v0.16.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0
github.com/hashicorp/terraform-plugin-testing v1.5.1
github.com/jfrog/terraform-provider-shared v1.25.2
github.com/jfrog/terraform-provider-shared v1.25.3
github.com/samber/lo v1.39.0
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819
golang.org/x/text v0.15.0
)

require (
Expand Down Expand Up @@ -79,7 +80,6 @@ require (
golang.org/x/mod v0.16.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/tools v0.13.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/hc-install v0.6.4 h1:QLqlM56/+SIIGvGcfFiwMY3z5WGXT066suo/v9Km8e0=
github.com/hashicorp/hc-install v0.6.4/go.mod h1:05LWLy8TD842OtgcfBbOT0WMoInBMUSHjmDx10zuBIA=
github.com/hashicorp/hcl/v2 v2.20.1 h1:M6hgdyz7HYt1UN9e61j+qKJBqR3orTWbI1HKBJEdxtc=
Expand Down Expand Up @@ -130,8 +130,8 @@ github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM=
github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jfrog/terraform-provider-shared v1.25.2 h1:OdomF5La2wXEeI7k9muP6d2oclsZI5sgOldkEpVD2sc=
github.com/jfrog/terraform-provider-shared v1.25.2/go.mod h1:L987Z8XO4cuv7ys4Tw6sP/LESw7z0Dji0U2ysR8FUP4=
github.com/jfrog/terraform-provider-shared v1.25.3 h1:0P1H5WkNmhrXvXAo5pY1XkVn81CkZxcttDqZTESlKBw=
github.com/jfrog/terraform-provider-shared v1.25.3/go.mod h1:QthwPRUALElMt2RTGqoeB/3Vztx626YPBzIAoqEp0w0=
github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c=
github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo=
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
Expand Down
2 changes: 2 additions & 0 deletions pkg/xray/provider/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ func (p *XrayProvider) Configure(ctx context.Context, req provider.ConfigureRequ
// Resources satisfies the provider.Provider interface for ArtifactoryProvider.
func (p *XrayProvider) Resources(ctx context.Context) []func() resource.Resource {
return []func() resource.Resource{
xray_resource.NewBinaryManagerReposResource,
xray_resource.NewBinaryManagerBuildsResource,
xray_resource.NewSettingsResource,
xray_resource.NewWebhookResource,
xray_resource.NewWorkersCountResource,
Expand Down
Loading
Loading