Coder Social home page Coder Social logo

jimmycuadra / ktmpl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from inquicker/ktmpl

102.0 102.0 4.0 88 KB

Parameterized templates for Kubernetes manifests.

Home Page: https://docs.rs/ktmpl

License: MIT License

Makefile 3.34% Rust 96.35% Dockerfile 0.31%
kubernetes

ktmpl's People

Contributors

barnsnake351 avatar branchvincent avatar jimmycuadra avatar kri5 avatar nvitius avatar shyiko avatar softprops 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  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  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  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

ktmpl's Issues

Homebrew CI Test Failure: "thread 'main' panicked"

I'm trying to update Homebrew's Rust to 1.48 here: Homebrew/homebrew-core#66285

Homebrew CI tested all packages that depend on Rust. This revealed the following error from ktmpl:

Backtrace

❯ RUST_BACKTRACE=full ktmpl test.yml -p PORT 8080
thread 'main' panicked at 'attempted to leave type `linked_hash_map::Node<yaml::Yaml, yaml::Yaml>` uninitialized, which is invalid', /private/tmp/rust-20201211-36507-3y6ny0/rustc-1.48.0-src/library/core/src/mem/mod.rs:658:9
stack backtrace:
   0:        0x104889a5e - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h650be7d6317a1169
   1:        0x1048b601e - core::fmt::write::h451c4858d0fea670
   2:        0x1048897ca - std::io::Write::write_fmt::had0d660ea6c32991
   3:        0x1048a384f - std::panicking::default_hook::{{closure}}::h7f9d4cee5e038ae9
   4:        0x1048a3543 - std::panicking::default_hook::h5fb4408d2b8d41f0
   5:        0x1048a3d7a - std::panicking::rust_panic_with_hook::h6f223595664a4622
   6:        0x10488a2fb - std::panicking::begin_panic_handler::{{closure}}::ha7895c801e815942
   7:        0x104889bd8 - std::sys_common::backtrace::__rust_end_short_backtrace::hafb1945b261ddb13
   8:        0x1048a3953 - _rust_begin_unwind
   9:        0x1048c0baf - core::panicking::panic_fmt::h23cb1548c6906f6a
  10:        0x1048c0b07 - core::panicking::panic::h97965fc650fa4c16
  11:        0x10482f6ce - linked_hash_map::LinkedHashMap<K,V,S>::insert::h6aed8966938aeef9
  12:        0x10482d900 - yaml_rust::yaml::YamlLoader::insert_new_node::h84a2dc6aca853064
  13:        0x10482d2fd - <yaml_rust::yaml::YamlLoader as yaml_rust::parser::MarkedEventReceiver>::on_event::h90cc8ed523819ea3
  14:        0x104820ebf - yaml_rust::parser::Parser<T>::load_node::hea42f316d6ec0f94
  15:        0x1048213fe - yaml_rust::parser::Parser<T>::load_mapping::h657e040bebe66fbe
  16:        0x10482095b - yaml_rust::parser::Parser<T>::load::hfaa369a92904d439
  17:        0x10482daa8 - yaml_rust::yaml::YamlLoader::load_from_str::hbc8c4808e30bc98b
  18:        0x104797f36 - ktmpl::template::Template::new::h37f21bc74c7d28da
  19:        0x10478e679 - ktmpl::main::h10bda75d6a75f5e5
  20:        0x10478c38a - std::sys_common::backtrace::__rust_begin_short_backtrace::he46e50b20aaf6f38
  21:        0x10478c3ac - std::rt::lang_start::{{closure}}::h2102adef0070e7f3
  22:        0x1048a10ad - std::rt::lang_start_internal::h2f38ef5052441758
  23:        0x10478f4d9 - _main

For reference, these are the contents of test.yml.

Test File

---
kind: "Template"
apiVersion: "v1"
metadata:
  name: "test"
objects:
  - kind: "Service"
    apiVersion: "v1"
    metdata:
      name: "test"
    spec:
      ports:
        - name: "test"
          protocol: "TCP"
          targetPort: "$((PORT))"
      selector:
        app: "test"
parameters:
  - name: "PORT"
    description: "The port the service should run on"
    required: true
    parameterType: "int"

I haven't had the pleasure of using ktmpl, so I'm not really sure what's going on. I'd appreciate some assistance here. Is the issue with test.yml? It worked with previous CI runs.

For reference, I ran this on macOS 11.0, but the error also appears on macOS 10.14 and 10.15. (All Intel Macs.)

I should also mention that I saw deprecation warnings upon compilation. More details available if you need it.

ktmpl version on homebrew repo is out of date

The latest available version of ktmpl on homebrew is version 0.7.0. Is it possible to update the package to the latest release (0.9.0)?

$ brew info ktmpl | head -n1
ktmpl: stable 0.7.0 (bottled), HEAD

int / boolean are written as strings into the output

foo.yaml:

kind: Template
apiVersion: v1
objects:
  - kind: Deployment
    apiVersion: apps/v1
    spec:
      replicas: $(REPLICAS)
parameters:
  - name: "REPLICAS"
    description: "number of pods"
    required: true
    value: 1
    parameterType: "bool"

ktmpl foo.yaml

---
kind: Deployment
apiVersion: apps/v1
spec:
  replicas: "1"

this causes k8s to complain because replicas is a string not an integer. A similar thing happens with boolean values.

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.