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

✨ Enable verbosity control from chart values #54

Merged
merged 5 commits into from
May 23, 2024

Conversation

francostellari
Copy link
Contributor

Summary

Enable verbosity control from chart values

Related issue(s)

Fixes #

Copy link
Collaborator

@pdettori pdettori left a comment

Choose a reason for hiding this comment

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

/lgtm

@pdettori
Copy link
Collaborator

@francostellari could you please check if the e2e test works in your dev env ? It is failing in the CI for this PR.

@MikeSpreitzer
Copy link
Contributor

MikeSpreitzer commented May 22, 2024

Debugging this would have been easier with e81fb04 (from #60) --- it would show that the OCM Status Add-On controller is not running.

Further, a listing of Pod objects in the hub would show a line like the following.

open-cluster-management       addon-status-controller-7496df988b-47ggd                    0/1     CrashLoopBackOff   10 (4m17s ago)   30m

Getting the log of that would point to the problem:

mspreitz@mjs13 ocm-status-addon % kubectl --context kind-hub logs -n open-cluster-management deployment/addon-status-controller   
Defaulted container "status-controller" out of: status-controller, create-crd (init)
Error: invalid argument "{{.Values.verbosity}}" for "-v, --v" flag: strconv.ParseUint: parsing "{{.Values.verbosity}}": invalid syntax
Usage:
  addon controller [flags]

Flags:
      --component-namespace string   Namespace of the component.
      --enable-leader-election       Enables the leader election for the controller
  -h, --help                         help for controller
      --kubeconfig string            Location of the master configuration file to run from.

Global Flags:
      --log-flush-frequency duration   Maximum number of seconds between log flushes (default 5s)
      --logging-format string          Sets the log format. Permitted formats: "text". (default "text")
  -v, --v Level                        number for the log level verbosity
      --vmodule pattern=N,...          comma-separated list of pattern=N settings for file-filtered logging (only works for text log format)

invalid argument "{{.Values.verbosity}}" for "-v, --v" flag: strconv.ParseUint: parsing "{{.Values.verbosity}}": invalid syntax

Dumping the YAML of the Deployment would show the problem even more directly:

mspreitz@mjs13 ocm-status-addon % kubectl --context kind-hub get deploy -n open-cluster-management addon-status-controller -o yaml
apiVersion: apps/v1
kind: Deployment
...
    spec:
      containers:
      - args:
        - controller
        - -v={{.Values.verbosity}}

@pdettori , @francostellari: the problem here is that this PR changes the source YAML for the controller to ONLY make sense as input to make chart, but there are other make targets that use the same source directly (without building and using the chart). make deploy, called from test/e2e/setup-ocm-and-addon.sh, is one example.

@francostellari
Copy link
Contributor Author

francostellari commented May 22, 2024

@MikeSpreitzer I guess we should change the make deploy to be a make chart + helm install --context...?
That would also have the additional benefit of doing a minimal testing of the chart.
Applying the YAML of the config via kubectl is not a good idea since one expects it to be designed for the helm chart not for kubectl.
Do you agree?

@MikeSpreitzer
Copy link
Contributor

@francostellari : I tend to agree with always using the chart. Note that there is already a make target named install-local-chart.

@francostellari
Copy link
Contributor Author

@MikeSpreitzer I fixed make deploy, the test should run ok now

Comment on lines 6 to 8
verbosity:
controller: 2
agent: 2
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably be transposed; at least the agent will have additional flags that chart users should be able to control (#60 exposes several).

@MikeSpreitzer MikeSpreitzer mentioned this pull request May 22, 2024
@MikeSpreitzer
Copy link
Contributor

Yes, make deploy now goes through the chart. However, there remain three other targets that use the source without going through the chart: install, uninstall, and undeploy.

@MikeSpreitzer
Copy link
Contributor

Also, I see the following in a make recipe but I do not see anything that undoes the local file mod.

	cd config/manager && $(KUSTOMIZE) edit set image controller=$(shell echo ${IMG} | sed 's/\(:.*\)v/\1/')

@francostellari
Copy link
Contributor Author

Yes, make deploy now goes through the chart. However, there remain three other targets that use the source without going through the chart: install, uninstall, and undeploy.

I feel that this is behind the scope of this PR

@francostellari
Copy link
Contributor Author

Also, I see the following in a make recipe but I do not see anything that undoes the local file mod.

	cd config/manager && $(KUSTOMIZE) edit set image controller=$(shell echo ${IMG} | sed 's/\(:.*\)v/\1/')

I feel that this is behind the scope of this PR

Signed-off-by: francostellari <[email protected]>
Signed-off-by: francostellari <[email protected]>
Signed-off-by: francostellari <[email protected]>

Update verbosity

Signed-off-by: francostellari <[email protected]>
Signed-off-by: francostellari <[email protected]>
Signed-off-by: francostellari <[email protected]>
@MikeSpreitzer
Copy link
Contributor

Yes, this is good enough to merge. Open issues can be addressed in later PRs.

@MikeSpreitzer MikeSpreitzer merged commit b97e0af into kubestellar:main May 23, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants