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

will not exit when no kubeconfig found #581

Merged
merged 1 commit into from
Jun 27, 2019

Conversation

yashbhutwala
Copy link
Contributor

@yashbhutwala yashbhutwala commented Jun 26, 2019

/closes #547

also related to issue #258 and PR #425

@jdartigalongue @rrati

@yashbhutwala
Copy link
Contributor Author

/cherrypick release-2019.6.x

@operator-r2d2
Copy link
Contributor

@yashbhutwala: once the present PR merges, I will cherry-pick it on top of release-2019.6.x in a new PR and assign it to you.

In response to this:

/cherrypick release-2019.6.x

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.

@@ -61,8 +61,7 @@ var rootCmd = &cobra.Command{
}
// Sets kubeconfig and initializes resource client libraries
if err := setResourceClients(); err != nil {
log.Error(err)
os.Exit(1)
log.Warnf("resource clients were not set properly, %v", err)
Copy link

Choose a reason for hiding this comment

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

I don't think we want to log anything in the case of the native command. Printing even a warning would seem confusing imo. May need to take most of PreRunE and place in a function that only non-native commands would use unless there is a better way to have the native sub-commands not use this PreRunE (which I'm not sure there is)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a hack where I can have a PersistentRunE for a subcommand that will override the root command, but it's being fixed in cobra right now. See issue 252

@jdartigalongue
Copy link
Collaborator

@yashbhutwala @rrati I think we want to exit by default if there is no kube config file... just not when using the native command.

Copy link

@rrati rrati left a comment

Choose a reason for hiding this comment

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

/lgtm
/cherrypick release-2019.6.x

@operator-r2d2
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jdartigalongue, rrati, yashbhutwala

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 [jdartigalongue,rrati,yashbhutwala]

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

@rrati
Copy link

rrati commented Jun 27, 2019

/cherrypick release-2019.6.x

@operator-r2d2
Copy link
Contributor

@rrati: once the present PR merges, I will cherry-pick it on top of release-2019.6.x in a new PR and assign it to you.

In response to this:

/cherrypick release-2019.6.x

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.

@operator-r2d2 operator-r2d2 merged commit 1636b39 into blackducksoftware:master Jun 27, 2019
@operator-r2d2
Copy link
Contributor

@yashbhutwala: new pull request created: #591

In response to this:

/cherrypick release-2019.6.x

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

synopsysctl kube-mock feature shouldn't require a kubeconfig file
4 participants