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

Unify yaml serialization dependencies #266

Merged
merged 1 commit into from
Jul 17, 2019

Conversation

ahmetb
Copy link
Member

@ahmetb ahmetb commented Jul 17, 2019

  • Standardize on sigs.k8s.io/yaml.
  • Bump k8s.io/apimachinery depenceny as it used to depend on module github.com/ghodss/yaml

Fixes #265.

/hold
Currently there are some test issues. Looks like the parser is actually doing
some unnecessary defaulting on metav1.ObjectMeta fields. This is making tests
difficult.

@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 17, 2019
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 17, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Jul 17, 2019
@codecov-io
Copy link

codecov-io commented Jul 17, 2019

Codecov Report

Merging #266 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #266      +/-   ##
==========================================
+ Coverage   53.76%   53.83%   +0.07%     
==========================================
  Files          18       18              
  Lines         863      860       -3     
==========================================
- Hits          464      463       -1     
+ Misses        342      341       -1     
+ Partials       57       56       -1
Impacted Files Coverage Δ
pkg/receipt/receipt.go 66.66% <ø> (ø) ⬆️
pkg/index/indexscanner/scanner.go 69.56% <100%> (+2.21%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6016916...46fbe05. Read the comment docs.

Standardize on sigs.k8s.io/yaml.
Bump k8s.io/apimachinery depenceny as it used to depend on module
github.com/ghodss/yaml

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
@ahmetb
Copy link
Member Author

ahmetb commented Jul 17, 2019

Hmm interesting enough this test was failing locally at some point (like below) but they're good now.

--- FAIL: TestStore (0.01s)
    receipt_test.go:71:   &index.Plugin{
          	TypeMeta: v1.TypeMeta{Kind: "Plugin", APIVersion: "krew.googlecontainertools.github.com/v1alpha2"},
          	ObjectMeta: v1.ObjectMeta{
          		... // 8 identical fields
          		DeletionTimestamp:          nil,
          		DeletionGracePeriodSeconds: nil,
        - 		Labels:                     nil,
        + 		Labels:                     map[string]string{},
        - 		Annotations:                nil,
        + 		Annotations:                map[string]string{},
        - 		OwnerReferences:            nil,
        + 		OwnerReferences:            []v1.OwnerReference{},
        - 		Finalizers:                 nil,
        + 		Finalizers:                 []string{},
          		ClusterName:                "",
        - 		ManagedFields:              nil,
        + 		ManagedFields:              []v1.ManagedFieldsEntry{},
          	},
          	Spec: index.PluginSpec{ShortDescription: "short", Platforms: []index.Platform{{URI: "http://example.com", Sha256: "deadbeef", Files: []index.FileOperation{{}}, Bin: "foo"}}},
          }

FAIL
FAIL	sigs.k8s.io/krew/pkg/receipt	0.785s

@ahmetb
Copy link
Member Author

ahmetb commented Jul 17, 2019

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 17, 2019
Copy link
Contributor

@corneliusweig corneliusweig left a comment

Choose a reason for hiding this comment

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

Nice.

@@ -86,7 +84,6 @@ func LoadPluginFileFromFS(pluginsDir, pluginName string) (index.Plugin, error) {

// ReadPluginFile loads a file from the FS. When plugin file not found, it
// returns an error that can be checked with os.IsNotExist.
// TODO(lbb): Add object verification
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

Choose a reason for hiding this comment

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

nice

Copy link
Member Author

Choose a reason for hiding this comment

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

?

@corneliusweig
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 17, 2019
@corneliusweig
Copy link
Contributor

corneliusweig commented Jul 17, 2019

/lgtm cancel
I think you referenced the wrong issue in your PR summary:

Fixes #256.

It should read #265

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 17, 2019
@ahmetb
Copy link
Member Author

ahmetb commented Jul 17, 2019

Done.

@corneliusweig
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahmetb, corneliusweig

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:
  • OWNERS [ahmetb,corneliusweig]

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

@corneliusweig
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 17, 2019
@k8s-ci-robot k8s-ci-robot merged commit 7188222 into kubernetes-sigs:master Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eliminate different yaml parsing/serializing dependencies
5 participants