parse helm umbrella charts yaml via yq - parsing

There is a need to get a version of the dependency chart based on the name in the Helm umbrella chart structure. How can it be done by using yq tool?
Input file example:
apiVersion: v2
name: application1
type: application
version: 0.1.1
dependencies:
- name: chart1
version: v1.13.0
repository: some-repo
- name: chart2
version: v0.11.0
repository: some-repo
the expected output is the version based on the name of the chart. So I want to be able to pass the chart name(chart1/chart2) and get the version of it:
if name: chart1 output --> v1.13.0
if name: chart2 output --> v0.11.0

With mikefarah/yq, you could use a combination of select and strenv helpers to pass the required version argument as a string and retrieve the corresponding value of version
cname="chart1" yq '.dependencies[]|select(.name == strenv(cname)).version' yaml

Related

It looks like pub.dartlang.org is having some trouble

I was trying to download packages and run command pub get when the error Connection closed before full header was received exit code 69. So I tried to use VPN, because I thought it was because of my network. Then I saw this:
Screenshot
I don't have any anti-virus, so what do I do?
NOTE: I'm not using Flutter
pubspec.yaml
name: dart_application_2
description: A sample command-line application.
version: 1.0.0
# homepage: https://www.example.com
environment:
sdk: '>=2.17.5 <3.0.0'
# dependencies:
# path: ^1.8.0
dev_dependencies:
lints: ^2.0.0
test: ^1.16.0

Renovate is not detecting helm charts name or version

This is the value in my helm Chart.yaml
apiVersion: v2
name: luna-lovegood
type: application
version: 0.1.0
dependencies:
- name: application
version: 0.8
repository: https://luna-lovegood.jfrog.io/artifactory/helm
Whenever I run rennovate against this, I get this
Matched 1 file(s) for manager helmv3: deploy/helm/chart/Chart.yaml
Name and/or version missing for all dependencies
Both name and version is present in Chart.yaml, I do not understand what is missing, any help is much appreciated.
Looking into renovate code it was identified that renovate expects the value of "version" to be a string. So, by updating the Charts.yaml to:
apiVersion: v2
name: luna-lovegood
type: application
version: "0.1.0"
dependencies:
- name: application
version: "0.8"
repository: https://luna-lovegood.jfrog.io/artifactory/helm
we were able to fix this issue.
Hope this helps, have a good day you debugging dev!

Unable to read csv file from the build folder , that get created while I run my post requests

I am trying to read data from csv file for my patch and delete requests. I am not adding a csv file by myself, it is getting generated after the completion of my post requests in the build folder with the path resources/test/data/"****".csv .
Earlier when I was using dependencies as follows, it was working fine:-
testCompile group: 'io.gatling.highcharts', name: 'gatling-charts-highcharts', version: '2.2.5'
testCompile 'org.scala-lang:scala-library:2.11.12'
compile "org.scalaj:scalaj-http_2.11:2.3.0"
compile group: 'com.github.tototoshi', name: 'scala-csv_2.11', version: '1.2.2'
But now when i updated my application as follows :-
testCompile group: 'io.gatling.highcharts', name: 'gatling-charts-highcharts', version: '3.3.1'
testCompile 'org.scala-lang:scala-library:2.12.10'
compile "org.scalaj:scalaj-http_2.11:2.4.2"
compile group: 'com.github.tototoshi', name: 'scala-csv_2.12', version: '1.3.6'
it is giving me the error as
Caused by: java.lang.IllegalArgumentException: Could not locate feeder file: Resource ******.csv not found
at io.gatling.core.feeder.FeederSupport.separatedValues(FeederSupport.scala:45)
at io.gatling.core.feeder.FeederSupport.separatedValues$(FeederSupport.scala:40)
at io.gatling.core.Predef$.separatedValues(Predef.scala:24)
at io.gatling.core.feeder.FeederSupport.csv(FeederSupport.scala:34)
at io.gatling.core.feeder.FeederSupport.csv$(FeederSupport.scala:33)
at io.gatling.core.Predef$.csv(Predef.scala:24)
Your classpath is a mess as you have libraries compiled against Scala 2.11 (scalaj-http_2.11) and Scala 2.12 (scala-library:2.12.10, gatling-charts-highcharts:3.3.1).
You need to have Scala 2.12 everywhere.
Then, you file can't be located. It should be in src/test/resources. Where have you placed it? Have you checked for possible typos?

How to specify dependency_overrides in pubspec.yaml?

I am working with latest version of angular.dart and my pubspec.yaml looks somewhat like this:
name: angularApp
dependencies:
angular:
git: 'git#github.com:angular/angular.dart'
third_party_angular_plugin: any
the problem is third_party_angular_plugin is depending on stable version of angular.dart. I tried to specify as follows:
name: angularApp
dependencies:
angular:
git: 'git#github.com:angular/angular.dart'
third_party_angular_plugin: any
dependency_overrides:
angular:
version: ">=0.9.10"
But it throws a weird error saying Bad State: No elements dart:core List.single ....
How can I override third_party_angular_plugin's dependency on angular for my app?
The version is not a separate nested key, as per the example on Pub Dependencies page, the right format is this:
name: angularApp
dependencies:
angular:
git: 'git#github.com:angular/angular.dart'
third_party_angular_plugin: any
dependency_overrides:
angular: ">=0.9.10"

How to include pub package path.dart in pubspec.yaml

I am working on an http server POC based on the route package demo. It requires the path package which states that my pubspec.yaml file contain the folowing:
name: poc
description: Proof of Concept
dependencies:
route: any
path:any
The editor marks the word path as a reserved word and when I do a pub get I get an error
Pub get failed, [1] Syntax error on line 5, column 11: invalid YAML in plain scalar
which is the line that has the path dependency. How do I resolve this?
Dart Editor version 1.0.0_r30338 (DEV)
Dart SDK version 1.0.0.7_r30338
You are missing a space:
path:any
Should be:
path: any
I get the same error without a space on any item in the pubspec.yaml

Resources