Skip to content

Conversation

@RajatPorwal5
Copy link

@RajatPorwal5 RajatPorwal5 commented Mar 16, 2025

This PR aims to introduce from the crosslplane aws-provider CRDs version (v1.20.0) using the below script:
CRDs Path - https://github.com/crossplane-contrib/provider-upjet-aws/tree/main/package/crds

#!/usr/bin/env bash
# shellcheck disable=SC2064
set -euo pipefail

currnet_dir=$(dirname "$0")
cleanup_cmd="rm -rf ${PWD}/SCHEMAS/*"
trap "rm -fr $cleanup_cmd" 0            # EXIT
trap "rm -fr $cleanup_cmd; exit 1" 2    # INT
trap "rm -fr $cleanup_cmd; exit 1" 1 15 # HUP TERM

curl -sO https://raw.githubusercontent.com/yannh/kubeconform/master/scripts/openapi2jsonschema.py
git clone --depth 1 --branch v1.20.0 https://github.com/crossplane-contrib/provider-upjet-aws.git

for file in $(find provider-upjet-aws/package/crds -type f -name '*.yaml'); do
  dir_name=$(basename "$file" | awk -F'_' '{print $1}')
  file_name=$(basename "$file")
  mkdir -p SCHEMAS/"$dir_name"
  cp "$file" SCHEMAS/"$dir_name"/"$file_name"
  pushd SCHEMAS/"$dir_name"
  python ../../openapi2jsonschema.py "$file_name"
  rm -rf "$file_name"
  popd
done

@ElanHasson
Copy link
Collaborator

hi @RajatPorwal5

Thanks for the PR!

Could you please split this into a few PRs? It's very hard to review this in the UI with 1300 files.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants