=== gschanuel6 is now known as gschanuel [17:37] falcojr: I think I've finally addressed all the complexities of the user/groups schema. Too many options please recheck docs I rewrote for typo/grammar misses etc. [17:52] blackboxsw: side-equestion - do the schemas in general take into account a requirement for some values to be quoted (so they *are* treated as strings, not numbers)? [17:52] thinking of values like dates where (from memory) they are treated as numeric equations (i.e. "-" as minus) unless quoted [18:02] minimal: the JSON schema looks at the YAML type as it is interpreted. For dates specifically, we'd have to declare something like {"type": "string" "format": "date"} for our schema to allow without error. Ultimately when YAML loads the date, it can accept things like `date: 2022-04-15` and yaml.safe_load turns it into the python dict `{"date": datetime.date(2032, 4, 15)}` [18:03] it may have been an older version of YAML that bungled the date formatted strings [18:04] but to answer your underlying question, JSON schema validation is on the content which has been interpreted by YAML during load I believe [18:07] blackboxsw: I'm thinking back to a MR I had merged maybe 12-18 months ago to fix some of the user-data examples including things like expiry date as they didn't work without quotes - so you think the quotes are no longer needed? [18:10] ah, here's the MR I'm thinking of: https://github.com/canonical/cloud-init/pull/618 [18:10] Pull 618 in canonical/cloud-init "Correct documentation and testcase data for some user-data YAML" [Merged] [18:10] minimal: and examples that have landed on every cloudinit/config/cc_* module are automatically run through validation by CI in our unittests per https://github.com/canonical/cloud-init/blob/main/tests/unittests/config/test_schema.py#L401 [18:15] minimal: ahh right, so I just made the schema in this case specifically require a type: string https://github.com/canonical/cloud-init/pull/1379/files#diff-c18cfd88ec0bd5f1077576fee00a0b2e87cf0b30aa547ad1eaacfd5742e4a757R27 [18:15] Pull 1379 in canonical/cloud-init "Schema users" [Open] [18:15] but hrm, maybe worth properly supporting a date type. Reviews comments welcome on my open PR here. [18:16] minimal: though I might want to pull in that functionality in a separate PR as this one has gotten a lot bigger than I'd hoped [18:16] blackboxsw: no issue with it defining string, was just wanting to clarify if single quotes are therefore still needed in the YAML for it to be treated as a string [18:16] so at the moment, schema will tell you you have to have a string [18:18] I guess my question is regarding implicit versus explicit strings in YAML [18:19] as I thought the underlying problem was the Python YAML lib used could misinterpret implicit strings like dates [18:21] minimal: I think that's just a yaml problem more broadly [18:22] in other words will "expiredate: 2022-04-16" pass both the schema validation and be treated by the code as a date, or will it pass the schema validation but be treated by the code as a number, in which case the schema needs to enforce "expiredate: '2022-04-16'" instead [18:23] minimal: sorry just dropped the laptop trying to paste that example. Schema will warn about non string I. That case [18:24] blackboxsw: warn about non-string? or non-explicit-string? [18:24] minimal https://paste.ubuntu.com/p/WgscmSjkxg/ [18:25] yet quoted `expiredate: "2024-10-04" ` will pass without warnings [18:26] for that paste, is login for a Launchpad acct? [18:26] bah [18:26] pasting elsewhere [18:27] minimal: 2nd try https://paste.opendev.org/show/bgROMPxKtqtahai5C6w0/ === holman is now known as holmanb [18:28] ok, that seems to answer my question. Thanks [18:29] I do wonder if JSON schema can handle date discrete date types anyway, but as falcojr mentioned it's probably a JSON schema/YAML general prob to sort. [18:29] I forsee that I'll spend some googling time today :) [18:30] started in on ephemeraldhcp for v6 and one bugfix led to another and I guess I just refactored the networking code a bit: https://github.com/canonical/cloud-init/pull/1383 [18:30] Pull 1383 in canonical/cloud-init "Network functions refactor and bugfixes" [Open] [18:30] yeah YAML is a mess with its "magic detection" of types - remember the issue I'd raised again 18months or so ago about MAC address treatment lol [18:30] heh true. I had forgotten about that. [18:30] -> relocating for lunch [18:31] nice fast work holmanb [18:31] blackboxsw: if you ever doing any future work on expiredate (and/or "inactive"), there's no testing in place for those (validating the numbers put into /etc/shadow fields) and I've never found the time to have a go at it myself [18:32] @blackboxsw: don't get too excited, that's only bugfixes + refactorization ;) - no ephemeral work in that [18:37] blackboxsw: I was just like "alright let's make is_ipv6_addr not so awful real quick", and after fixing it suddenly 125 tests were failing :/ [19:53] Thanks falcojr https://github.com/canonical/cloud-init/pull/1379 landed. [19:53] Pull 1379 in canonical/cloud-init "Schema users" [Merged] [19:53] nice! [19:53] knocked out a number of JIRA tickets with that given the 'enum' doc handling and 'hidden' key thank! [19:53] thank you for the correct assessment of that schema crud in review [19:56] falcojr: one minor PR for migrating legacy schema coming [19:56] $ fgrep -r "schema =" cloudinit/config/cc_* [19:56] cloudinit/config/cc_ntp.py:schema = { [20:01] @falcojr: Thanks for the review, just landed https://github.com/canonical/cloud-init/pull/1383 (tests passed after the spelling nit commit) [20:47] minor followup to migrate ntp legacy schema https://github.com/canonical/cloud-init/pull/1384 [20:48] Pull 1384 in canonical/cloud-init "cc_ntp: migrated legacy schema to cloud-init-schema.json" [Open] [20:48] ok hitting James' review now. [21:47] falcojr: cc_* meta looks good I think minimally we want to filter docs out of `cloud-init devel schema --docs all` for those modules without JSON schema. [21:47] otherwise big +1 on cleanup\ [21:47] TIL 'cloud-init devel schema --docs all' :D [21:48] never realized you could get doc info on the cli [21:48] :) [21:48] yeah developer docs [21:48] yeah it's been my saving grace while going through and reviewing and schema changes [21:48] much faster than iterating through `tox -e doc` [21:48] and visually comparing [21:48] so I DIDN'T need to 'tox -e doc' a million times this whole time? [21:49] ;) [21:49] ha! well next time we rewrite the whole schema we can use it :) [21:49] heh, just give it a couple more years [21:49] #toosoon [22:00] if we throw half of it away first it won't take so long on the rewrite :) [22:07] getting to EOW holmanb but minor thought on ssh-import-id https://github.com/canonical/cloud-init/pull/1334/files [22:07] Pull 1334 in canonical/cloud-init "declare dependency on ssh-import-id (SC-864)" [Open] [22:09] @blackboxsw: looking now [22:10] sorry might want to refresh on latest comment [22:10] +1: I assumed that's what you meant [22:14] oh last comment, not updated suggested change, I see now [22:16] ahh sorry will redact my suggested change in that first comment. as I think the latter is more appropriate given multiple entrypoints to ssh-import-id [22:18] blackboxsw: np at all - at the rate that my own EOW is approaching, however, I think this is going to have to wait until monday to implement the second comment [22:19] holmanb: totally get that. I'm about turning the lights off over her [22:19] *here [22:20] hey CloudCIX is going to look at implementing EphermealDHCP4 support for local timeframe IMDS detection... so that'll be good. that PR will likely idle to stale while they do that. [22:21] I saw that, sounds good to me [22:22] making some progress on EphemeralDHCP6 today, I grok it quite a bit more at least [22:22] *made [22:31] awesome, that'll help a few folks trying to spin up systems ipv6/dhcp6 only envs. [22:34] for that ds-identify branch detected NoCloud in `/etc/cloud/cloud.cfg(.d/*)` I've got to run it through the paces with live-server installer ephemeral environment and make sure we don't get into a pickle with current implementation [22:34] so, probably won't finish that review today