diff --git a/CHANGELOG.md b/CHANGELOG.md index 05c5c96..b4a35f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +[1.4.0] + +- Adding support for Osaka (KIX), Melbourne (MEL), Amsterdam (AMS), Jeddah (JED), Montreal (YUL) regions +- Adding support to update admin password in ATP and ADW Services +- Adding support to create and associate streams with streampool Ocid +- Minor Bug Fixes + [1.3.3] - Minor documentation fixes diff --git a/README.md b/README.md index a2b95c5..8eaf765 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ See the [Documentation](charts/oci-service-broker/README.md#oci-service-broker) The OCI Service Broker is packaged as Helm chart for making it easy to install in Kubernetes Clusters. The chart can be downloaded from below URL. ``` -https://github.com/oracle/oci-service-broker/releases/download/v1.3.3/oci-service-broker-1.3.3.tgz +https://github.com/oracle/oci-service-broker/releases/download/v1.4.0/oci-service-broker-1.4.0.tgz ``` ## Samples diff --git a/charts/oci-service-broker/Chart.yaml b/charts/oci-service-broker/Chart.yaml index e41b7ca..aa55ada 100644 --- a/charts/oci-service-broker/Chart.yaml +++ b/charts/oci-service-broker/Chart.yaml @@ -5,4 +5,4 @@ apiVersion: v1 description: A Helm chart for installing OCI Service Broker into a Kubernetes cluster name: oci-service-broker -version: 1.3.3 +version: 1.4.0 diff --git a/charts/oci-service-broker/docs/adw.md b/charts/oci-service-broker/docs/adw.md index 94c9ff0..bb51648 100644 --- a/charts/oci-service-broker/docs/adw.md +++ b/charts/oci-service-broker/docs/adw.md @@ -58,7 +58,7 @@ To provision, an ADW service user needs to provide the following details: | `compartmentId` | The OCI compartment where the ADW instance will be provisioned. | string | yes | | `cpuCount` | Number of CPU cores to have. | int | yes | | `storageSizeTBs` | Size of the DB Storage in Terrabytes. | int | yes | -| `password` | ADW Service will pre-provision a DB Admin user when it provisions an ADW instance. The user needs to provide a password to be set for this Admin user. The update of password using OCI Service Broker is not supported. Any changes to password after instance provisioning is ignored.
The OCI ADW service requires the password to satisfy the below rules.
| string | yes | +| `password` | ADW Service will pre-provision a DB Admin user when it provisions an ADW instance. The user needs to provide a password to be set for this Admin user.
The OCI ADW service requires the password to satisfy the below rules.
| string | yes | | `licenseType` | Use your existing database software licenses(BYOL) or Subscribe to new database software licenses and the Database Cloud Service.
Valid values are:. | string | yes | | `autoScaling` | The flag to enable auto-scaling in ADW Instance. Allows system to use up to three times the provisioned number of cores as the workload increases. By default, this flag is set to false. | boolean| no | | `freeFormTags` | free form tags that are to be used for tagging the ADW instance. | object | no | diff --git a/charts/oci-service-broker/docs/atp.md b/charts/oci-service-broker/docs/atp.md index 32fe1a3..6983af1 100644 --- a/charts/oci-service-broker/docs/atp.md +++ b/charts/oci-service-broker/docs/atp.md @@ -58,7 +58,7 @@ To provision, an ATP service user needs to provide the following details: | `compartmentId` | The OCI compartment where the ATP instance will be provisioned. | string | yes | | `cpuCount` | Number of CPU cores to have. | int | yes | | `storageSizeTBs` | Size of the DB Storage in Terrabytes. | int | yes | -| `password` | ATP Service will pre-provision a DB Admin user when it provisions an ATP instance. The user needs to provide a password to be set for this Admin user. The update of password using OCI Service Broker is not supported. Any changes to password after instance provisioning is ignored.
The OCI ATP service requires the password to satisfy the below rules.
| string | yes | +| `password` | ATP Service will pre-provision a DB Admin user when it provisions an ATP instance. The user needs to provide a password to be set for this Admin user.
The OCI ATP service requires the password to satisfy the below rules.
| string | yes | | `licenseType` | Use your existing database software licenses(BYOL) or Subscribe to new database software licenses and the Database Cloud Service.
Valid values are:. | string | yes | | `autoScaling` | The flag to enable auto-scaling in ATP Instance. Allows system to use up to three times the provisioned number of cores as the workload increases. By default, this flag is set to false. | boolean| no | | `freeFormTags` | free form tags that are to be used for tagging the ATP instance. | object | no | diff --git a/charts/oci-service-broker/docs/installation.md b/charts/oci-service-broker/docs/installation.md index 10c2de5..fb9e738 100644 --- a/charts/oci-service-broker/docs/installation.md +++ b/charts/oci-service-broker/docs/installation.md @@ -75,7 +75,7 @@ brew update && brew install kubernetes-service-catalog-client The OCI Service Broker is packaged as Helm chart for making it easy to install in Kubernetes. The chart is available at [charts/oci-service-broker](../) directory. ```plain -https://github.com/oracle/oci-service-broker/releases/download/v1.3.3/oci-service-broker-1.3.3.tgz +https://github.com/oracle/oci-service-broker/releases/download/v1.4.0/oci-service-broker-1.4.0.tgz ``` ### OCI credentials @@ -114,7 +114,7 @@ For quickly testing out OCI Service Broker, TLS can be disabled and an embedded Helm 3.x syntax: ```bash - helm install oci-service-broker https://github.com/oracle/oci-service-broker/releases/download/v1.3.3/oci-service-broker-1.3.3.tgz \ + helm install oci-service-broker https://github.com/oracle/oci-service-broker/releases/download/v1.4.0/oci-service-broker-1.4.0.tgz \ --set ociCredentials.secretName=ocicredentials \ --set storage.etcd.useEmbedded=true \ --set tls.enabled=false @@ -122,7 +122,7 @@ Helm 3.x syntax: Helm 2.x syntax: ```bash - helm install https://github.com/oracle/oci-service-broker/releases/download/v1.3.3/oci-service-broker-1.3.3.tgz --name oci-service-broker \ + helm install https://github.com/oracle/oci-service-broker/releases/download/v1.4.0/oci-service-broker-1.4.0.tgz --name oci-service-broker \ --set ociCredentials.secretName=ocicredentials \ --set storage.etcd.useEmbedded=true \ --set tls.enabled=false @@ -226,7 +226,7 @@ Replace the values of --set arguments with your appropriate values to install th Helm 3.x syntax: ```bash - helm install oci-service-broker https://github.com/oracle/oci-service-broker/releases/download/v1.3.3/oci-service-broker-1.3.3.tgz \ + helm install oci-service-broker https://github.com/oracle/oci-service-broker/releases/download/v1.4.0/oci-service-broker-1.4.0.tgz \ --set ociCredentials.secretName=ocicredentials \ --set tls.secretName=certsecret \ --set storage.etcd.servers= @@ -234,7 +234,7 @@ Helm 3.x syntax: Helm 2.x syntax: ```bash - helm install https://github.com/oracle/oci-service-broker/releases/download/v1.3.3/oci-service-broker-1.3.3.tgz --name oci-service-broker \ + helm install https://github.com/oracle/oci-service-broker/releases/download/v1.4.0/oci-service-broker-1.4.0.tgz --name oci-service-broker \ --set ociCredentials.secretName=ocicredentials \ --set tls.secretName=certsecret \ --set storage.etcd.servers= @@ -288,7 +288,7 @@ Refer [Restrict access to Service Catalog resources using RBAC](security.md#rest Sample files for various services are available under [`oci-service-broker/samples`](../samples) directory inside the charts. The below command extracts chart that contains the sample files. ```bash -curl -LO https://github.com/oracle/oci-service-broker/releases/download/v1.3.3/oci-service-broker-1.3.3.tgz | tar xz +curl -LO https://github.com/oracle/oci-service-broker/releases/download/v1.4.0/oci-service-broker-1.4.0.tgz | tar xz ``` Create a `ClusterServiceBroker` resource with OCI Service Broker URL to register the broker. Use the below register yaml file after updating the namespace of the OCI Service Broker. diff --git a/charts/oci-service-broker/samples/oci-service-broker.yaml b/charts/oci-service-broker/samples/oci-service-broker.yaml index b81f863..db909c5 100644 --- a/charts/oci-service-broker/samples/oci-service-broker.yaml +++ b/charts/oci-service-broker/samples/oci-service-broker.yaml @@ -7,4 +7,6 @@ kind: ClusterServiceBroker metadata: name: oci-service-broker spec: + # Make sure to replace with suitable namespace if OCI Service Broker and Service Catalog are installed in different namespaces. + # Please remove from below URL attribute If both OCI Service Broker and Service Catalog are installed in the same namespace. url: http://oci-service-broker.:8080 diff --git a/charts/oci-service-broker/samples/oss/create-oss-instance.yaml b/charts/oci-service-broker/samples/oss/create-oss-instance.yaml index 9e7a6e1..ffa2b31 100644 --- a/charts/oci-service-broker/samples/oss/create-oss-instance.yaml +++ b/charts/oci-service-broker/samples/oss/create-oss-instance.yaml @@ -13,3 +13,5 @@ spec: name: teststream compartmentId: CHANGE_COMPARTMENT_OCID_HERE partitions: CHANGE_PARTITION_COUNT_HERE +# Use streampoolId for creating stream associated with a streampool. Do not use compartmentId when using streampoolId +# streampoolId: CHANGE_STREAM_POOL_OCID_HERE diff --git a/charts/oci-service-broker/values.yaml b/charts/oci-service-broker/values.yaml index 468771e..d4a37b9 100644 --- a/charts/oci-service-broker/values.yaml +++ b/charts/oci-service-broker/values.yaml @@ -14,7 +14,7 @@ image: repository: iad.ocir.io/oracle/oci-service-broker # Tag of the image - tag: 1.3.3 + tag: 1.4.0 # The image pull policy pullPolicy: Always diff --git a/oci-service-broker/build.gradle b/oci-service-broker/build.gradle index f9991ad..329e9dc 100644 --- a/oci-service-broker/build.gradle +++ b/oci-service-broker/build.gradle @@ -30,19 +30,19 @@ apply plugin: 'maven-publish' archivesBaseName = 'oci-service-broker' // Sometimes, the version has to be overridden from command line -version = project.hasProperty('version_num') ? project.getProperty('version_num') : '1.3.3' +version = project.hasProperty('version_num') ? project.getProperty('version_num') : '1.4.0' ext.dockerGroup = 'iad.ocir.io/oci-cnp-dev' mainClassName = 'com.oracle.oci.osb.Broker' sourceCompatibility = 10 ext { - ociSdkVersion = "1.6.3" + ociSdkVersion = "1.13.2" jerseyVersion = "2.27" hk2Version = "2.5.0-b42" hamcrestVersion = "1.3" - jacksonVersion = "2.9.9"; - jacksonDatabindVersion = "2.9.9"; + jacksonVersion = "2.10.1"; + jacksonDatabindVersion = "2.10.1"; javaxwsrsVersion = "2.1.1" bedrockVersion = "5.0.7" jetcdVersion = "0.3.0" diff --git a/oci-service-broker/download_SDK_libs.sh b/oci-service-broker/download_SDK_libs.sh index 4093ce1..b9453c4 100755 --- a/oci-service-broker/download_SDK_libs.sh +++ b/oci-service-broker/download_SDK_libs.sh @@ -9,7 +9,7 @@ #sdk jars and their dependency jars. The jars are written to libs directory. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -SDK_VERSION="1.6.3" +SDK_VERSION="1.13.2" TEMP_DIR="/tmp/oci-java-sdk" rm -rf ${TEMP_DIR} mkdir -p ${TEMP_DIR} @@ -17,7 +17,7 @@ mkdir -p ${SCRIPT_DIR}/libs echo "Downloading oci-java-sdk version v${SDK_VERSION} and the dependent libraries..." curl -sSL https://github.com/oracle/oci-java-sdk/releases/download/v${SDK_VERSION}/oci-java-sdk.zip -o ${TEMP_DIR}/oci-java-sdk.zip unzip -qq ${TEMP_DIR}/oci-java-sdk.zip -d ${TEMP_DIR} -cp ${TEMP_DIR}/lib/oci-java-sdk-full-1.6.3.jar ${SCRIPT_DIR}/libs/ +cp ${TEMP_DIR}/lib/oci-java-sdk-full-1.13.2.jar ${SCRIPT_DIR}/libs/ cp ${TEMP_DIR}/third-party/lib/*.jar ${SCRIPT_DIR}/libs/ rm -rf ${TEMP_DIR} echo "oci-java-sdk and the dependent libraries are downloaded to ${SCRIPT_DIR}/libs directory" diff --git a/oci-service-broker/src/main/java/com/oracle/oci/osb/adapters/adb/AutonomousDatabaseAdapter.java b/oci-service-broker/src/main/java/com/oracle/oci/osb/adapters/adb/AutonomousDatabaseAdapter.java index b471dc1..148d34e 100644 --- a/oci-service-broker/src/main/java/com/oracle/oci/osb/adapters/adb/AutonomousDatabaseAdapter.java +++ b/oci-service-broker/src/main/java/com/oracle/oci/osb/adapters/adb/AutonomousDatabaseAdapter.java @@ -297,6 +297,7 @@ public ServiceInstanceAsyncOperation updateServiceInstance(String instanceId, Se Map params = (Map) body.getParameters(); String name = RequestUtil.getStringParameter(params, REQ_PARAM_NAME, false); + String password = RequestUtil.getStringParameter(params, REQ_PARAM_PASSWORD, false); Integer cpuCount = RequestUtil.getIntegerParameter(params, REQ_PARAM_CPU_COUNT, false); Integer storageSize = RequestUtil.getIntegerParameter(params, REQ_PARAM_STORAGE_SIZE_TB, false); Map tags = RequestUtil.getMapStringParameter(params, REQ_PARAM_TAGS, false); @@ -317,7 +318,7 @@ public ServiceInstanceAsyncOperation updateServiceInstance(String instanceId, Se .DEFINED_TAGS, false); try (AutonomousDatabaseOCIClient adbServiceClient = new AutonomousDatabaseOCIClient(provider, compartmentId)) { - adbServiceClient.update(svcData.getOcid(), name, cpuCount, storageSize, tags, definedTags, licenseModelStr, autoScalingEnabled); + adbServiceClient.update(svcData.getOcid(), name, password, cpuCount, storageSize, tags, definedTags, licenseModelStr, autoScalingEnabled); response.setStatusCode(HTTP_ACCEPTED); } catch(UpdateNotRequiredException ue) { response.setStatusCode(HTTP_OK); diff --git a/oci-service-broker/src/main/java/com/oracle/oci/osb/adapters/adb/AutonomousDatabaseOCIClient.java b/oci-service-broker/src/main/java/com/oracle/oci/osb/adapters/adb/AutonomousDatabaseOCIClient.java index 547f09f..db40b11 100644 --- a/oci-service-broker/src/main/java/com/oracle/oci/osb/adapters/adb/AutonomousDatabaseOCIClient.java +++ b/oci-service-broker/src/main/java/com/oracle/oci/osb/adapters/adb/AutonomousDatabaseOCIClient.java @@ -96,7 +96,7 @@ public AutonomousDatabaseInstance create(String displayName, String dbName, Crea * @param autoScalingEnabled flag to enable autoscaling * @return AutonomousDatabase */ - public AutonomousDatabaseInstance update(String adOCID, String displayName, int cpuCount, int StorageSize, + public AutonomousDatabaseInstance update(String adOCID, String displayName, String password, int cpuCount, int StorageSize, Map tags, Map> definedTags, String licenseModelStr, boolean autoScalingEnabled) { AutonomousDatabase ad = getADInstance(adOCID); @@ -109,6 +109,11 @@ public AutonomousDatabaseInstance update(String adOCID, String displayName, int debugLog(LOGGER, "DisplayName to be updated.from:%s;to:%s", Level.FINE, ad.getDisplayName(), displayName); updateRequired = true; } + if (!Utils.isNullOrEmptyString(password)) { + reqBuilder = reqBuilder.adminPassword(password); + debugLog(LOGGER, "Admin password to be updated.", Level.FINE); + updateRequired = true; + } if (cpuCount > 0 && ad.getCpuCoreCount() != cpuCount) { reqBuilder = reqBuilder.cpuCoreCount(cpuCount); debugLog(LOGGER, "CpuCoreCount to be updated.from:%s;to:%s", Level.FINE, ad.getCpuCoreCount() diff --git a/oci-service-broker/src/main/java/com/oracle/oci/osb/adapters/oss/OSSServiceAdapter.java b/oci-service-broker/src/main/java/com/oracle/oci/osb/adapters/oss/OSSServiceAdapter.java index f85878a..449986d 100644 --- a/oci-service-broker/src/main/java/com/oracle/oci/osb/adapters/oss/OSSServiceAdapter.java +++ b/oci-service-broker/src/main/java/com/oracle/oci/osb/adapters/oss/OSSServiceAdapter.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.oracle.oci.osb.adapter.ServiceAdapter; import com.oracle.oci.osb.model.*; +import com.oracle.oci.osb.model.Error; import com.oracle.oci.osb.ociclient.SystemPropsAuthProvider; import com.oracle.oci.osb.store.BindingData; import com.oracle.oci.osb.store.ServiceData; @@ -31,6 +32,9 @@ import java.util.HashMap; import java.util.Map; import java.util.Optional; +import java.util.logging.Logger; + +import static com.oracle.oci.osb.util.Utils.getLogger; /** * OSSServiceAdapter provides implementation to provision and manage @@ -38,6 +42,8 @@ */ public class OSSServiceAdapter implements ServiceAdapter { + private static final Logger LOGGER = getLogger(OSSServiceAdapter.class); + public static final String PARTITIONS = "partitions"; private static final String STREAM_ID = "streamId"; private static final String MESSAGE_ENDPOINT = "messageEndpoint"; @@ -49,8 +55,8 @@ public class OSSServiceAdapter implements ServiceAdapter { public OSSServiceAdapter() { super(); - streamAdminClient = new StreamAdminClient(new SystemPropsAuthProvider().getAuthProvider()); - streamAdminClient.setEndpoint("https://streams." + System.getProperty(Constants.REGION_ID) + ".streaming.oci.oraclecloud.com"); + streamAdminClient = StreamAdminClient.builder().build(new SystemPropsAuthProvider().getAuthProvider()); + streamAdminClient.setRegion(System.getProperty(Constants.REGION_ID)); } @Override @@ -172,14 +178,25 @@ public ServiceInstanceProvision provisionServiceInstance(String instanceId, Serv Map mapParameters = validateParamsExists(body.getParameters()); String streamName = RequestUtil.getNonEmptyStringParameter(mapParameters, Constants.NAME); - String compartmentId = RequestUtil.getNonEmptyStringParameter(mapParameters, Constants.COMPARTMENT_ID); Integer partitions = RequestUtil.getIntegerParameter(mapParameters, PARTITIONS, true); + String streampoolId = RequestUtil.getStringParameter(mapParameters, Constants.STREAM_POOL_ID, false);; + String compartmentId = RequestUtil.getStringParameter(mapParameters, Constants.COMPARTMENT_ID, false); Map> definedTags = RequestUtil.getMapMapObjectParameter(mapParameters, Constants.DEFINED_TAGS, false); + if(streampoolId == null && compartmentId == null) { + LOGGER.info("Both CompartmentId and StreamPoolId cannot be null"); + throw Errors.missingParameters(); + } + CreateStreamDetails.Builder createStreamBuilder = CreateStreamDetails.builder().name(streamName) - .compartmentId(compartmentId).partitions(partitions).definedTags(definedTags).freeformTags - (freeFormTags); + .partitions(partitions).definedTags(definedTags).freeformTags(freeFormTags); + + if(streampoolId != null) { + createStreamBuilder.streamPoolId(streampoolId); + } else { + createStreamBuilder.compartmentId(compartmentId); + } CreateStreamResponse createResponse = streamAdminClient.createStream(CreateStreamRequest.builder() .createStreamDetails(createStreamBuilder.build()).build()); diff --git a/oci-service-broker/src/main/java/com/oracle/oci/osb/rest/RequestValidationFilter.java b/oci-service-broker/src/main/java/com/oracle/oci/osb/rest/RequestValidationFilter.java index 68d8a45..6cc50cf 100644 --- a/oci-service-broker/src/main/java/com/oracle/oci/osb/rest/RequestValidationFilter.java +++ b/oci-service-broker/src/main/java/com/oracle/oci/osb/rest/RequestValidationFilter.java @@ -114,4 +114,4 @@ private static Identity parseIdentity(String identityHeader) { } return null; } -} +} \ No newline at end of file diff --git a/oci-service-broker/src/main/java/com/oracle/oci/osb/util/Constants.java b/oci-service-broker/src/main/java/com/oracle/oci/osb/util/Constants.java index eb1e542..771cf94 100644 --- a/oci-service-broker/src/main/java/com/oracle/oci/osb/util/Constants.java +++ b/oci-service-broker/src/main/java/com/oracle/oci/osb/util/Constants.java @@ -76,4 +76,5 @@ public class Constants { public static final String PROVISIONING = "provisioning"; public static final String OCID = "ocid"; public static final String AUTOSCALING_ENABLED = "autoScaling"; + public static final String STREAM_POOL_ID = "streampoolId"; } diff --git a/oci-service-broker/src/main/resources/adw-catalog.json b/oci-service-broker/src/main/resources/adw-catalog.json index 72cdcd5..17e9549 100644 --- a/oci-service-broker/src/main/resources/adw-catalog.json +++ b/oci-service-broker/src/main/resources/adw-catalog.json @@ -100,6 +100,10 @@ "description": "Display Name or the ADW instance", "type": "string" }, + "password": { + "description": "Password for Admin User", + "type": "string" + }, "cpuCount": { "description": "CPU Count", "type": "integer" diff --git a/oci-service-broker/src/main/resources/atp-catalog.json b/oci-service-broker/src/main/resources/atp-catalog.json index 8deb8be..fe97416 100644 --- a/oci-service-broker/src/main/resources/atp-catalog.json +++ b/oci-service-broker/src/main/resources/atp-catalog.json @@ -100,6 +100,10 @@ "description": "Display Name or the ATP instance", "type": "string" }, + "password": { + "description": "Password for Admin User", + "type": "string" + }, "cpuCount": { "description": "CPU Count", "type": "integer" diff --git a/oci-service-broker/src/main/resources/oss-catalog.json b/oci-service-broker/src/main/resources/oss-catalog.json index e4cabec..6f64ae0 100644 --- a/oci-service-broker/src/main/resources/oss-catalog.json +++ b/oci-service-broker/src/main/resources/oss-catalog.json @@ -51,6 +51,10 @@ "description": "The number of partition in the stream", "type": "integer" }, + "streampoolId": { + "description": "The OCID of the stream pool that contains the stream", + "type": "string" + }, "freeFormTags": { "description": "Free form tags", "type": "object",