Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
340 changes: 340 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,346 @@
}
]
},
"BudgetAdjustment": {
"name": "v2alpha.BudgetAdjustment",
"properties": [
{
"path": "$",
"typeInfo": {
"name": "BudgetAdjustment",
"kind": "struct",
"package": "github.com/OpenSLO/go-sdk/pkg/openslo/v2alpha"
},
"childrenPaths": [
"$.apiVersion",
"$.kind",
"$.metadata",
"$.spec"
]
},
{
"path": "$.apiVersion",
"typeInfo": {
"name": "Version",
"kind": "string",
"package": "github.com/OpenSLO/go-sdk/pkg/openslo"
},
"values": [
"openslo.com/v2alpha"
],
"rules": [
{
"description": "property is required",
"errorCode": "required"
},
{
"description": "must be equal to 'openslo.com/v2alpha'",
"errorCode": "equal_to"
}
],
"typeDoc": "Version represents a version of the OpenSLO specification."
},
{
"path": "$.kind",
"typeInfo": {
"name": "Kind",
"kind": "string",
"package": "github.com/OpenSLO/go-sdk/pkg/openslo"
},
"values": [
"BudgetAdjustment"
],
"rules": [
{
"description": "property is required",
"errorCode": "required"
},
{
"description": "must be equal to 'BudgetAdjustment'",
"errorCode": "equal_to"
}
],
"typeDoc": "Kind represents all the object kinds defined by OpenSLO specification. Keep in mind not all specification versions support every [Kind](https://pkg.go.dev/github.com/OpenSLO/go-sdk/pkg/openslo#Kind)."
},
{
"path": "$.metadata",
"typeInfo": {
"name": "Metadata",
"kind": "struct",
"package": "github.com/OpenSLO/go-sdk/pkg/openslo/v2alpha"
},
"rules": [
{
"description": "property is required",
"errorCode": "required"
}
],
"childrenPaths": [
"$.metadata.name",
"$.metadata.labels",
"$.metadata.annotations"
]
},
{
"path": "$.metadata.name",
"typeInfo": {
"name": "string",
"kind": "string"
},
"rules": [
{
"description": "property is required",
"errorCode": "required"
},
{
"description": "length must be between 1 and 63",
"errorCode": "string_dns_label:string_length"
},
{
"description": "string must match regular expression: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'",
"details": "an RFC-1123 compliant label name must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character",
"errorCode": "string_dns_label:string_match_regexp",
"examples": [
"my-name",
"123-abc"
]
}
]
},
{
"path": "$.metadata.labels",
"typeInfo": {
"name": "Labels",
"kind": "map[string]string",
"package": "github.com/OpenSLO/go-sdk/pkg/openslo/v2alpha"
},
"childrenPaths": [
"$.metadata.labels.*~",
"$.metadata.labels.*"
]
},
{
"path": "$.metadata.labels.*~",
"typeInfo": {
"name": "string",
"kind": "string"
},
"rules": [
{
"description": "length must be between 1 and 317",
"errorCode": "string_kubernetes_qualified_name:string_length"
},
{
"description": "string must be a Kubernetes Qualified Name",
"details": "Kubernetes Qualified Name must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character with an optional DNS subdomain prefix and '/'",
"errorCode": "string_kubernetes_qualified_name",
"examples": [
"my.domain/MyName",
"MyName",
"my.name",
"123-abc"
]
}
]
},
{
"path": "$.metadata.labels.*",
"typeInfo": {
"name": "string",
"kind": "string"
},
"rules": [
{
"description": "string must match regular expression: '^([a-z0-9]([-._a-z0-9]{0,61}[a-z0-9])?)?$'",
"errorCode": "string_match_regexp",
"examples": [
"my-label",
"my.domain_123-label"
]
}
]
},
{
"path": "$.metadata.annotations",
"typeInfo": {
"name": "Annotations",
"kind": "map[string]string",
"package": "github.com/OpenSLO/go-sdk/pkg/openslo/v2alpha"
},
"childrenPaths": [
"$.metadata.annotations.*~",
"$.metadata.annotations.*"
]
},
{
"path": "$.metadata.annotations.*~",
"typeInfo": {
"name": "string",
"kind": "string"
},
"rules": [
{
"description": "length must be between 1 and 317",
"errorCode": "string_kubernetes_qualified_name:string_length"
},
{
"description": "string must be a Kubernetes Qualified Name",
"details": "Kubernetes Qualified Name must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character with an optional DNS subdomain prefix and '/'",
"errorCode": "string_kubernetes_qualified_name",
"examples": [
"my.domain/MyName",
"MyName",
"my.name",
"123-abc"
]
}
]
},
{
"path": "$.metadata.annotations.*",
"typeInfo": {
"name": "string",
"kind": "string"
}
},
{
"path": "$.spec",
"typeInfo": {
"name": "BudgetAdjustmentSpec",
"kind": "struct",
"package": "github.com/OpenSLO/go-sdk/pkg/openslo/v2alpha"
},
"childrenPaths": [
"$.spec.description",
"$.spec.service",
"$.spec.indicatorRef",
"$.spec.startTime",
"$.spec.endTime",
"$.spec.duration"
]
},
{
"path": "$.spec.description",
"typeInfo": {
"name": "string",
"kind": "string"
},
"rules": [
{
"description": "property is required",
"errorCode": "required"
},
{
"description": "length must be less than or equal to 1050",
"errorCode": "string_max_length"
}
]
},
{
"path": "$.spec.service",
"typeInfo": {
"name": "string",
"kind": "string"
},
"rules": [
{
"description": "property is required",
"errorCode": "required"
},
{
"description": "length must be between 1 and 63",
"errorCode": "string_dns_label:string_length"
},
{
"description": "string must match regular expression: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'",
"details": "an RFC-1123 compliant label name must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character",
"errorCode": "string_dns_label:string_match_regexp",
"examples": [
"my-name",
"123-abc"
]
}
]
},
{
"path": "$.spec.indicatorRef",
"typeInfo": {
"name": "string",
"kind": "string"
},
"rules": [
{
"description": "property is required",
"errorCode": "required"
},
{
"description": "length must be between 1 and 63",
"errorCode": "string_dns_label:string_length"
},
{
"description": "string must match regular expression: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'",
"details": "an RFC-1123 compliant label name must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character",
"errorCode": "string_dns_label:string_match_regexp",
"examples": [
"my-name",
"123-abc"
]
}
]
},
{
"path": "$.spec.startTime",
"typeInfo": {
"name": "string",
"kind": "string"
},
"rules": [
{
"description": "property is required",
"errorCode": "required"
},
{
"description": "string must be a valid date and time in '2006-01-02T15:04:05Z07:00' format",
"details": "date and time format follows Go's time layout, see https://pkg.go.dev/time#Layout for more details",
"errorCode": "string_date_time"
}
]
},
{
"path": "$.spec.endTime",
"typeInfo": {
"name": "string",
"kind": "string"
},
"rules": [
{
"description": "property is optional",
"errorCode": "optional"
},
{
"description": "string must be a valid date and time in '2006-01-02T15:04:05Z07:00' format",
"details": "date and time format follows Go's time layout, see https://pkg.go.dev/time#Layout for more details",
"errorCode": "string_date_time"
}
]
},
{
"path": "$.spec.duration",
"typeInfo": {
"name": "DurationShorthand",
"kind": "struct",
"package": "github.com/OpenSLO/go-sdk/pkg/openslo/v2alpha"
},
"rules": [
{
"description": "property is optional",
"errorCode": "optional"
}
],
"typeDoc": "DurationShorthand is a shorthand representation of time duration. It consists of a value and unit, e.g. '1m' (1 minute), '10d' (10 days)."
}
]
},
"DataSource": {
"name": "v2alpha.DataSource",
"properties": [
Expand Down
4 changes: 2 additions & 2 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU=
golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -51,8 +52,6 @@ golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand All @@ -70,6 +69,7 @@ golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXct
golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0=
golang.org/x/telemetry v0.0.0-20250710130107-8d8967aff50b/go.mod h1:4ZwOYna0/zsOKwuR5X/m0QFOJpSZvAxFfkQT+Erd9D4=
golang.org/x/telemetry v0.0.0-20260708182218-49f421fb7959/go.mod h1:LV7u5Oco+Z/g6XI7PqN+EUUUGGkEcmB1uj2ceI0fOVg=
golang.org/x/telemetry v0.0.0-20260811182544-a038080d80e5/go.mod h1:LVehoXe41cL5SCVQilsV7Gg6BNG+Js6P9PhSbYTIUkQ=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
Expand Down
1 change: 1 addition & 0 deletions internal/cmd/objectdoc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var allDocsGeneratorFuncs = []func() (govydoc.ObjectDoc, error){
},
func() (govydoc.ObjectDoc, error) { return govydoc.Generate(v2alpha.AlertPolicy{}.GetValidator()) },
func() (govydoc.ObjectDoc, error) { return govydoc.Generate(v2alpha.DataSource{}.GetValidator()) },
func() (govydoc.ObjectDoc, error) { return govydoc.Generate(v2alpha.BudgetAdjustment{}.GetValidator()) },
}

var (
Expand Down
4 changes: 3 additions & 1 deletion pkg/openslo/kind.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const (
KindAlertPolicy Kind = "AlertPolicy"
KindAlertCondition Kind = "AlertCondition"
KindAlertNotificationTarget Kind = "AlertNotificationTarget"
KindBudgetAdjustment Kind = "BudgetAdjustment"
)

func ParseKind(s string) (Kind, error) {
Expand All @@ -38,7 +39,8 @@ func (k Kind) Validate() error {
KindService,
KindAlertPolicy,
KindAlertCondition,
KindAlertNotificationTarget:
KindAlertNotificationTarget,
KindBudgetAdjustment:
return nil
default:
return fmt.Errorf("unsupported %[1]T: %[1]s", k)
Expand Down
Loading