Skip to content

Commit

Permalink
Correctly propagate tenant links when using PlacementZoneUtil
Browse files Browse the repository at this point in the history
Until now, tenant links were attached to the underlying resource pool
state, but not to the elastic placement zone state. This approach works
for systems where the elastic placement zone state contains no tenant
links. If this is not the case, the tenant links of the resource pool
state are overwritten.

This resulted in problems in VCA mode where an organization tenant link
is attached to the elastic placement zone. This removes the project link
that gets set from the PlacementZoneUtil.

To fix this, we manually set the tenant links of the elastic placement
zone state as well.

Change-Id: If9ed3f36148d71592c2949eaef4153235227214e
Reviewed-on: https://bellevue-ci.eng.vmware.com:8080/47427
Closures-Verified: jenkins <[email protected]>
Upgrade-Verified: jenkins <[email protected]>
PG-Verified: jenkins <[email protected]>
CS-Verified: jenkins <[email protected]>
Bellevue-Verified: jenkins <[email protected]>
Reviewed-by: Sergio Sanchez <[email protected]>
  • Loading branch information
shadjiiski committed Oct 25, 2018
1 parent c2ccd57 commit 0ffbf05
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 VMware, Inc. All Rights Reserved.
* Copyright (c) 2017-2018 VMware, Inc. All Rights Reserved.
*
* This product is licensed to you under the Apache License, Version 2.0 (the "License").
* You may not use this product except in compliance with the License.
Expand Down Expand Up @@ -126,13 +126,15 @@ public static DeferredResult<ResourcePoolState> generatePlacementZone(ServiceHos
resourcePool.customProperties.put(PKS_ENDPOINT_PROP_NAME, s);
}

// create the placement zone
ElasticPlacementZoneConfigurationState placementZone = new ElasticPlacementZoneConfigurationState();
placementZone.resourcePoolState = resourcePool;

if (hostState.tenantLinks != null) {
resourcePool.tenantLinks = new ArrayList<>(hostState.tenantLinks);
placementZone.tenantLinks = new ArrayList<>(hostState.tenantLinks);
}

// create the placement zone
ElasticPlacementZoneConfigurationState placementZone = new ElasticPlacementZoneConfigurationState();
placementZone.resourcePoolState = resourcePool;
return serviceHost.sendWithDeferredResult(
Operation
.createPost(serviceHost, ElasticPlacementZoneConfigurationService.SELF_LINK)
Expand Down

0 comments on commit 0ffbf05

Please sign in to comment.