Skip to content

Commit 978ddb5

Browse files
committed
update script for openapi2crd
1 parent 4e0c910 commit 978ddb5

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.github/workflows/update-sdk.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
- name: Update Atlas SDK
2828
run: |
2929
./scripts/update-sdk.sh
30+
make clean gen-crds
3031
- name: Check for Changes
3132
id: check_changes
3233
run: |

config/openapi2crd.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ spec:
5353

5454
openapi:
5555
- name: v20250312
56-
package: go.mongodb.org/atlas-sdk/v20250312009/admin
56+
package: go.mongodb.org/atlas-sdk/v20250312010/admin
5757

5858
crd:
5959
- gvk:

scripts/update-sdk.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616

1717
set -euo pipefail
1818

19-
CURRENT_SDK_RELEASE=$(go list -m all | grep go.mongodb.org/atlas-sdk | awk -F '/| ' '{print $3}')
19+
CURRENT_SDK_TAG=$(go list -m all | grep go.mongodb.org/atlas-sdk | awk -F '/| ' '{print $4}')
20+
CURRENT_SDK_RELEASE=$(echo "${CURRENT_SDK_TAG}" | cut -d '.' -f 1)
21+
echo "CURRENT_SDK_TAG: $CURRENT_SDK_TAG"
2022
echo "CURRENT_SDK_RELEASE: $CURRENT_SDK_RELEASE"
2123

2224
LATEST_SDK_TAG=$(curl -sSfL -X GET https://api.github.com/repos/mongodb/atlas-sdk-go/releases/latest | jq -r '.tag_name')
@@ -29,4 +31,6 @@ echo "==> Updating SDK to latest major version ${LATEST_SDK_TAG}"
2931
go tool --modfile tools/toolbox/go.mod gomajor get --rewrite "go.mongodb.org/atlas-sdk/${CURRENT_SDK_RELEASE}" "go.mongodb.org/atlas-sdk/${LATEST_SDK_RELEASE}@${LATEST_SDK_TAG}"
3032
go mod tidy
3133

34+
sed -i -e "s/${CURRENT_SDK_RELEASE}/${LATEST_SDK_RELEASE}/g" config/openapi2crd.yaml
35+
3236
echo "Done"

0 commit comments

Comments
 (0)