Giter Site home page Giter Site logo

laetho / metagraf Goto Github PK

View Code? Open in Web Editor NEW
17.0 5.0 7.0 16.48 MB

metaGraf is a opinionated specification for describing a software component and what its requirements are from the runtime environment. The mg command, turns metaGraf specifications into Kubernetes resources, supporting CI, CD and GitOps software delivery.

License: Apache License 2.0

Go 99.55% Shell 0.36% Makefile 0.05% Dockerfile 0.03%
service-graph automation 12-factor openshift pipeline graph metagraf declarative gitops generator

metagraf's People

Contributors

laetho avatar robof avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

metagraf's Issues

--cvars does not work for JVM_SYS_PROP

Given a metagraf with

    "environment": {
      "local": [
        {
          "name": "JAVA_OPTIONS",
          "required": true,
          "type": "JVM_SYS_PROP",
          "description": "Configured Java system properties"
        },

And

    "config": [
      {
        "name": "JVM_SYS_PROP",
        "type": "JVM_SYS_PROP",
        "description": "JVM system properties",
        "options": [
          {
            "name": "my.test.prop",
            "required": true,
            "description": "test property",
            "type": "string",
            "default": "test_value"
          }
        ]
      }
    ]

I expect mg create deploymentconfig metagraf.json --cvars "my.test.prop=nissemann" --namespace cop --dryrun to populate the JAVA_OPTIONS environment like this:

              {
                "name": "JAVA_OPTIONS",
                "value": "-Dmy.test.prop=nissemann"
              },

But actual result is this:

              {
                "name": "JAVA_OPTIONS"
              },

Add support for JSONPath expressions

Proposal
mg should support JSONPath expression so we can easily fetch field data from metagraf.json without relying on other tools.
By introducing a get command that supports valid JSONPath expression we can easily and concisely rely on mg as a single tool for working with metagraf.json files.

given a metagraf.json like

{
  "kind": "MetaGraf",
  "metadata": {
    "name": "myapp",
    "annotations": {
      "my/annotation-test": "The value",
    }
  },
  "spec": {
    ...
  }
} 

When we fetch the field "name", i.e. mg get "$.metadata.name" metagraf.json
Then the value returned should be "myapp"

JVM_SYS_PROP's that are optional without value end up in environment variable.

A JVM_SYS_PROP options that is optional (not required) ends up in a generated environment variable of type JVM_SYS_PROP. It should not, unless it's configured with a value.

...
{
  "name": "JVM_SYS_PROP",
  "type": "JVM_SYS_PROP",
  "description": "JVM system properties",
  "options": [
    {
      "name": "my.property",
      "required": false,
      "description": "A property",
      "type": "string"
    },
  ]
}
...

The entry for the above property should never have generated through, mg generate properties metagraf.json:

JVM_SYS_PROP|my.property=

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.