Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CRDs reflecting kuttl configuration files to provide coding assistance in IDEs #376

Merged
merged 2 commits into from
Aug 26, 2022

Conversation

gberche-orange
Copy link
Contributor

@gberche-orange gberche-orange commented Jul 22, 2022

What this PR does / why we need it:

Fixes #372

This supports getting coding assistance in IDEs, e.g. in intellij idea

completion:
image

inline documentation:
image

syntax checks:
image

Note: the CRD were manually derived from current https://kuttl.dev/docs/testing/reference.html (found source afterwards into https://github.com/kudobuilder/kuttl.dev/blob/master/content/docs/testing/reference.md but automating markdown to json schema transform seems time consumming for configs that don't seem to change that often)

Copy link
Member

@kensipe kensipe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Merci @gberche-orange . This is great stuff. There some clean up that would be nice but I will merge and resolve later today if you don't have time or compulsion. Really appreciate it!

crds/README.md Outdated Show resolved Hide resolved
crds/testassert-json-schema.yaml Outdated Show resolved Hide resolved
crds/testassert_crd.yaml Outdated Show resolved Hide resolved
crds/teststep-json-schema.yaml Outdated Show resolved Hide resolved
crds/teststep_crd.yaml Outdated Show resolved Hide resolved
crds/testsuite-json-schema.yaml Show resolved Hide resolved
crds/testsuite_crd.yaml Outdated Show resolved Hide resolved
@gberche-orange
Copy link
Contributor Author

Thanks @kensipe for the review. I'll try handling the clean up today.

@kensipe
Copy link
Member

kensipe commented Aug 25, 2022

ah... great! I will wait for your update then! I will check in today and tomorrow to see where we are at. Merci beaucoup

@kensipe
Copy link
Member

kensipe commented Aug 25, 2022

If it helps...

diff --git a/crds/README.md b/crds/README.md
index d8b3f14..886a210 100644
--- a/crds/README.md
+++ b/crds/README.md
@@ -16,4 +16,4 @@ on how to load the CRD files either from:
 
 In order to leverage IDE supports for Json schema, the json schema were extracted into distinct files and manually inlined into the CRD files.
 
-Future possible automated include use of [carvel ytt](https://carvel.dev/ytt/), see sample usage at https://github.com/crossplane/crossplane/issues/3197#issuecomment-1191479570
\ No newline at end of file
+Future possible automated include use of [carvel ytt](https://carvel.dev/ytt/), see sample usage at https://github.com/crossplane/crossplane/issues/3197#issuecomment-1191479570
diff --git a/crds/testassert-json-schema.yaml b/crds/testassert-json-schema.yaml
index c3fa948..f903a42 100644
--- a/crds/testassert-json-schema.yaml
+++ b/crds/testassert-json-schema.yaml
@@ -4,4 +4,4 @@ properties:
   timeout:
     description: Number of seconds that the test is allowed to run for
     type: integer
-    default: 30
\ No newline at end of file
+    default: 30
diff --git a/crds/testassert_crd.yaml b/crds/testassert_crd.yaml
index f046e21..871e6f9 100644
--- a/crds/testassert_crd.yaml
+++ b/crds/testassert_crd.yaml
@@ -20,4 +20,4 @@ spec:
             timeout:
               description: Number of seconds that the test is allowed to run for
               type: integer
-              default: 30
\ No newline at end of file
+              default: 30
diff --git a/crds/teststep-json-schema.yaml b/crds/teststep-json-schema.yaml
index f71b1ff..40b0f83 100644
--- a/crds/teststep-json-schema.yaml
+++ b/crds/teststep-json-schema.yaml
@@ -28,8 +28,6 @@ properties:
           If both labels and name are unspecified, then all resources of the specified kind in the namespace will be deleted.
         type: object
 
-
-
   index:
     description: Override the test step's index.
     type: integer
@@ -71,6 +69,3 @@ properties:
         timeout:
           description: Override the TestSuite timeout for this command (in seconds).
           type: integer
-
-
-
diff --git a/crds/teststep_crd.yaml b/crds/teststep_crd.yaml
index f8394ae..bfbd352 100644
--- a/crds/teststep_crd.yaml
+++ b/crds/teststep_crd.yaml
@@ -84,22 +84,3 @@ spec:
                   timeout:
                     description: Override the TestSuite timeout for this command (in seconds).
                     type: integer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  
\ No newline at end of file
diff --git a/crds/testsuite-json-schema.yaml b/crds/testsuite-json-schema.yaml
index 9e56ba8..ac0f004 100644
--- a/crds/testsuite-json-schema.yaml
+++ b/crds/testsuite-json-schema.yaml
@@ -112,7 +112,7 @@ properties:
       The namespace to use for tests. This namespace will be created if it does not exist 
       and removed if it was created (unless skipDelete is set). 
       If no namespace is set, one will be auto-generated.
-   type: string
+    type: string
   suppress:
     description: Suppresses log collection of the specified types. Currently only events is supported.
     type: array
diff --git a/crds/testsuite_crd.yaml b/crds/testsuite_crd.yaml
index 6905f90..8a3317e 100644
--- a/crds/testsuite_crd.yaml
+++ b/crds/testsuite_crd.yaml
@@ -134,19 +134,3 @@ spec:
               type: array
               items:
                 type: string
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  
\ No newline at end of file

…tance in IDEs

Fixes kudobuilder#372

Signed-off-by: Guillaume Berche <guillaume.berche@orange.com>
end of files and indentation

Signed-off-by: Guillaume Berche <guillaume.berche@orange.com>
@gberche-orange
Copy link
Contributor Author

thanks. I've added a commit with the change. Feel free to squash it, or if you prefer to merge as is and clean up after. Thanks again for your review and feedback.

Copy link
Member

@kensipe kensipe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kensipe kensipe merged commit e37b284 into kudobuilder:main Aug 26, 2022
iblancasa pushed a commit to iblancasa/kuttl that referenced this pull request Nov 17, 2022
…tance in IDEs (kudobuilder#376)

Fixes kudobuilder#372

Signed-off-by: Guillaume Berche <guillaume.berche@orange.com>
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
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.

Provide crd/openapi-schema for kuttl configuration
2 participants