JSonNet boolean serialization

Quick question: In JSONNet - how do i get bool true/false to serialize as bool 1/0 I can see how we handle null values and all that just cant seem to find how to do this. is this possible?

NetDataContractSerializer Deserialization With New Property

Lacking any real foresight, I've serialized a large set of data decorated only with Serializable using NetDataContractSerializer, and now I'd like to add a new field. What are my options? The...

ASP.NET WebAPI vs MVC subtle behavioural deviations when it comes to json-(de)serialization of parameters

Let's assume we have the following simple ajax-call: $.ajax({ url: "/somecontroller/someaction", data: JSON.stringify({ someString1: "", someString2: null, ...

Patterns for passing args to _binary rules in Bazel?

I have a macro go_server that calls go_binary among others. Here's an example of it being used: go_server( name = "service", library = ":go_default_library", # go_binary args = [ ...

How to correctly call jsonnet with imports from Python

I'm using jsonnet to build json objects that will be used by Python code, calling jsonnet from Python using the bindings. I want to set up my directory structure so that the jsonnet files are in...

Custom builtin functions in jsonnet

Is there a way how I can call golang functions from jsonnet? Now that there is a go port of jsonnet and for example ksonnet is adding custom native functions I am wondering if there is a way how...

Update an existing array element with jsonnet

I am using jsonnet to read in a value which consists of an array. I want to modify the first element in that array to add a value. The data structure looks like this: { "my_value": [ { ...

jsonnet - remove null values from array

I want to remove empty values and duplicates from an array, duplicate values are getting removed, empty isn't template: local sub = [ "", "one", "two", "two", ""]; { env:...

Overwrite a nested list element using jsonnet

I have the following json { "namespace": "monitoring", "name": "alok", "spec": { "replicas": 1, "template": { "metadata": "aaa", "spec": { ...

How to pull images from private docker registry in drone ci pipeline

Answer Problem I need to use an image from a private docker image registry in my test pipeline I could not find any (edit: overlooked) up to date documentation on how to use a private docker...

Unable to scrape other namespaces when using kube-prometheus

Prometheus deployed using kube-prometheus can't scrape resources on namespaces other than default, monitoring and kube-system. I added additional namespaces on my jsonnet as described in...

Why does jsonnet python package use the name _jsonnet?

The Python Api for Jsonnet uses import _jsonnet Why is that? Why was it preferred over import jsonnet ?

Complex validation in Jsonnet library

What I'm trying to do is create a libsonnet library with some complex validation on the inputs, but I'm not sure how to implement this in the libsonnet file without getting null back. I'm trying...

jsonnet: How to serialize array into string

How to convert this ["a", "b", "c", "d"] into "a", "b", "c", "d" in JSONNET (https://jsonnet.org/ref/stdlib.html)

Organizing grafana dashboards using Kube-prometheus

I needed some help understanding how people are managing grafana dashboards using prometheus operator. I have Prom operator running on my cluster. I have kube metrics dashboards through...

how to replace one element of array in jsonnet with mixin way?

we have array imported from libsonnet { "volumes": [ { "emptyDir": {}, "name": "grafana-storage" }, { "configMap": { "name": "grafana-dashboard-apiserver" ...

What is the difference between the + operator and std.mergePatch in Jsonnet?

Jsonnet's std.mergePatch implements RFC7396, but in my naive testing I didn't find a different between the way it behaved and the + operator; e.g. the + operator respects x+ syntax. std.mergePatch...

ARCore Sceneform SDK linking materials Error?

I just have a simple table model has a 3 segments Top,Brick,Bottom. I applied Normal maps to the bottom part and it was successful but when i tried to apply normal map for the Brick and Top part...

How to set a hostname in a jsonnet file?

I am trying to get the hang of jsonnet files. So far all I have is hard-coded values but what if I wanted to get the hostname for a Java application. For example in Java I would just do: String...

Multiple github actions defined in repository fails

The problem I'm facing is that the Packer build fails. This is the error I get: Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under...

Combining objects with + (plus operator) vs whitespace

Jsonnet's docs mention that the + operator can be used for inheritance, or, as it's worded in the tutorial, to combine objects: { a: 1, b: 2, } + { a: 3 } However, I've noticed that - at...

jsonnet std.mapWithKey - not generating an array?

I have a local jsonnet object defined as so: local compactRules = { key1: "val1", key2: "val2", key3: "val3" }; And I'd like to generate this array: [ { rule: "key1", action:...

Using jsonnet to update Prometheus operator default rule

I am trying to override the Default rules in Kube-Prometheus-Stack. I have enabled default rules when Kube-Prometheus-Stack was deployed. I tried with jsonnet as shown in this example...

Using jsonnet for grafana dashboard

I am trying jsonnet (my-custom-grafana.jsonnet) for grafana dashboard.I tried below code. local grafana = import 'grafonnet/grafana.libsonnet'; local dashboard = grafana.dashboard; local row =...

jsonnet conditional generation of a field

How can I get something like this working in jsonnet? { if 1 == 1 then store: true } I get the below error when I run it with jsonnet: STATIC ERROR: a.jsonnet:2:9-11: unexpected: if...

How to build using Bazel offline

I want to build my jsonnet with Bazel. For that I am using the jsonnet rules. Unfortunately in my build pipelines I can't pull from github. So, I have been reading into offline builds, but I can't...

Add elements of array in jsonnet

I am trying to add elements of an array in jsonnet. Can someone post a sample? Sample input: [0, 1, 2, 3] output 6

pipeline type (exec) is not supported with 'drone exec'

I am having issues running drone exec on my local Machine Ubuntu, here is how i run it and .drone.jsonnet content .drone.jsonnet: local default_deps_base='libsystemd-dev libboost-thread-dev...

pip getting killed in Docker

I am building a Docker container based on python:3.7-slim-stretch (same problem also happens on python:3.7-slim-stretch), and it is getting Killed on pip install --no-cache-dir --verbose...

Passing TLAs from argocd to jsonnet

Trying to understand passing TLAs to my jsonnet file with argocd. This is part of my argocd application.yaml which compiles the kube-prometheus manifests straight from my main.jsonnet file. I want...