Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Switch to sigs.k8s.io/yaml #3380

Merged

Conversation

abayer
Copy link
Contributor

@abayer abayer commented Mar 19, 2019

Submitter checklist

  • Change is code complete and matches issue description.
  • Change is covered by existing or new tests.

Description

This will let us incorporate k8s and Tekton types directly into
jenkins-x.yml - previously, we'd have trouble with that due to the use
of JSON struct tags in k8s/Tekton/etc, so that the default golang YAML
library would not unmarshal correctly.

This did require changing loop_step/jenkins-x.yml - a bare - on as
part of a string slice (or foo: on for a string field) would end up
unmarshalling as the string true, so yeah, on, off, t, f,
etc do need to be quoted if they're supposed to result in strings now.

(this will make #3312 and #3366 easier to implement)

Special notes for the reviewer(s)

Which issue this PR fixes

n/a

This will let us incorporate k8s and Tekton types directly into
jenkins-x.yml - previously, we'd have trouble with that due to the use
of JSON struct tags in k8s/Tekton/etc, so that the default golang YAML
library would not unmarshal correctly.

This did require changing `loop_step/jenkins-x.yml` - a bare `- on` as
part of a string slice (or `foo: on` for a string field) would end up
unmarshalling as the string `true`, so yeah, `on`, `off`, `t`, `f`,
etc do need to be quoted if they're supposed to result in strings now.
Password string `yaml:"password,omitempty" json:"password"`
Kind UserKind `yaml:"kind"`
Username string `json:"username"`
ApiToken string `json:"apitoken"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

struct field ApiToken should be APIToken

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

baaaaah not much I can do here since the field already was defined.

@abayer
Copy link
Contributor Author

abayer commented Mar 19, 2019

/test bdd

@ccojocar
Copy link
Contributor

@abayer FYI we use for GitOps the github.com/ghodss/yaml package as a replacement of the standard package. We had some issues in the past with the serialisation of k8s resources. I am wondering, if we can use sigs.k8s.io/yaml everywhere.

cc @jstrachan

@abayer
Copy link
Contributor Author

abayer commented Mar 20, 2019

@ccojocar If we can use ghodss/yaml, we can use sigs.k8s.io/yaml - ghodss/yaml has moved to sigs.k8s.io/yaml now, which is why I used it here. =)

@rawlingsj
Copy link
Member

/lgtm

@jenkins-x-bot-test
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rawlingsj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rawlingsj
Copy link
Member

/test all

@jenkins-x-bot-test jenkins-x-bot-test merged commit a33a676 into jenkins-x:master Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants