Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

yq: failed traversing anchors in version.yaml #2431

Closed
wants to merge 1 commit into from

Conversation

Pennyzct
Copy link
Contributor

@Pennyzct Pennyzct commented Feb 2, 2020

Description of problem

Recently, initrd-related CI are failing frequently.
http://jenkins.katacontainers.io/job/kata-containers-runtime-ubuntu-18-04-PR-initrd/2843/

INFO: Image to generate: kata-containers-*default-initrd-name-*default-initrd-version-osbuilder-7526f49-agent-36b37f6.initrd
......
./rootfs-builder/rootfs.sh: line 280: /tmp/jenkins/workspace/kata-containers-runtime-ubuntu-18-04-PR-initrd/go/src/github.com/kata-containers/osbuilder/rootfs-builder/*default-initrd-name/config.sh: No such file or directory
Failed at 120: sudo -E AGENT_INIT="${AGENT_INIT}" AGENT_VERSION="${agent_commit}" GOPATH="$GOPATH" USE_DOCKER=true OS_VERSION=${os_version} ./rootfs-builder/rootfs.sh "${distro}"
Failed at 26: "${cidir}/install_kata_image.sh" "${tag}"

Debugging on the above output, the cause may come from that yq failed reading values from assets.initrd.architecture.$arch.name
Based on the latest yq spec, the read command could print out the anchors of a document and can also traverse them.
But when anchor refers to an scalar (string, integer etc), the latest yq could not traverse it.
e.g.

$ yq read versions.yaml "assets.initrd.architecture.ppc64le.name"
*default-initrd-name

@Pennyzct
Copy link
Contributor Author

Pennyzct commented Feb 2, 2020

/test

@codecov
Copy link

codecov bot commented Feb 2, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@a91cb13). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master    #2431   +/-   ##
=========================================
  Coverage          ?   50.88%           
=========================================
  Files             ?      112           
  Lines             ?    16157           
  Branches          ?        0           
=========================================
  Hits              ?     8222           
  Misses            ?     6922           
  Partials          ?     1013

The latest yq might not "resolve" the anchor, if it refers to
an scalar (string, integer etc). But it's fine with the collections
(sequences, mappings).

Fixes: kata-containers#2430

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
@Pennyzct
Copy link
Contributor Author

Pennyzct commented Feb 3, 2020

/test

@Pennyzct
Copy link
Contributor Author

Pennyzct commented Feb 4, 2020

Hi~ @grahamwhaley
I've also done a few research on the new yq anchors and alias. Like I said above

when anchor refers to an scalar (string, integer etc), the latest yq could not traverse it.

But it's okay with the collection(sequence, map, etc), so here, I refine all the anchors in version.yaml to refer to collection, not scalar.
I'll raised an issue in yq community to see if my understanding is correct~~~

@Pennyzct
Copy link
Contributor Author

Pennyzct commented Feb 4, 2020

About ARM CI failure, I've already raised another PR #2435 to fix it. ;).

Pennyzct added a commit to Pennyzct/runtime that referenced this pull request Feb 5, 2020
We need to include changes in PR github.com/kata-containers/agent#706
(kata-containers/agent#706, to use
the new vsock-trivial-handshake scheme implemented in FC v0.20.0.

Fixes: kata-containers#2378
Depends-on: kata-containers#2431

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
@amshinde
Copy link
Member

amshinde commented Feb 7, 2020

@grahamwhaley Can you take a look?

@Pennyzct
Copy link
Contributor Author

Hi~ guys
Thanks for @jodh-intel raising an issue in yq community for this traversing anchors problem.
We already got answer from them and @jodh-intel has already raised an issue kata-containers/tests#2290 to try to fix them. ;).
So I will close this PR here~~~

@Pennyzct Pennyzct closed this Feb 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants