generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 52
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
docs: add JobSet API reference #611
Merged
k8s-ci-robot
merged 2 commits into
kubernetes-sigs:main
from
googs1025:add_api_reference
Jul 3, 2024
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
hiddenMemberFields: | ||
- "TypeMeta" | ||
- "ObjectMeta" | ||
|
||
apis: | ||
- name: jobset | ||
title: JobSet API | ||
package: sigs.k8s.io/jobset | ||
path: api/jobset/v1alpha2 | ||
|
||
externalPackages: | ||
- match: ^k8s\.io/(api|apimachinery/pkg/apis)/ | ||
target: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#{{- lower .TypeIdentifier -}}-{{- arrIndex .PackageSegments -1 -}}-{{- arrIndex .PackageSegments -2 -}} | ||
- match: ^k8s\.io/apimachinery/pkg/api/resource\.Quantity$ | ||
target: https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Quantity | ||
- match: ^k8s.io/component-base/config/v1alpha1. | ||
target: https://pkg.go.dev/k8s.io/component-base/config/v1alpha1#{{- .TypeIdentifier -}} | ||
- match: ^time\.Duration$ | ||
target: https://pkg.go.dev/time#Duration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{{ define "members" }} | ||
googs1025 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{{/* . is a apiType */}} | ||
{{- range .GetMembers -}} | ||
{{/* . is a apiMember */}} | ||
{{- if not .Hidden }} | ||
<tr><td><code>{{ .FieldName }}</code> | ||
{{- if not .IsOptional }} <B>[Required]</B>{{- end -}} | ||
<br/> | ||
{{/* Link for type reference */}} | ||
{{- with .GetType -}} | ||
{{- if .Link -}} | ||
<a href="{{ .Link }}"><code>{{ .DisplayName }}</code></a> | ||
{{- else -}} | ||
<code>{{ .DisplayName }}</code> | ||
{{- end -}} | ||
{{- end }} | ||
</td> | ||
<td> | ||
{{- if .IsInline -}} | ||
(Members of <code>{{ .FieldName }}</code> are embedded into this type.) | ||
{{- end }} | ||
{{ if .GetComment -}} | ||
{{ .GetComment }} | ||
{{- else -}} | ||
<span class="text-muted">No description provided.</span> | ||
{{- end }} | ||
{{- if and (eq (.GetType.Name.Name) "ObjectMeta") -}} | ||
Refer to the Kubernetes API documentation for the fields of the <code>metadata</code> field. | ||
{{- end -}} | ||
</td> | ||
</tr> | ||
{{- end }} | ||
{{- end }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{{ define "packages" -}} | ||
|
||
{{- range $idx, $val := .packages -}} | ||
{{/* Special handling for config */}} | ||
{{- if .IsMain -}} | ||
--- | ||
title: {{ .Title }} | ||
content_type: tool-reference | ||
package: {{ .DisplayName }} | ||
auto_generated: true | ||
description: Generated API reference documentation for {{ .DisplayName }}. | ||
--- | ||
{{ .GetComment -}} | ||
{{- end -}} | ||
{{- end }} | ||
|
||
## Resource Types | ||
|
||
{{ range .packages -}} | ||
{{ $isConfig := (eq .GroupName "") }} | ||
{{- range .VisibleTypes -}} | ||
{{- if or .IsExported (and $isConfig (eq .DisplayName "Configuration")) }} | ||
- [{{ .DisplayName }}]({{ .Link }}) | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{ range .packages }} | ||
{{ if ne .GroupName "" -}} | ||
{{/* For package with a group name, list all type definitions in it. */}} | ||
{{- range .VisibleTypes }} | ||
{{- if or .Referenced .IsExported -}} | ||
{{ template "type" . }} | ||
{{- end -}} | ||
{{ end }} | ||
{{ else }} | ||
{{/* For package w/o group name, list only types referenced. */}} | ||
{{ $isConfig := (eq .GroupName "") }} | ||
{{- range .VisibleTypes -}} | ||
{{- if or .Referenced $isConfig -}} | ||
{{ template "type" . }} | ||
{{- end -}} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{{ define "type" }} | ||
|
||
## `{{ .Name.Name }}` {#{{ .Anchor }}} | ||
|
||
{{ if eq .Kind "Alias" -}} | ||
(Alias of `{{ .Underlying }}`) | ||
{{ end }} | ||
|
||
{{- with .References }} | ||
**Appears in:** | ||
{{ range . }} | ||
{{ if or .Referenced .IsExported -}} | ||
- [{{ .DisplayName }}]({{ .Link }}) | ||
{{ end -}} | ||
{{- end -}} | ||
{{- end }} | ||
|
||
{{ if .GetComment -}} | ||
{{ .GetComment }} | ||
{{ end }} | ||
{{ if .GetMembers -}} | ||
<table class="table"> | ||
<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead> | ||
<tbody> | ||
{{/* . is a apiType */}} | ||
{{- if .IsExported -}} | ||
{{/* Add apiVersion and kind rows if deemed necessary */}} | ||
<tr><td><code>apiVersion</code><br/>string</td><td><code>{{- .APIGroup -}}</code></td></tr> | ||
<tr><td><code>kind</code><br/>string</td><td><code>{{- .Name.Name -}}</code></td></tr> | ||
{{ end -}} | ||
|
||
{{/* The actual list of members is in the following template */}} | ||
{{- template "members" . -}} | ||
</tbody> | ||
</table> | ||
{{- end -}} | ||
{{- end -}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment with a link to the documentation for this config file, so we can easily figure out how to update it later if we need to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i add this link,it allows users to query more configuration details