Skip to content

Commit 88a61ba

Browse files
authored
Merge pull request #25 from oracle/springboot-1.1.1
Added fix for cluster version
2 parents f433c6d + 16eed07 commit 88a61ba

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

MtdrSpring/terraform/containerengine.tf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ resource "oci_containerengine_cluster" "mtdrworkshop_cluster" {
88
]
99
subnet_id = oci_core_subnet.endpoint.id
1010
}
11-
kubernetes_version = "v1.25.4"
11+
kubernetes_version = local.latest
1212
name = "mtdrworkshopcluster-${var.mtdrKey}"
1313
vcn_id = oci_core_vcn.okevcn.id
1414
#optional
@@ -36,7 +36,7 @@ resource "oci_containerengine_node_pool" "oke_node_pool" {
3636
#Required
3737
cluster_id = oci_containerengine_cluster.mtdrworkshop_cluster.id
3838
compartment_id = var.ociCompartmentOcid
39-
kubernetes_version = "v1.25.4"
39+
kubernetes_version = local.latest
4040
name = "Pool"
4141
# node_shape="VM.Standard2.4"
4242
# node_shape = "VM.Standard.B2.1"
@@ -80,4 +80,9 @@ data "oci_containerengine_node_pool_option" "mtdrworkshop_node_pool_option" {
8080
locals {
8181
all_sources = data.oci_containerengine_node_pool_option.mtdrworkshop_node_pool_option.sources
8282
oracle_linux_images = [for source in local.all_sources : source.image_id if length(regexall("Oracle-Linux-[0-9]*.[0-9]*-20[0-9]*",source.source_name)) > 0]
83-
}
83+
}
84+
85+
locals {
86+
versions = reverse(sort(data.oci_containerengine_cluster_option.mtdrworkshop_cluster_option.kubernetes_versions))
87+
latest = local.versions[0]
88+
}

MtdrSpring/terraform/database.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,8 @@ output "ns_objectstorage_namespace" {
5050
}
5151
output "autonomous_database_admin_password" {
5252
value = [ "Welcome12345" ]
53+
}
54+
55+
output "adb_ocid" {
56+
value = oci_database_autonomous_database.autonomous_database_atp.id
5357
}

MtdrSpring/terraform/provider.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
terraform {
2-
required_providers{
2+
required_providers {
33
oci = {
4-
source = "hashicorp/oci"
5-
version = "4.42.0"
4+
source = "oracle/oci"
5+
version = ">= 5.9.0"
66
}
77
}
88
}
9+
910
provider "oci"{
1011
region = var.ociRegionIdentifier
1112
}

MtdrSpring/utils/main-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ fi
284284

285285
# Get MTDR_DB OCID
286286
while ! state_done MTDR_DB_OCID; do
287-
MTDR_DB_OCID=`oci db autonomous-database list --compartment-id "$(cat state/COMPARTMENT_OCID)" --query 'join('"' '"',data[?"display-name"=='"'MTDRDB'"'].id)' --raw-output`
287+
MTDR_DB_OCID=`terraform -chdir="$MTDRWORKSHOP_LOCATION/terraform" output --raw adb_ocid`
288288
if [[ "$MTDR_DB_OCID" =~ ocid1.autonomousdatabase* ]]; then
289289
state_set MTDR_DB_OCID "$MTDR_DB_OCID"
290290
else

0 commit comments

Comments
 (0)