Git Product home page Git Product logo

argo-schema-generator's Introduction

slack

Argoproj - Get stuff done with Kubernetes

Argo Image

What is Argoproj?

Argoproj is a collection of tools for getting work done with Kubernetes.

  • Argo Workflows - Container-native Workflow Engine
  • Argo CD - Declarative GitOps Continuous Delivery
  • Argo Events - Event-based Dependency Manager
  • Argo Rollouts - Progressive Delivery with support for Canary and Blue Green deployment strategies

Also argoproj-labs is a separate GitHub org that we setup for community contributions related to the Argoproj ecosystem. Repos in argoproj-labs are administered by the owners of each project. Please reach out to us on the Argo slack channel if you have a project that you would like to add to the org to make it easier to others in the Argo community to find, use, and contribute back.

Community Blogs and Presentations

Project specific community blogs and presentations are at

Adopters

Each Argo sub-project maintains its own list of adopters. Those lists are available in the respective project repositories:

Contributing

To learn about how to contribute to Argoproj, see our contributing documentation. Argo contributors must follow the CNCF Code of Conduct.

For help contributing, visit the #argo-contributors channel in CNCF Slack.

To learn about Argoproj governance, see our community governance document.

Project Resources

argo-schema-generator's People

Contributors

jongwooo avatar zachaller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

argo-schema-generator's Issues

Where is the complete reference schema for `argoproj.io/v1alpha1`?

If I have a YAML file which starts with apiVersion: argoproj.io/v1alpha1, what should I replace URL with in the # yaml-language-server: $schema=URL comment? There's no "v1alpha1" tag for https://github.com/argoproj/argo-schema-generator or https://github.com/argoproj/argo-workflows, so is the reference in some other repo?

https://argoproj.github.io/argo-workflows/ide-setup/ refers to the schema on the master branch, but I assume there's a specific commit I can refer to, rather than a moving target.

`kustomize build` fails when `openapi.path` specify remote URL

Description

I added a config block according to the README#using-main-branch, but kustomize build fails.

kustomize version
{Version:kustomize/v4.5.4 GitCommit:cf3a452ddd6f83945d39d582243b8592ec627ae3 BuildDate:2022-03-28T23:06:20Z GoOs:darwin GoArch:amd64}cat kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
openapi:
  path: https://raw.githubusercontent.com/argoproj/argo-schema-generator/main/schema/argo_all_k8s_kustomize_schema.jsonkustomize build .
Error: evalsymlink failure on '/private/tmp/https:/raw.githubusercontent.com/argoproj/argo-schema-generator/main/schema/argo_all_k8s_kustomize_schema.json' : lstat /private/tmp/https:: no such file or directory

It looks like kustomize can't parse remote URL well.
kubernetes-sigs/kustomize#2068 seems to be related.

Argo CD schema in Neovim

Hi friends!

In Neovim, I use nvim-lspconfig for my language servers. In particular, I use yamlls as my YAML language server for validating YAML against JSON schemas (more info here). Here's a preview of what it looks like while I'm using the datreeio/CRDs-catalog Argo json schemas:

-- Setup the language servers so that they're available for our LSP client.
local lspconfig = require('lspconfig')
local capabilities = require('cmp_nvim_lsp').default_capabilities()

-- yaml
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#yamlls
lspconfig.yamlls.setup {
  settings = {
    yaml = {
      schemas = {
        ["https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/argoproj.io/application_v1alpha1.json"] = "/*argocd_app.yaml",
        ["https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/argoproj.io/applicationset_v1alpha1.json"] = "/*argocd_appset.yaml",
        ["https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/argoproj.io/appproject_v1alpha1.json"] = "/*argocd_project.yaml"
            },
    }},
    capabilities = capabilities
}

Here's what it looks like in the editor when I open a file ending argocd_appset.yaml and I start typing a known property, such as spec.template.metadata and then hit tab (it shows as a property that I can use):

Screenshot of neovim showing tabbing on the `spec.template.metadata` with a small popup that says Property

If I try to change the JSON schema to this repo's schema called argo_cd_kustomize_schema.json, the lua code for Neovim looks like this:

lspconfig.yamlls.setup {
  settings = {
    yaml = {
      schemas = {
        ["https://raw.githubusercontent.com/argoproj/argo-schema-generator/main/schema/argo_cd_kustomize_schema.json"] = "/*argocd_appset.yaml",
            },
    }},
    capabilities = capabilities
}

And here's what it looks like in neovim:

Screenshot of neovim showing an error on the first yaml line of the same file. error below this image.

It seems to throw an error that was hidden, so I pulled up trouble, my diagnostics tool at the bottom of the screen and it seems to throw an error that requires me to scroll, so sorry it didn't make it into the screenshot 😅:

$ref '/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString' in 'https://raw.githubusercontent.com/argoproj/argo-schema-generator/main/schema/argo_cd_kustomize_schema.json' can not be resolved. YAML (768) [2, 1]

If I look at the top of the datreeio appset json schema, I see this:

click me to see applicationset_v1alpha1
{
  "properties": {
    "apiVersion": {
      "type": "string"
    },
    "kind": {
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "properties": {
        "applyNestedSelectors": {
          "type": "boolean"
        },
        "generators": {
          "items": {
            "properties": {
              "clusterDecisionResource": {
                "properties": {
                  "configMapRef": {
                    "type": "string"
                  },

however the top of the argo-schema-generator schema looks like this:

click me for argo_cd_kustomize_schema.json
{
    "definitions": {
        "io.argoproj.argocd.v1alpha1.AWSAuthConfig": {
            "description": "AWSAuthConfig is an AWS IAM authentication configuration",
            "type": "object",
            "properties": {
                "clusterName": {
                    "description": "ClusterName contains AWS cluster name",
                    "type": "string"
                },
                "profile": {
                    "description": "Profile contains optional role ARN. If set then AWS IAM Authenticator uses the profile to perform cluster operations instead of the default AWS credential provider chain.",
                    "type": "string"
                },
                "roleARN": {
                    "description": "RoleARN contains optional role ARN. If set then AWS IAM Authenticator assume a role to perform cluster operations instead of the default AWS credential provider chain.",
                    "type": "string"
                }
            },
            "x-kubernetes-group-version-kind": [
                {
                    "group": "argoproj.io",
                    "kind": "AWSAuthConfig",
                    "version": "v1alpha1"
                }
            ]
        },
        "io.argoproj.argocd.v1alpha1.AppProject": {
            "description": "AppProject provides a logical grouping of applications, providing controls for: * where the apps may deploy to (cluster whitelist) * what may be deployed (repository whitelist, resource whitelist/blacklist) * who can access these applications (roles, OIDC group claims bindings) * and what they can do (RBAC policies) * automation access to these roles (JWT tokens)",
            "type": "object",
            "required": [
                "metadata",
                "spec"
            ],
            "properties": {
                "apiVersion": {
                    "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
                    "type": "string"
                },

Has anyone gotten this to work in neovim? If so, which plugin did you use? Any tips or suggestions here?

Thanks for any help anyone can provide 🙏

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.