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

Added code for fields with dots(.) in their names work as needed #4591

Merged
merged 7 commits into from May 2, 2022

Conversation

annelau21
Copy link
Contributor

Fixes #4487

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 19, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Apr 19, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @annelausf!

It looks like this is your first PR to kubernetes-sigs/kustomize 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kustomize has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 19, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @annelausf. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 19, 2022
@natasha41575
Copy link
Contributor

please sign the CLA!

@@ -5,10 +5,10 @@ package fieldspec

import (
"fmt"
"sigs.k8s.io/kustomize/kyaml/pathsplitterutil"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix the imports

@@ -18,7 +16,6 @@ type AnnotationsTransformerPlugin struct {
FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

don't commit this file

@@ -1,7 +1,7 @@
// Copyright 2021 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0

package utils
package pathsplitterutil
Copy link
Contributor

Choose a reason for hiding this comment

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

let's just call this package "utils", and put it under kyaml/utils


import (
. "sigs.k8s.io/kustomize/kyaml/pathsplitterutil"
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix the import order, this needs to go down with the github one

@@ -9,6 +9,7 @@ import (
"io/ioutil"
"log"
"regexp"
"sigs.k8s.io/kustomize/kyaml/pathsplitterutil"
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment here

@natasha41575
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 19, 2022
@@ -2310,7 +2310,7 @@ func TestGetAnnotations(t *testing.T) {
}

func TestGetFieldValueWithDot(t *testing.T) {
t.Skip()
//t.Skip()
Copy link
Contributor

Choose a reason for hiding this comment

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

just remove this line, and the TODO below

@k8s-ci-robot
Copy link
Contributor

@annelausf: This PR has multiple commits, and the default merge method is: merge.
You can request commits to be squashed using the label: tide/merge-method-squash

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@@ -6,6 +6,7 @@ package replacement
import (
"errors"
"fmt"
utils2 "sigs.k8s.io/kustomize/kyaml/utils"
Copy link
Contributor

Choose a reason for hiding this comment

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

fix imports, and lets call this something more descriptive, maybe kyaml_utils instead of utils2

@natasha41575 natasha41575 added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Apr 19, 2022
@natasha41575
Copy link
Contributor

Please sign the CLA!

And looks like there are some test failures. If you can narrow down the cause maybe we can help provide guidance to a solution.

@annelau21
Copy link
Contributor Author

Working on signing the CLA and will look into the test case failures in the meantime.

@annelau21
Copy link
Contributor Author

annelau21 commented Apr 19, 2022

Hi @natasha41575 looked into the errors that we saw and found this.
I don't see how the changes we made could have caused this. Any ideas?
Screen Shot 2022-04-19 at 2 43 00 PM

Seems like this test: TestAddManagedbyLabel is also failing in the master. Is this a flakey test?

@natasha41575
Copy link
Contributor

TestAddManagedbyLabel might have been caused by some CI changes, I will look into that one.

There are some other tests failing though, that I think are actually caused by this PR, though I don't know why they would be failing. If you have time to investigate the other failures, that would be very helpful.

@natasha41575
Copy link
Contributor

I tested TestAddManagedBy on master and it seems to be working fine. You have to set the version:

go test -v -run TestAddManagedbyLabel -ldflags "-X sigs.k8s.io/kustomize/api/provenance.version=v444.333.222"

There are other tests however, that are failing. You can see those logs here: https://github.com/kubernetes-sigs/kustomize/runs/6084779608?check_suite_focus=true

@annelau21
Copy link
Contributor Author

annelau21 commented Apr 19, 2022

Waiting to see if the changes we just made will fix the other tests.
Can you help run the /ok-to-test. Still working on getting CLA

@annelau21 annelau21 closed this Apr 19, 2022
@annelau21 annelau21 reopened this Apr 19, 2022
@natasha41575
Copy link
Contributor

You can see the same test failures in the other PR that attempted to work on this #4501, so I think investigation is needed.

You can run make verify-kustomize-repo locally to run the tests.

@annelau21
Copy link
Contributor Author

Also I signed the CLA, however it is still saying Missing CLA Authorization. Is there a way to rerun that check?

@natasha41575
Copy link
Contributor

Also I signed the CLA, however it is still saying Missing CLA Authorization. Is there a way to rerun that check?

/check-cla

If this doesn't work, make sure your email address that you used to sign the CLA is set on your commits.

@annelau21
Copy link
Contributor Author

/check-cla

@sarjamil
Copy link
Contributor

just testing

@sarjamil
Copy link
Contributor

@sarjamil

annelau21 and others added 7 commits April 19, 2022 16:45
Co-authored-by: sarjamil <sjamil@salesforce.com>
Co-authored-by: sarjamil <sjamil@salesforce.com>
Co-authored-by: sarjamil <sjamil@salesforce.com>
Co-authored-by: sarjamil <sjamil@salesforce.com>
Co-authored-by: sarjamil <sjamil@salesforce.com>
Add co-author to PR.

Co-authored-by: sarjamil <sjamil@salesforce.com>
Co-authored-by: sarjamil sjamil@salesforce.com
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Apr 21, 2022
@annelau21
Copy link
Contributor Author

@natasha41575 Signed the CLA! Let me know if there are any further comments. Thanks!

@annelau21
Copy link
Contributor Author

/ok-to-test

@natasha41575
Copy link
Contributor

/retest

@natasha41575
Copy link
Contributor

Thank you very much!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 2, 2022
@natasha41575
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: annelausf, natasha41575

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 2, 2022
@k8s-ci-robot k8s-ci-robot merged commit 188e35f into kubernetes-sigs:master May 2, 2022
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GetFieldValue doesn't work with fields that contain dots(.)
4 participants