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

don't use obscure env variables and use flags #44

Merged
merged 3 commits into from
Jun 26, 2024

Conversation

aojea
Copy link
Contributor

@aojea aojea commented Jun 26, 2024

Let's do the things the right way

Fixes: #43

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aojea

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 requested a review from danwinship June 26, 2024 10:50
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 26, 2024
@k8s-ci-robot k8s-ci-robot requested a review from thockin June 26, 2024 10:50
@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 26, 2024
@aojea
Copy link
Contributor Author

aojea commented Jun 26, 2024

/assign @danwinship

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 26, 2024
cmd/main.go Show resolved Hide resolved
install-anp.yaml Outdated
@@ -80,7 +80,7 @@ spec:
- name: kube-network-policies
image: registry.k8s.io/networking/kube-network-policies:v0.3.0
command: ["/bin/netpol"]
args: ["-v=2", "-admin-network-policy=true", "-baseline-admin-network-policy=true"]
args: ["-v=2", "-admin-network-policy=true", "-baseline-admin-network-policy=true","--hostname-override=${MY_NODE_NAME}"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the main problem because I added the env variables is because I was not sure you can do this, of using the env variable as the flag value and I was too lazy ... now that you mentioned I can see this is exactly how most people do https://grep.app/search?q=hostname-override%3D%24&filter[lang][0]=YAML

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ups , something is wrong

2024-06-26T10:58:00.54696576Z stderr F I0626 10:58:00.546903       1 controller.go:89] Creating controller: networkpolicy.Config{FailOpen:false, AdminNetworkPolicy:false, BaselineAdminNetworkPolicy:false, QueueID:100, NodeName:"${my_node_name}"}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aojea aojea force-pushed the flags_better_than_env branch from 8f1377e to 0e8501c Compare June 26, 2024 10:55
cmd/main.go Outdated Show resolved Hide resolved
@danwinship
Copy link

/lgtm
/hold
if you want to update the error message but maybe that was intentional

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Jun 26, 2024
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 26, 2024
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@aojea
Copy link
Contributor Author

aojea commented Jun 26, 2024

/lgtm /hold if you want to update the error message but maybe that was intentional

/hold cancel

fixed the env variable problem and added the error to the log, once CI passes we should be good to go and I fix existing release

@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 Jun 26, 2024
@aojea aojea merged commit 1b5734b into kubernetes-sigs:main Jun 26, 2024
8 of 9 checks passed
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. 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.

Use a command line option to pass the node name
3 participants