-
Notifications
You must be signed in to change notification settings - Fork 97
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
[Do Not Merge] Populate Terraform recipe deployed resource IDs in recipe output #6280
[Do Not Merge] Populate Terraform recipe deployed resource IDs in recipe output #6280
Conversation
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
Test Results2 970 tests - 3 2 961 ✔️ - 3 2m 21s ⏱️ -18s Results for commit b63816e. ± Comparison against base commit 6d306a1. This pull request removes 6 and adds 3 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
// Values represents the key/value pairs of properties of the deployed resource. | ||
Values map[string]any | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Option 2: Adding a new Property UCPResources to represent the resources deployed through UCP and Resources property represents the resources deployed otherwise(e.g terraform).
And use this information in the Processor to convert resource ids into OutputResources.
userResources, err := GetOutputResourcesFromResourcesField(*v.resourcesField) |
type RecipeOutput struct {
UCPResources []string
Resources []string
Secrets map[string]any
Values map[string]any
}
// Resources represents the list of output resources deployed recipe. | ||
//Resources []string | ||
|
||
OutputResources []rpv1.OutputResource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding OutputResources to recipeOutput response. Today we are returning the resource id strings as part of the recipe output response and as part of the processor converting into OutputResource objects.
But the resource ids returned by terraform may not in the UCP resource id format i.e it may not contain the scope segments and type segments. So we need use differnet ways of creating OutputResource for terraform resource ids.
So added the changes to create getOutputResource from resource ids in respective drivers.
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
@@ -46,6 +46,8 @@ type ID struct { | |||
extensionSegments []TypeSegment | |||
} | |||
|
|||
// Handle Terraform IDs | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Option1 : Adding a new property "isUCPID" to differentiate between resources deployed thorugh UCP and non-UCP.
type ID struct {
id string
isNonUCPID bool
scopeSegments []ScopeSegment
typeSegments []TypeSegment
extensionSegments []TypeSegment
}
And add if
conditions on the struct methods to handle it for Non-UCP type resource ids.
Option 2:
type ID interface{
}
type UCPID struct{
id string
scopeSegments []ScopeSegment
typeSegments []TypeSegment
extensionSegments []TypeSegment
}
type NonUCPID struct{
id string
}
deployedResources := d.getDeployedOutputResources(tfState.Values.RootModule) | ||
resources = append(resources, deployedResources...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting resource ids parsing the state file.
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
@vishwahiremat should this PR be closed since we have moved to the new approach implemented in #6430? |
Yes, closing this PR |
Description
Added changed to populate Terraform recipe deployed resource IDs in recipe output.
Type of change
Fixes: #issue_number
Auto-generated summary
🤖 Generated by Copilot at 2984d12
Summary
No summary available (Limit exceeded: required to process 51960 tokens, but only 50000 are allowed per call)
Walkthrough
No walkthrough available (Limit exceeded: required to process 51960 tokens, but only 50000 are allowed per call)