Giter Club home page Giter Club logo

terraform-provider-sonatypeiq's People

Contributors

grahamhar avatar iverberk avatar madpah avatar

Stargazers

 avatar  avatar

Watchers

 avatar

terraform-provider-sonatypeiq's Issues

organization id can not be provided

The resource documentation for sonatypeiq_organization states that you can provide an ID (https://registry.terraform.io/providers/sonatype-nexus-community/sonatypeiq/latest/docs/resources/organization) but doing so leads to an error:

when applying changes to sonatypeuq_organization.xyz, provider "$NAME" produced an unexpected new value: .id: was cty.StringVal("xyz"), but now cty.StringVal("234324adb")

I think the ID is an auto-generated value and can not be set explicitly? It's also not supported in the REST API. This is probably more of a documentation issue: ID should not be part of attributes that you can set.

Allow import of application to state

When an application has been created outside of Terraform control and needs to be brought under it's control the import function needs to be implemented.

I will do a PR for this

Product License

APIs for POST and DELETE /api/v2/product/license are not documented.

There is also not GET API for Product License currently.

Environment variable config not working

iqUrl := os.Getenv("IQ_SERVER_URL")

Looking at that code it seems like it should be possible to configure the url/username/password via env vars, rather than requiring them to be in plain-text in the configuration files (which for security is obviously unacceptable).

Am I just doing something wrong or are they not meant to work for normal use, and only for the integration tests?

Future plans?

Hi @madpah,

I'm currently investigating if I can extend the provider with some resources that I need (e.g. roles, user access, etc.). What are your plans for the provider? Is this still being developed?

Thanks!

Support `goreleaser` version 2+

Since goreleaser version 2.x.x became the latest, our CI Release has had to be pinned to goreleaser >2.

See error from here:

Run goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7
  with:
    args: release --clean
    distribution: goreleaser
    version: latest
    workdir: .
    install-only: false
  env:
    GITHUB_TOKEN: ***
    GPG_FINGERPRINT: 1893C1319840BA076A5B789BF6C9F8B9A4D0E019
Downloading https://github.com/goreleaser/goreleaser/releases/download/v[2](https://github.com/sonatype-nexus-community/terraform-provider-sonatypeiq/actions/runs/9564419737/job/26365095334#step:5:2).0.1
/goreleaser_Linux_x86_64.tar.gz
Extracting GoReleaser
/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/d960648f-[3](https://github.com/sonatype-nexus-community/terraform-provider-sonatypeiq/actions/runs/9564419737/job/26365095334#step:5:3)c85-44c4-8511-48a5775d37e1 -f /home/runner/work/_temp/b[4](https://github.com/sonatype-nexus-community/terraform-provider-sonatypeiq/actions/runs/9564419737/job/26365095334#step:5:4)55e0fe-5739-40f3-b7a7-aab3[5](https://github.com/sonatype-nexus-community/terraform-provider-sonatypeiq/actions/runs/9564419737/job/26365095334#step:5:5)4b12cc8
GoReleaser latest installed successfully
/opt/hostedtoolcache/goreleaser-action/2.0.1/x[6](https://github.com/sonatype-nexus-community/terraform-provider-sonatypeiq/actions/runs/9564419737/job/26365095334#step:5:6)4/goreleaser release --clean
  • starting release...
  • only configurations files on version: 2 are supported, yours is version: 0, please update your configuration
  ⨯ release failed after 0s                  error=only configurations files on version: 2 are supported, yours is version: 0, please update your configuration
Error: The process '/opt/hostedtoolcache/goreleaser-action/2.0.1/x64/goreleaser' failed with exit code 1

See also https://goreleaser.com/blog/goreleaser-v2/

[enhancement]: resource sonatypeiq_source_control does not support import

Expected Behavior

The ability to import the resource sonatypeiq_source_control does not exist, I will put a PR together to add this.

Actual Behavior

NA

Sonatype IQ Server Version

175

Terraform Version

1.8.5

Affected Resource(s)

sonatypeiq_source_control

Terraform Configuration Files

NA

Steps to Reproduce

NA

Debug Output

NA

Panic Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

unable to add resource Organization or sub-organization

Hello,
Using the provider I am getting the following error when trying to setup an Organization or sub-organization:

Error: Value Conversion Error
│
│   with sonatypeiq_organization.tenant,
│ An unexpected error was encountered trying to convert tftypes.Value into provider.organizationModelResouce. This is always an error in the provider. Please report the following to the provider developer:
│
│ mismatch between struct and object: Object defines fields not found in struct: tags, id, name, and parent_organization_id.
╵
╷
│ Error: Value Conversion Error
│
│   with sonatypeiq_organization.sub_org,
│ An unexpected error was encountered trying to convert tftypes.Value into provider.organizationModelResouce. This is always an error in the provider. Please report the following to the provider developer:
│
│ mismatch between struct and object: Object defines fields not found in struct: name, parent_organization_id, tags, and id.

It seems to be an issue in the provider code.

I've also tested the resource to add a proxy and to set the Base-url ands these work well.

This is the tf-file I'm using for the Organization:

data "sonatypeiq_organization" "sandbox" {
  name = "Sandbox Organization"
}

resource "sonatypeiq_organization" "sub_org" {
  name                   = "Sub Organization"
  parent_organization_id = data.sonatypeiq_organization.sandbox.id
}

output "sub_org_id" {
  value = sonatypeiq_organization.sub_org.id
}

thanks!

Credential requirements

Hi,

In the documentation from the provider it suggest the administrator user and password are required. I am hoping to use this provider to allow a subset of users to manage their applications under an organisation. I would like to confirm that this will work by providing their API credentials scoped with permissions for the resource they will be creating?

Add source control resource

I have a requirement to manage the source control configuration of applications independantly of the organisation they sit in, adding a new resource sonatypeiq_source_control to do this, it will also manage the same settings for an organisation or the root as per the API spec.

@madpah I am actively working on this so please assign to me.

Change in `organizationID` fails on application update

When the organization_id attribute is changed for an existing resource the apply of the plan fails. This reflects that there is a specific rest API for moving an application between organisations.

Please assign to me as I am working on a fix.

Create a contributing guide

To help people contribute to the codebase it would be useful to create a CONTRIBUTING.md containing full instructions for setting up the development environment, running tests and updating the documentation.

This document might contain mainly links to the existing documentation on working with the terraform-provider-framework but I think it will be of use.

Once this is in place the README.md can become a general guide about the usage of the provider.

MVP data source and resources

This is a list of data-sources and resources considered to be required for the MVP of this provider:

Data Sources

  • Application
  • Applications
  • Application Categories
  • Config
    • Base URL
    • Force Base URL
  • Config SAML Metadata
  • Organization
  • Organizations
  • Role via #8 - thanks @iverberk

Resources

  • Application
  • Application Category
  • Application Role Membership via #12 - thanks @iverberk
  • Config
    • Base URL
    • Force Base URL
  • Config Artifactory Connection
  • Config Crowd
  • Config JIRA
  • Config Mail
  • Config Proxy Server
  • Config SAML
  • #2
  • Organization Role Membership via #12 - thanks @iverberk
  • #3
  • User
  • Users

[BUG]: Import of sonatypeiq_source_control fails

Expected Behavior

The resource should have been imported. This has failed on 2 resources I have tried to import, I will attempt to do further testing as I worked around the issue by deleting the configuration using the rest API and then recreating.

If there isn't sufficient debug output I will do a PR to add that.

Actual Behavior

The provider crashed, see output below.

Sonatype IQ Server Version

175

Terraform Version

1.8.5

Affected Resource(s)

sonatypeiq_source_control

Terraform Configuration Files

No response

Steps to Reproduce

No response

Debug Output

No response

Panic Output

Stack trace from the terraform-provider-sonatypeiq_v0.8.0 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x154eb00]

goroutine 376 [running]:
terraform-provider-sonatypeiq/internal/provider.(*sourceControlResource).Read(0xc0006ed530, {0x1b03448, 0xc0006ed4a0}, {{{{0x1b077d0, 0xc0000a4ab0}, {0x18aace0, 0xc0000a45a0}}, {0x1b09128, 0xc0000a3a40}}, 0xc0003bc060, ...}, ...)
        terraform-provider-sonatypeiq/internal/provider/source_control_resource.go:205 +0x520
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ReadResource(0xc0001a6dc0, {0x1b03448, 0xc0006ed4a0}, 0xc0006ed560, 0xc00037d6c8)
        github.com/hashicorp/[email protected]/internal/fwserver/server_readresource.go:101 +0x64e
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ReadResource(0xc0001a6dc0, {0x1b03448?, 0xc0006ed380?}, 0xc00071f500)
        github.com/hashicorp/[email protected]/internal/proto6server/server_readresource.go:55 +0x3e5
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ReadResource(0xc0002528c0, {0x1b03448?, 0xc0006ec9f0?}, 0xc000740ae0)
        github.com/hashicorp/[email protected]/tfprotov6/tf6server/server.go:776 +0x4c3
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ReadResource_Handler({0x19a3160?, 0xc0002528c0}, {0x1b03448, 0xc0006ec9f0}, 0xc0003b3d00, 0x0)
        github.com/hashicorp/[email protected]/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:482 +0x169
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001bb000, {0x1b03448, 0xc0006ec960}, {0x1b08140, 0xc00040c1a0}, 0xc0004e26c0, 0xc000335290, 0x21249c8, 0x0)
        google.golang.org/[email protected]/server.go:1385 +0xe03
google.golang.org/grpc.(*Server).handleStream(0xc0001bb000, {0x1b08140, 0xc00040c1a0}, 0xc0004e26c0)
        google.golang.org/[email protected]/server.go:1796 +0xfec
google.golang.org/grpc.(*Server).serveStreams.func2.1()
        google.golang.org/[email protected]/server.go:1029 +0x8b
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 36
        google.golang.org/[email protected]/server.go:1040 +0x135

Error: The terraform-provider-sonatypeiq_v0.8.0 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.