diff --git a/adapter/kubernetes/src/main/java/com/vmware/admiral/adapter/pks/service/PKSAdapterService.java b/adapter/kubernetes/src/main/java/com/vmware/admiral/adapter/pks/service/PKSAdapterService.java index fe6a1bb1f..99bf2c757 100644 --- a/adapter/kubernetes/src/main/java/com/vmware/admiral/adapter/pks/service/PKSAdapterService.java +++ b/adapter/kubernetes/src/main/java/com/vmware/admiral/adapter/pks/service/PKSAdapterService.java @@ -413,9 +413,9 @@ private void validate(RequestContext ctx) { AssertUtil.assertNotNull(cluster.parameters, "cluster parameters"); AssertUtil.assertNotEmpty((String) cluster.parameters.get(PKS_MASTER_HOST_FIELD), "master host address"); - AssertUtil.assertNotEmpty((String) cluster.parameters.get(PKS_MASTER_PORT_FIELD), + AssertUtil.assertNotNull(cluster.parameters.get(PKS_MASTER_PORT_FIELD), "master host port"); - AssertUtil.assertNotEmpty((String) cluster.parameters.get(PKS_WORKER_INSTANCES_FIELD), + AssertUtil.assertNotNull(cluster.parameters.get(PKS_WORKER_INSTANCES_FIELD), "worker instances"); break; case RESIZE_CLUSTER: diff --git a/compute/src/main/java/com/vmware/admiral/compute/cluster/ClusterService.java b/compute/src/main/java/com/vmware/admiral/compute/cluster/ClusterService.java index a4c0c6992..db988ca3a 100644 --- a/compute/src/main/java/com/vmware/admiral/compute/cluster/ClusterService.java +++ b/compute/src/main/java/com/vmware/admiral/compute/cluster/ClusterService.java @@ -14,6 +14,8 @@ import static java.util.EnumSet.of; import static com.vmware.admiral.adapter.pks.PKSConstants.PKS_CLUSTER_NAME_PROP_NAME; +import static com.vmware.admiral.adapter.pks.PKSConstants.PKS_CLUSTER_UUID_PROP_NAME; +import static com.vmware.admiral.adapter.pks.PKSConstants.PKS_ENDPOINT_PROP_NAME; import java.net.HttpURLConnection; import java.net.URI; @@ -651,10 +653,18 @@ private void createHostInCluster(Operation post) { PropertyUtils.getPropertyString(hostSpec.hostState.customProperties, ContainerHostService.CUSTOM_PROPERTY_HOST_ALIAS) .orElse(null)); + map.put(PKS_ENDPOINT_PROP_NAME, + PropertyUtils.getPropertyString(hostSpec.hostState.customProperties, + PKS_ENDPOINT_PROP_NAME) + .orElse(null)); map.put(PKS_CLUSTER_NAME_PROP_NAME, PropertyUtils.getPropertyString(hostSpec.hostState.customProperties, PKS_CLUSTER_NAME_PROP_NAME) .orElse(null)); + map.put(PKS_CLUSTER_UUID_PROP_NAME, + PropertyUtils.getPropertyString(hostSpec.hostState.customProperties, + PKS_CLUSTER_UUID_PROP_NAME) + .orElse(null)); sendWithDeferredResult( Operation.createPut(UriUtils.buildUri(getHost(), ContainerHostService.SELF_LINK)) diff --git a/request/src/main/java/com/vmware/admiral/request/RequestBrokerService.java b/request/src/main/java/com/vmware/admiral/request/RequestBrokerService.java index ebc583ac7..2095cc7d7 100644 --- a/request/src/main/java/com/vmware/admiral/request/RequestBrokerService.java +++ b/request/src/main/java/com/vmware/admiral/request/RequestBrokerService.java @@ -1357,7 +1357,7 @@ private void createPKSClusterProvisioningTask(RequestBrokerState state) { task.documentSelfLink = getSelfId(); task.serviceTaskCallback = ServiceTaskCallback.create( state.documentSelfLink, TaskStage.STARTED, SubStage.COMPLETED, - TaskStage.FAILED, SubStage.REQUEST_FAILED); + TaskStage.STARTED, SubStage.REQUEST_FAILED); task.customProperties = state.customProperties; task.endpointLink = state.getCustomProperty(PKSConstants.PKS_ENDPOINT_PROP_NAME); task.tenantLinks = state.tenantLinks; @@ -1389,7 +1389,7 @@ private void createPKSClusterRemovalTasks(RequestBrokerState state, boolean clea task.documentSelfLink = getSelfId(); task.serviceTaskCallback = ServiceTaskCallback.create(state.documentSelfLink, TaskStage.STARTED, errorState ? SubStage.ERROR : SubStage.COMPLETED, - TaskStage.FAILED, SubStage.ERROR); + TaskStage.STARTED, SubStage.ERROR); task.customProperties = state.customProperties; task.endpointLink = state.getCustomProperty(PKSConstants.PKS_ENDPOINT_PROP_NAME); diff --git a/request/src/main/java/com/vmware/admiral/request/pks/PKSClusterRemovalTaskService.java b/request/src/main/java/com/vmware/admiral/request/pks/PKSClusterRemovalTaskService.java index 9400e6139..68c82a902 100644 --- a/request/src/main/java/com/vmware/admiral/request/pks/PKSClusterRemovalTaskService.java +++ b/request/src/main/java/com/vmware/admiral/request/pks/PKSClusterRemovalTaskService.java @@ -21,7 +21,6 @@ import static com.vmware.xenon.common.ServiceDocumentDescription.PropertyIndexingOption.STORE_ONLY; import static com.vmware.xenon.common.ServiceDocumentDescription.PropertyUsageOption.AUTO_MERGE_IF_NOT_NULL; import static com.vmware.xenon.common.ServiceDocumentDescription.PropertyUsageOption.REQUIRED; -import static com.vmware.xenon.common.ServiceDocumentDescription.PropertyUsageOption.SINGLE_ASSIGNMENT; import java.net.URI; import java.util.Arrays; @@ -63,10 +62,9 @@ public static class PKSClusterRemovalTaskState extends com.vmware.admiral.service.common.TaskServiceDocument { /** - * (Required) PKS endpoint self link. + * PKS endpoint self link. */ - @PropertyOptions(usage = { REQUIRED, SINGLE_ASSIGNMENT, AUTO_MERGE_IF_NOT_NULL }, - indexing = STORE_ONLY) + @PropertyOptions(usage = { AUTO_MERGE_IF_NOT_NULL }, indexing = STORE_ONLY) public String endpointLink; /** * (Required) The resource on which the given operation will be applied