File size: 4,417 Bytes
4aa5fce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
[10:40] <bthomas> Chipaca: Do you know if the environment variable for "is_doomed" is set in the operator pod or the application pod ? I did a kubectl exec to compare difference in operator pod environment variables before and during tear down of a model, but do not see any change.
[10:41] <Chipaca> bthomas: I expect it only to be set in the hook run itself, so you'd need to use debug-hook (or debug-code)
[10:41] <bthomas> thank you
[10:41] <Chipaca> bthomas: that should work in k8s on 2.9
[10:42] <bthomas> got it
[10:43] <Chipaca> bthomas: or, you could always logger.debug(sorted((k, v) for (k, v) in os.environ.items() if 'juju' in k.lower()))
[10:43] <bthomas> yes indeed. thank you
[10:43] <Chipaca> bthomas: or just logger.debug(sorted(os.environ.items()))))))))))) :-p
[10:43] <bthomas> :-)))))))))))
[10:47]  * Chipaca goes back to reviewing stuff
[10:59] <facubatista> ¡Muy buenos días a todos!
[11:01] <Chipaca> facubatista: 👋❗
[11:02] <facubatista> hola Chipaca :)
[11:02] <bthomas> hola facubatista
[11:02] <facubatista> hola bthomas :)
[12:26] <JoseMasson> Buongiorno!
[12:31] <bthomas> Morning JoseMasson
[12:31] <bthomas> Google translate says "Buongiorno" is Italian for "Good Morning"
[12:40] <bthomas> Chipaca: Uptil now what I can figure out is when "JUJU_HOOK_NAME" is "remove" the unit will die. I will dig a bit more.
[12:41] <bthomas> However the "remove" hook does not seem to get executed when the model itself is destroyed. So needs a bit more digging.
[12:49] <JoseMasson> bthomas: Yes, today I woke up with my Italian roots very active :P
[13:19]  * bthomas -> lunch
[13:24] <JoseMasson> I am writing a MySQL charm, and need to setup the MYSQL_ROOT_PASSWORD. What would be a good practice for setting this password without harcoding it in the charm?
[13:25] <JoseMasson> It is possible to send it as a parameter to "juju deploy ...." ?
[13:35]  * bthomas -> back
[16:49] <Chipaca> bthomas: https://github.com/juju/juju/blob/develop/tests/suites/relations/charms/departer/hooks/self-relation-departed FWIW
[16:51] <bthomas> Chipaca: ack. I need to figure out why I am not see this in logs
[16:54] <bthomas> I wonder if it could be I need TRACE level logging and not just debug
[17:32] <Chipaca> bthomas: why would that change what you have in the environ?
[17:33] <bthomas> Chipaca: Is it possible the env variable is only transitently set . I need to dig further why I did not see it in my logs with a simple test charm (busybox).
[17:33] <Chipaca> bthomas: … transiently how?
[17:34] <bthomas> Chipaca: I was thinking "unset" but I will admit that is being paranoid :-)
[17:35] <Chipaca> bthomas: env vars don't work that way tho, there is really no way to unset a variable from 'outside' a process
[17:36] <bthomas> Chipaca: the same process that set the variable in the first place can unset it. Anyway I do not think this is the issue. I was just speculating.
[17:37] <Chipaca> bthomas: if process A sets an env var and spawns process B, and then unsets the env var, that unsetting does not affect process B
[17:39] <bthomas> Chipaca: true. But process B here is a single execution (event handler) of the charm. I have did not see the var in on_install on_start on_stop on_config_changed on_update_status . If process A is not setting the var for any of these particular handlers then I will not see. A may have set it for some other handler and then unset it.
[17:40] <Chipaca> bthomas: and relation-departed?
[17:40] <bthomas> Chipaca: Ah good point. I will add a relation-departed and test again.
[17:44] <Chipaca> bthomas: maybe log from __init__, and not a specific handler?
[17:44] <bthomas> Chipaca: I have logger.debug(str(sorted(os.environ.items()))) in all the above handlers and __init__ also
[17:47] <bthomas> Chipaca: May I schedule a short 1:1 for tomorrow around 11am ?
[17:47] <Chipaca> bthomas: sure
[17:52] <Chipaca> bthomas: we can do it earlier also probably, i'll ping you on mattermost if i have a gap
[17:53] <Chipaca> i expect the car thing is going to be a bunch of sitting around waiting for people, but might be pleasently surprised
[17:53] <bthomas> Chipaca: I tried to give you time in case your care woes over runs. But yeah ping me any time.
[18:20]  * Chipaca wanders off to make pascualina
[18:22] <bthomas> Oooh that spinach stuffing looks reeeeally good, reminds me of spinach stromboli
[18:23]  * bthomas EODs but am around for a bit