Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Conversation

@jor2
Copy link
Member

@jor2 jor2 commented Mar 25, 2024

Description

add profile submodule
#76

Release required?

  • No release
  • Patch release (x.x.X)
  • Minor release (x.X.x)
  • Major release (X.x.x)
Release notes content

Support creating a new submodule called profile which supports creating a custom scc profile.

Run the pipeline

If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.

Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:

/run pipeline

Checklist for reviewers

  • If relevant, a test for the change is included or updated with this PR.
  • If relevant, documentation for the change is included or updated with this PR.

For mergers

  • Use a conventional commit message to set the release level. Follow the guidelines.
  • Include information that users need to know about the PR in the commit message. The commit message becomes part of the GitHub release notes.
  • Use the Squash and merge option.

@jor2 jor2 self-assigned this Mar 25, 2024
@jor2 jor2 marked this pull request as draft March 27, 2024 13:33
@jor2 jor2 changed the title feat: add profile submodule [WIP] feat: add profile submodule Mar 27, 2024
@jor2
Copy link
Member Author

jor2 commented Apr 2, 2024

/run pipeline

@jor2 jor2 requested a review from ocofaigh April 2, 2024 00:11
@jor2 jor2 changed the title [WIP] feat: add profile submodule feat: add profile submodule Apr 3, 2024
@jor2 jor2 marked this pull request as ready for review April 3, 2024 10:34
@jor2
Copy link
Member Author

jor2 commented Apr 3, 2024

/run pipeline

@jor2
Copy link
Member Author

jor2 commented Apr 3, 2024

/run pipeline

@jor2
Copy link
Member Author

jor2 commented Apr 3, 2024

/run pipeline

@jor2
Copy link
Member Author

jor2 commented Apr 12, 2024

/run pipeline

@jor2
Copy link
Member Author

jor2 commented Apr 14, 2024

/run pipeline

Copy link
Contributor

@ocofaigh ocofaigh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jor2 I think there is some confusion around the way you have implemented this. I left some comments. If we need to sync up let me know

]

profile_name = "${var.prefix}-profile"
profile_description = "scc-custom"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This use case makes no sense? What I would expect is that the code should be creating a custom profile made up of controls. It shouldn't matter about what control library they came from

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Names are weird for each control, just numbers or AC-1(B) etc
Screenshot 2024-04-18 at 01 02 38

@jor2 jor2 requested a review from ocofaigh April 18, 2024 09:51
Copy link
Contributor

@ocofaigh ocofaigh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took me a while to follow whats going on here, but I think its correct. Just a few minor comments. Also suggest you add more code comments to help people understand what the code is doing

type = string
description = "The profile description. Constraints: The maximum length is `256` characters. The minimum length is `2` characters. The value must match regular expression `/[A-Za-z0-9]+/`."
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm I would expect there to be a variable to specify the profile version, but I don't see that as an option with the provider: https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/scc_profile

Might be a bug, I have reached out to SCC team

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it, but it didn't seem to take affect. still says version is 0.0.0. Maybe custom can't have versions?

@jor2 jor2 requested a review from ocofaigh April 18, 2024 22:13
@jor2 jor2 requested a review from toddgiguere as a code owner May 23, 2024 10:52
@jor2
Copy link
Member Author

jor2 commented Jun 4, 2024

Setting the initial version of the profile seems to work with 1.66.0 of the provider, but on reapply when I try to make changes and create a new version it seems to crash.

2024-06-04T23:46:25.660+0100 [ERROR] vertex "module.create_scc_profile.ibm_scc_profile.scc_profile_instance" error: Plugin did not respond
╷
│ Error: Plugin did not respond
│ 
│   with module.create_scc_profile.ibm_scc_profile.scc_profile_instance,
│   on ../../modules/profile/main.tf line 44, in resource "ibm_scc_profile" "scc_profile_instance":
│   44: resource "ibm_scc_profile" "scc_profile_instance" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
╵

Stack trace from the terraform-provider-ibm_v1.66.0 plugin:

panic: interface conversion: interface {} is nil, not string

goroutine 114 [running]:
github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc.resourceIbmSccProfileMapToReplaceProfileOptions(0xc005d0ae10)
	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_profile.go:687 +0x8f4
github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc.resourceIbmSccProfileUpdate({0x8dbc548, 0xc00436f9d0}, 0xc002012680, {0x8d60660, 0xc001cc8008})
	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_profile.go:575 +0x777
github.com/IBM-Cloud/terraform-provider-ibm/ibm/provider.wrapResource.wrapFunction.func5({0x8dbc548?, 0xc00436f9d0?}, 0x1176592e000?, {0x8d60660?, 0xc001cc8008?})
	github.com/IBM-Cloud/terraform-provider-ibm/ibm/provider/provider.go:1587 +0x2c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0xc001709dc0, {0x8dbc4a0, 0xc0057d08d0}, 0xc002012680, {0x8d60660, 0xc001cc8008})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:812 +0x119
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc001709dc0, {0x8dbc4a0, 0xc0057d08d0}, 0xc000fca340, 0xc004008b00, {0x8d60660, 0xc001cc8008})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:919 +0x83a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0009f1cb0, {0x8dbc4a0?, 0xc0057d0810?}, 0xc002934050)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1060 +0xd5c
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc00073bae0, {0x8dbc4a0?, 0xc003886030?}, 0xc0004e0070)
	github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:859 +0x56f
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x8bd2ce0, 0xc00073bae0}, {0x8dbc4a0, 0xc003886030}, 0xc0004e0000, 0x0)
	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:467 +0x1a6
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000330960, {0x8dc8460, 0xc00164da00}, 0xc003730480, 0xc0016e6750, 0xafb27d8, 0x0)
	google.golang.org/[email protected]/server.go:1358 +0xde3
google.golang.org/grpc.(*Server).handleStream(0xc000330960, {0x8dc8460, 0xc00164da00}, 0xc003730480, 0x0)
	google.golang.org/[email protected]/server.go:1735 +0x9da
google.golang.org/grpc.(*Server).serveStreams.func1.1()
	google.golang.org/[email protected]/server.go:970 +0xbb
created by google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 29
	google.golang.org/[email protected]/server.go:981 +0x136

Error: The terraform-provider-ibm_v1.66.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.

2024-06-04T23:46:25.840+0100 [DEBUG] provider: plugin exited

@ocofaigh
Copy link
Contributor

No plans to implement

@ocofaigh ocofaigh closed this Nov 15, 2024
@ocofaigh ocofaigh deleted the profiles branch November 15, 2024 14:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants