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

generate module options docs #1

Closed
hall opened this issue Aug 26, 2022 · 3 comments · Fixed by #4
Closed

generate module options docs #1

hall opened this issue Aug 26, 2022 · 3 comments · Fixed by #4
Assignees
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@hall
Copy link
Owner

hall commented Aug 26, 2022

Would be nice to create a static site that lists module options.

I've got some WIP stuff on the linked branch (see sidebar) but there's currently a possible infinite recursion error that causes a segfault when evaluating the generated Kubernetes modules (e.g., ./modules/generated/v1.24.nix).

Preview of the current state, only generating options for the docker module:
image

@hall
Copy link
Owner Author

hall commented Aug 26, 2022

Also had to apply this diff for the eval to succeed:

diff --git a/modules/docker.nix b/modules/docker.nix
index c033dff..713db70 100644
--- a/modules/docker.nix
+++ b/modules/docker.nix
@@ -34,13 +34,13 @@ in {
           name = mkOption {
             description = "Desired docker image name";
             type = types.str;
-            default = builtins.unsafeDiscardStringContext config.image.imageName;
+            default = "";
           };
 
           tag = mkOption {
             description = "Desired docker image tag";
             type = types.str;
-            default = builtins.unsafeDiscardStringContext config.image.imageTag;
+            default = "";
           };
 
           registry = mkOption {

Presumably, we need to pull in some upstream config as those values don't appear to be defined in this repo.

@hall hall added the help wanted Extra attention is needed label Aug 26, 2022
@hall hall self-assigned this Aug 26, 2022
@hall hall added the documentation Improvements or additions to documentation label Aug 26, 2022
@hall
Copy link
Owner Author

hall commented Aug 27, 2022

Alright, getting late but I've narrowed the k8s module evaluation build failure to the CRD type and was able to successfully build with the following workaround:

diff --git a/modules/generated/v1.24.nix b/modules/generated/v1.24.nix
index 5bb237c..78b80da 100644
--- a/modules/generated/v1.24.nix
+++ b/modules/generated/v1.24.nix
@@ -17270,7 +17270,8 @@ in
       };
       "apiextensions.k8s.io"."v1"."CustomResourceDefinition" = mkOption {
         description = "CustomResourceDefinition represents a resource that should be exposed on the API server.  Its name MUST be in the format <.spec.name>.<.spec.group>.";
-        type = (types.attrsOf (submoduleForDefinition "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinition" "customresourcedefinitions" "CustomResourceDefinition" "apiextensions.k8s.io" "v1"));
+        type = types.attrs;
         default = { };
       };
       "apiregistration.k8s.io"."v1"."APIService" = mkOption {
@@ -17335,11 +17336,11 @@ in
         type = (types.attrsOf (submoduleForDefinition "io.k8s.api.batch.v1.CronJob" "cronjobs" "CronJob" "batch" "v1"));
         default = { };
       };
       "customResourceDefinitions" = mkOption {
         description = "CustomResourceDefinition represents a resource that should be exposed on the API server.  Its name MUST be in the format <.spec.name>.<.spec.group>.";
-        type = (types.attrsOf (submoduleForDefinition "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinition" "customresourcedefinitions" "CustomResourceDefinition" "apiextensions.k8s.io" "v1"));
+        type = types.attrs;
         default = { };
       };
       "daemonSets" = mkOption {
         description = "DaemonSet represents the configuration of a daemon set.";
         type = (types.attrsOf (submoduleForDefinition "io.k8s.api.apps.v1.DaemonSet" "daemonsets" "DaemonSet" "apps" "v1"));

@hall
Copy link
Owner Author

hall commented Aug 28, 2022

CRD type evaluation fixed (see #2). Last piece left is to undo that diff in the docker module above.

@hall hall linked a pull request Aug 28, 2022 that will close this issue
@hall hall closed this as completed in #4 Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant