-
Notifications
You must be signed in to change notification settings - Fork 85
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
Implement multi-tenancy support for relevant resources #895
Conversation
nsxt/utils.go
Outdated
@@ -662,3 +662,25 @@ func handlePagination(lister func(*paginationInfo) error) (int64, error) { | |||
|
|||
return total, nil | |||
} | |||
|
|||
func getContextSchema(forceNew bool) *schema.Schema { |
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.
When do we expect forceNew to be false?
Since context triggers object path change, seems to me ForceNew should always be defined
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.
Indeed. Thanks :)
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'm guessing that the whole context - no matter what we'll add to it in the future, should be ForceNew as well.
1d1fa0f
to
561c60b
Compare
/test-all |
26e5ce6
to
45c086f
Compare
/test-all |
90c9528
to
24f7a22
Compare
d.Set("display_name", obj.DisplayName) | ||
d.Set("description", obj.Description) | ||
d.Set("path", obj.Path) | ||
err := resourceNsxtPolicyTier1GatewayReadEdgeCluster(d, connector) |
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.
looks like edge cluster would not be set for local manager?
nsxt/policy_search.go
Outdated
var cursor *string | ||
total := 0 | ||
|
||
// Make sure global objects are not found (path needs to start with infra) |
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 comment is not relevant here
if gwID == "" { | ||
// infra segment | ||
client := segments.NewDhcpStaticBindingConfigsClient(connector) | ||
if context.ClientType == utl.Global || gwID == "" { |
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.
fixed segments might be supported on GM now. I suggest not to change the logic in this PR but lets check this later (it would simplify the code to only look at GW present in this condition)
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.
OK. So should we open an issue to track this?
11a99b6
to
3481f4b
Compare
/test-all |
335e5fe
to
1106dfc
Compare
type: Multitenancy | ||
model_name: PolicyContextProfile | ||
obj_name: ContextProfile | ||
var_name: policyContextProfileParam |
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.
Could you please explain the purpose of var_name
? Can it be unified across all resources?
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.
Schema is explained at the top of the file. Specifically, var_name
explained here
return nil, err[0] | ||
} | ||
|
||
gmObj, err := converter.ConvertToGolang(dataValue, destType) |
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 not specific to gm (global manager). Perhaps convertedObj
?
I wonder if enforcement points relevant for /orgs? We have functions like |
|
7934a6f
to
2295333
Compare
We would also need to craft a documentation guide for multitenancy use case, but this can be added in follow up |
28e0c6d
to
16d0498
Compare
/test-all |
Signed-off-by: Kobi Samoray <[email protected]>
/test-all |
Some of the resource have been added support to multi-tenancy.
Support is implemented using a generated API wrapper, which abstracts the calls to the various NSX APIs (local manager/global manager/multi tenancy).