skaffold icon indicating copy to clipboard operation
skaffold copied to clipboard

Location of Skaffold schemas for IDE

Open seagullmouse opened this issue 2 years ago • 10 comments

Expected behavior

Provide a URL for schemas that can be passed into IntelliJ IDE

Actual behavior

image image

Every URL I have tried seems to fail.

Please advise which URL to use.

seagullmouse avatar Mar 30 '23 14:03 seagullmouse

@seagullmouse thanks for bringing this to our attention. Cloud Code should have this schema bundled so I will notify that team to fix this on their end but we also host the schemas in our Github repo at the following locations so you can add this URL in the UI field you posted above:

v4beta4.json schema https://raw.githubusercontent.com/GoogleContainerTools/skaffold/main/docs-v2/content/en/schemas/v4beta4.json

To view other schemas, see: https://github.com/GoogleContainerTools/skaffold/tree/main/docs-v2/content/en/schemas

aaron-prindle avatar Mar 30 '23 18:03 aaron-prindle

Thanks for the reply.

Might be something wrong with my IntelliJ set up.

I've added the schema image

But still see the IntelliJ warning image

Any ideas or should I wait to see if Cloud Code send an update?

seagullmouse avatar Mar 31 '23 13:03 seagullmouse

@seagullmouse it looks like you have Jetbrains Kubernetes plugin installed which tries to treat this file as a Kubernetes resource. Try adding #noK8s annotation on top of the file and let us know if this fixes the problem.

Do you see Cloud Code generated documentation and completions on other fields in YAML? It seems so since there are no errors on other fields.

ivanporty avatar Apr 03 '23 18:04 ivanporty

  • Adding #noK8s makes no difference.
  • The other fields link through to v3 of the schema image

What type of resource should I associate this file with? E.g. I could set up a rule then associates files named skaffold.yaml as Google Cloud or Skaffold but I don't see those options.

seagullmouse avatar Apr 05 '23 10:04 seagullmouse

@ivanporty did you have additional information here related to the above? Thanks

aaron-prindle avatar Apr 17 '23 17:04 aaron-prindle

I see, we are not up to date yet with the schema, we'll update with the next release.

To add the new schema manually, you need to use IntelliJ schema settings, not Cloud Code. They are in the lower right corner of the IDE window by default (you will see v3.json there):

Screen Shot 2023-04-17 at 8 49 20 PM

Click it, use Add/Edit schema settings and add new schema using URL above (https://raw.githubusercontent.com/GoogleContainerTools/skaffold/main/docs-v2/content/en/schemas/v4beta4.json). This should fix the warnings you see.

ivanporty avatar Apr 18 '23 00:04 ivanporty

Could this lack of compatibility with v4beta4 also be the reason that I can't use the Cloud Code: Kubernetes run configuration?

image

"Invalid Data: Unable to read your skaffold.yaml config file. Check that it is properly formed, and ensure that a profile is selected on the Build/Deploy tab."

I am able to run everything fine from the command line so my skaffold config appears to be fine.

seagullmouse avatar Apr 28 '23 13:04 seagullmouse

@ivanporty, do you have any insights as to the root cause of what might be happening above?

@seagullmouse can you output what version of skaffold is being used by Cloud Code?

aaron-prindle avatar May 15 '23 18:05 aaron-prindle

skaffold version v2.9.0

seagullmouse avatar Mar 22 '24 10:03 seagullmouse

This is still an issue with latest versions of Skaffold and IntelliJ.

image

It seems to ignore my custom added schemas

image

If I click through on a yaml element for it's definition, the v3 schema is still shown, although I don't know where/how this is being sourced

image

seagullmouse avatar Apr 12 '24 09:04 seagullmouse