withNewMetadata().withLabels(subscriptionLabels).endMetadata(). withNewSpec().withReplicas(1). withNewTemplate().withNewMetadata().withLabels(subscriptionLabels).endMetadata().
Deployment deployment = new DeploymentBuilder() .withNewMetadata() .withName(deploymentName) .addToAnnotations(BROOKLYN_ENTITY_ID, entity.getId()) .addToAnnotations(BROOKLYN_APPLICATION_ID, entity.getApplicationId()) .endMetadata() .withNewSpec() .withReplicas(replicas)
Deployment deployment = new DeploymentBuilder() .withNewMetadata() .withName(deploymentModel.getName()) .withLabels(deploymentModel.getLabels()) .withAnnotations(deploymentModel.getAnnotations()) .withNamespace(dataHolder.getNamespace()) .endMetadata() .withNewSpec() .withReplicas(deploymentModel.getReplicas())
@Override public void visit(DeploymentBuilder resource) { DeploymentFluent.MetadataNested<DeploymentBuilder> metadata = resource.editMetadata(); if (metadata == null) { resource.withNewMetadata().withName(defaultName).endMetadata(); } else { if (Strings.isNullOrBlank(metadata.getName())) { metadata.withName(defaultName).endMetadata(); } } } });