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

⚠️ make UseExistingCluster a pointer to support explicitly op… #463

Merged

Conversation

adohe-zz
Copy link

@adohe-zz adohe-zz commented Jun 2, 2019

…t-out in the code

just as what #461 mentioned, make UseExistingCluster a pointer thus gives a way to explicitly opt-out in the code.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 2, 2019
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 2, 2019
@adohe-zz
Copy link
Author

adohe-zz commented Jun 2, 2019

/assign @DirectXMan12

@adohe-zz adohe-zz force-pushed the make_useexistingcluster_pointer branch from 7005c81 to a0caa74 Compare June 3, 2019 04:51
Copy link
Contributor

@DirectXMan12 DirectXMan12 left a comment

Choose a reason for hiding this comment

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

minor comments, otherwise lgtm

func (te *Environment) useExistingCluster() bool {
if te.UseExistingCluster == nil {
useExistingCluster := strings.ToLower(os.Getenv(envUseExistingCluster)) == "true"
te.UseExistingCluster = &useExistingCluster
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to populate this here -- just return the env var without populating

Copy link
Author

Choose a reason for hiding this comment

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

comment addressed, ptal

@adohe-zz adohe-zz force-pushed the make_useexistingcluster_pointer branch from a0caa74 to c9aad37 Compare June 4, 2019 02:39
if te.UseExistingCluster == nil {
return strings.ToLower(os.Getenv(envUseExistingCluster)) == "true"
}
return *te.UseExistingCluster == true
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: no need for == true here, since it's a bool

@adohe-zz adohe-zz force-pushed the make_useexistingcluster_pointer branch from c9aad37 to 0d3fbbc Compare June 11, 2019 07:23
@adohe-zz
Copy link
Author

comment addressed and CI happy @DirectXMan12 ptal

@DirectXMan12
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 Jun 11, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adohe, DirectXMan12

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 Jun 11, 2019
@k8s-ci-robot k8s-ci-robot merged commit 386a7bd into kubernetes-sigs:master Jun 11, 2019
@adohe-zz adohe-zz deleted the make_useexistingcluster_pointer branch June 12, 2019 09:17
DirectXMan12 pushed a commit that referenced this pull request Jan 31, 2020
use controller-runtime logging in controller
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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants