-
Notifications
You must be signed in to change notification settings - Fork 0
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
PLT-1259: SDK Cut over with 4.3 changes #114
Conversation
@@ -202,6 +207,11 @@ func (h *V1Client) baseTransport() *transport.Runtime { | |||
return httpTransport | |||
} | |||
|
|||
func (h *V1Client) SetProjectContextForResource() *V1Client { |
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.
This can be accomplished by calling WithScopeProject
. Please remove.
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.
This is required because in Terraform, we have the provision to set resource-level context.
During provider initialization, we use project scope or tenant scope based on the user settings during initialization. Later on, the user can also set the context at the resource level (if user have right access).
For example, a user can initialize the client with project scope and then switch to create a resource at the tenant level as well.
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.
I understand that, but there's already a way that you can handle the requirement without introducing a new method on the V1Client.
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.
Please ping me and we can discuss.
@@ -234,3 +244,10 @@ func (h *V1Client) ValidateTenantAdmin() error { | |||
} | |||
return nil | |||
} | |||
|
|||
func ContextWithProject(c context.Context, projectUid string) context.Context { |
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.
See above comment. This function should not be required.
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.
This is required because in Terraform, we have the provision to set resource-level context.
During provider initialization, we use project scope or tenant scope based on the user settings during initialization. Later on, the user can also set the context at the resource level (if user have right access).
For example, a user can initialize the client with project scope and then switch to create a resource at the tenant level as well.
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.
Same as above. Let's discuss.
No description provided.