GoogleContainerTools / skaffold

Easy and Repeatable Kubernetes Development
https://skaffold.dev/
Apache License 2.0
15.03k stars 1.62k forks source link

Location of Skaffold schemas for IDE #8615

Open seagullmouse opened 1 year ago

seagullmouse commented 1 year ago

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.

aaron-prindle commented 1 year ago

@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

seagullmouse commented 1 year ago

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?

ivanporty commented 1 year ago

@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.

seagullmouse commented 1 year ago

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.

aaron-prindle commented 1 year ago

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

ivanporty commented 1 year ago

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.

seagullmouse commented 1 year ago

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.

aaron-prindle commented 1 year ago

@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?

seagullmouse commented 7 months ago

skaffold version v2.9.0

seagullmouse commented 6 months ago

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