Skip to content

Commit

Permalink
docs: kubernetes watches & custom kube configs
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Aug 1, 2024
1 parent f66b264 commit 7ef6bd1
Show file tree
Hide file tree
Showing 2 changed files with 278 additions and 78 deletions.
103 changes: 55 additions & 48 deletions common/src/components/Scraper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,86 +8,93 @@ import Fields from './Fields'

const customScraperFields = [
{
"field": "id",
"description": "A deterministic or natural id for the resource",
"scheme": "JSONPathOrString",
"required": true
field: 'id',
description: 'A deterministic or natural id for the resource',
scheme: 'JSONPathOrString',
required: true
},
{
"field": "name",
default: "`id`",
"scheme": "JSONPathOrString"
field: 'name',
default: '`id`',
scheme: 'JSONPathOrString'
},
{
"field": "items",
"description": "Extract multiple config items from this array",
"scheme": "JSONPath"
field: 'items',
description: 'Extract multiple config items from this array',
scheme: 'JSONPath'
},
{
"field": "type",
"description": "e.g. `File::Host`, `File::Tomcat`, `File::Pom`",
"scheme": "JSONPathOrString",
"required": "true"
field: 'type',
description: 'e.g. `File::Host`, `File::Tomcat`, `File::Pom`',
scheme: 'JSONPathOrString',
required: 'true'
},
{
"field": "class",
"scheme": "JSONPathOrString"
field: 'class',
scheme: 'JSONPathOrString'
},
{
"field": "format",
"description": "Format of config item e.g. `xml`, `properties`",
"default": "`JSON`",
"scheme": "string"
field: 'format',
description: 'Format of config item e.g. `xml`, `properties`',
default: '`JSON`',
scheme: 'string'
},
{
"field": "timestampFormat",
"description": "Format to parse timestamps in `createFields` and `deletedFields`",
"default": "RFC3339",
"scheme": "Go time format"
field: 'timestampFormat',
description:
'Format to parse timestamps in `createFields` and `deletedFields`',
default: 'RFC3339',
scheme: 'Go time format'
},
{
"field": "createFields",
"description": "Identify the created time for a resource (if different to scrape time). If multiple fields are specified, the first non-empty value will be used",
"scheme": "[]JSONPathOrString"
field: 'createFields',
description:
'Identify the created time for a resource (if different to scrape time). If multiple fields are specified, the first non-empty value will be used',
scheme: '[]JSONPathOrString'
},
{
"field": "deleteFields",
"description": "Identify when a config item was deleted. If multiple fields are specified, the first non-empty value will be used",
"scheme": "[]JSONPathOrString"
},
field: 'deleteFields',
description:
'Identify when a config item was deleted. If multiple fields are specified, the first non-empty value will be used',
scheme: '[]JSONPathOrString'
}
]

const commonsRows = [

{
"field": "ignore",
"description": "Fields to ignore and strip out of the config",
"scheme": "[]JSONPath"
field: 'transform',
description: "Transform configs after they've been scraped",
scheme: '[`Transform`](/config-db/concepts/transform)'
},
{
"field": "properties",
"description": "Custom templatable properties for the scraped config items.",
"scheme": "[`[]ConfigProperty`](/reference/config-db/properties)"
field: 'properties',
description: 'Custom templatable properties for the scraped config items.',
scheme: '[`[]ConfigProperty`](/reference/config-db/properties)'
},
{
"field": "tags",
"description": "Additional tags ",
"scheme": "map[string]string"
field: 'labels',
description: 'Labels for each config item.',
scheme: '`map[string]string`'
},
{
field: 'tags',
description: 'Tags for each config item. Max allowed: 5',
scheme: '[`[]ConfigTag`](/config-db/concepts/tags)'
}
]

export function Scraper({ name, edition, rows, ...props }) {

const { siteConfig } = useDocusaurusContext()


return <Fields rows={rows} common={commonsRows} {...props} />

}

export function CustomScraper({ name, edition, rows, ...props }) {

const { siteConfig } = useDocusaurusContext()
return <Fields rows={rows} common={commonsRows.concat(customScraperFields)} {...props} />

return (
<Fields
rows={rows}
common={commonsRows.concat(customScraperFields)}
{...props}
/>
)
}
Loading

0 comments on commit 7ef6bd1

Please sign in to comment.