Skip to content

Instantly share code, notes, and snippets.

@identw
Created April 5, 2024 18:56
Show Gist options
  • Save identw/2cf0b16682123c0ace4e38e8f66139b0 to your computer and use it in GitHub Desktop.
Save identw/2cf0b16682123c0ace4e38e8f66139b0 to your computer and use it in GitHub Desktop.
test.jsonnet
local h = import './helpers.jsonnet';
local object = {
arr: [
{
containerPort: 53,
name: 'dns',
protocol: 'TCP',
},
{
containerPort: 8080,
name: 'http',
protocol: 'TCP',
},
{
containerPort: 2222,
name: 'ssh',
protocol: 'TCP',
},
]
};
object + h.mergeArrayWithField(['http'], 'name', 'arr', {
containerPort: 8443,
name: 'https',
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment