Skip to content

Commit

Permalink
update schemas + add redactor and supportbundle schemas (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh committed Jun 23, 2020
1 parent 086f858 commit f55b9b6
Show file tree
Hide file tree
Showing 11 changed files with 4,190 additions and 87 deletions.
16 changes: 16 additions & 0 deletions cmd/schemagen/cli/root.go
Expand Up @@ -86,6 +86,22 @@ func generateSchemas(v *viper.Viper) error {
return errors.Wrap(err, "failed to write collectors schema")
}

redactorsContents, err := ioutil.ReadFile(filepath.Join(workdir, "config", "crds", "troubleshoot.replicated.com_redactors.yaml"))
if err != nil {
return errors.Wrap(err, "failed to read redactors crd")
}
if err := generateSchemaFromCRD(redactorsContents, filepath.Join(workdir, v.GetString("output-dir"), "redactor-troubleshoot-v1beta1.json")); err != nil {
return errors.Wrap(err, "failed to write redactors schema")
}

supportBundlesContents, err := ioutil.ReadFile(filepath.Join(workdir, "config", "crds", "troubleshoot.replicated.com_supportbundles.yaml"))
if err != nil {
return errors.Wrap(err, "failed to read supportbundles crd")
}
if err := generateSchemaFromCRD(supportBundlesContents, filepath.Join(workdir, v.GetString("output-dir"), "supportbundle-troubleshoot-v1beta1.json")); err != nil {
return errors.Wrap(err, "failed to write supportbundles schema")
}

return nil
}

Expand Down
239 changes: 226 additions & 13 deletions config/crds/troubleshoot.replicated.com_analyzers.yaml
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
controller-gen.kubebuilder.io/version: v0.2.8
creationTimestamp: null
name: analyzers.troubleshoot.replicated.com
spec:
Expand Down Expand Up @@ -42,7 +42,12 @@ spec:
checkName:
type: string
exclude:
type: boolean
description: BoolOrString is a type that can hold an bool
or a string. When used in JSON or YAML marshalling and
unmarshalling, it produces or consumes the inner type. This
allows you to have, for example, a JSON field that can accept
a booolean string or raw bool.
type: BoolString
outcomes:
items:
properties:
Expand Down Expand Up @@ -83,7 +88,12 @@ spec:
checkName:
type: string
exclude:
type: boolean
description: BoolOrString is a type that can hold an bool
or a string. When used in JSON or YAML marshalling and
unmarshalling, it produces or consumes the inner type. This
allows you to have, for example, a JSON field that can accept
a booolean string or raw bool.
type: BoolString
outcomes:
items:
properties:
Expand Down Expand Up @@ -126,7 +136,12 @@ spec:
customResourceDefinitionName:
type: string
exclude:
type: boolean
description: BoolOrString is a type that can hold an bool
or a string. When used in JSON or YAML marshalling and
unmarshalling, it produces or consumes the inner type. This
allows you to have, for example, a JSON field that can accept
a booolean string or raw bool.
type: BoolString
outcomes:
items:
properties:
Expand Down Expand Up @@ -168,7 +183,12 @@ spec:
checkName:
type: string
exclude:
type: boolean
description: BoolOrString is a type that can hold an bool
or a string. When used in JSON or YAML marshalling and
unmarshalling, it produces or consumes the inner type. This
allows you to have, for example, a JSON field that can accept
a booolean string or raw bool.
type: BoolString
name:
type: string
namespace:
Expand Down Expand Up @@ -215,7 +235,12 @@ spec:
checkName:
type: string
exclude:
type: boolean
description: BoolOrString is a type that can hold an bool
or a string. When used in JSON or YAML marshalling and
unmarshalling, it produces or consumes the inner type. This
allows you to have, for example, a JSON field that can accept
a booolean string or raw bool.
type: BoolString
outcomes:
items:
properties:
Expand Down Expand Up @@ -256,7 +281,12 @@ spec:
checkName:
type: string
exclude:
type: boolean
description: BoolOrString is a type that can hold an bool
or a string. When used in JSON or YAML marshalling and
unmarshalling, it produces or consumes the inner type. This
allows you to have, for example, a JSON field that can accept
a booolean string or raw bool.
type: BoolString
outcomes:
items:
properties:
Expand Down Expand Up @@ -300,7 +330,12 @@ spec:
checkName:
type: string
exclude:
type: boolean
description: BoolOrString is a type that can hold an bool
or a string. When used in JSON or YAML marshalling and
unmarshalling, it produces or consumes the inner type. This
allows you to have, for example, a JSON field that can accept
a booolean string or raw bool.
type: BoolString
ingressName:
type: string
namespace:
Expand Down Expand Up @@ -342,12 +377,68 @@ spec:
- namespace
- outcomes
type: object
mysql:
properties:
checkName:
type: string
collectorName:
type: string
exclude:
description: BoolOrString is a type that can hold an bool
or a string. When used in JSON or YAML marshalling and
unmarshalling, it produces or consumes the inner type. This
allows you to have, for example, a JSON field that can accept
a booolean string or raw bool.
type: BoolString
fileName:
type: string
outcomes:
items:
properties:
fail:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
pass:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
warn:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
type: object
type: array
required:
- collectorName
- outcomes
type: object
nodeResources:
properties:
checkName:
type: string
exclude:
type: boolean
description: BoolOrString is a type that can hold an bool
or a string. When used in JSON or YAML marshalling and
unmarshalling, it produces or consumes the inner type. This
allows you to have, for example, a JSON field that can accept
a booolean string or raw bool.
type: BoolString
filters:
properties:
cpuAllocatable:
Expand Down Expand Up @@ -402,12 +493,119 @@ spec:
required:
- outcomes
type: object
postgres:
properties:
checkName:
type: string
collectorName:
type: string
exclude:
description: BoolOrString is a type that can hold an bool
or a string. When used in JSON or YAML marshalling and
unmarshalling, it produces or consumes the inner type. This
allows you to have, for example, a JSON field that can accept
a booolean string or raw bool.
type: BoolString
fileName:
type: string
outcomes:
items:
properties:
fail:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
pass:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
warn:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
type: object
type: array
required:
- collectorName
- outcomes
type: object
redis:
properties:
checkName:
type: string
collectorName:
type: string
exclude:
description: BoolOrString is a type that can hold an bool
or a string. When used in JSON or YAML marshalling and
unmarshalling, it produces or consumes the inner type. This
allows you to have, for example, a JSON field that can accept
a booolean string or raw bool.
type: BoolString
fileName:
type: string
outcomes:
items:
properties:
fail:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
pass:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
warn:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
type: object
type: array
required:
- collectorName
- outcomes
type: object
secret:
properties:
checkName:
type: string
exclude:
type: boolean
description: BoolOrString is a type that can hold an bool
or a string. When used in JSON or YAML marshalling and
unmarshalling, it produces or consumes the inner type. This
allows you to have, for example, a JSON field that can accept
a booolean string or raw bool.
type: BoolString
key:
type: string
namespace:
Expand Down Expand Up @@ -456,7 +654,12 @@ spec:
checkName:
type: string
exclude:
type: boolean
description: BoolOrString is a type that can hold an bool
or a string. When used in JSON or YAML marshalling and
unmarshalling, it produces or consumes the inner type. This
allows you to have, for example, a JSON field that can accept
a booolean string or raw bool.
type: BoolString
name:
type: string
namespace:
Expand Down Expand Up @@ -503,7 +706,12 @@ spec:
checkName:
type: string
exclude:
type: boolean
description: BoolOrString is a type that can hold an bool
or a string. When used in JSON or YAML marshalling and
unmarshalling, it produces or consumes the inner type. This
allows you to have, for example, a JSON field that can accept
a booolean string or raw bool.
type: BoolString
outcomes:
items:
properties:
Expand Down Expand Up @@ -549,7 +757,12 @@ spec:
collectorName:
type: string
exclude:
type: boolean
description: BoolOrString is a type that can hold an bool
or a string. When used in JSON or YAML marshalling and
unmarshalling, it produces or consumes the inner type. This
allows you to have, for example, a JSON field that can accept
a booolean string or raw bool.
type: BoolString
fileName:
type: string
outcomes:
Expand Down

0 comments on commit f55b9b6

Please sign in to comment.