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

redpanda: remove ImageRepository schema validation #1297

Merged
merged 1 commit into from
May 22, 2024
Merged
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
4 changes: 2 additions & 2 deletions charts/redpanda/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ type SecurityContext struct {
}

type Image struct {
Repository ImageRepository `json:"repository" jsonschema:"required,default=docker.redpanda.com/redpandadata/redpanda"`
Repository string `json:"repository" jsonschema:"required,default=docker.redpanda.com/redpandadata/redpanda"`
Tag ImageTag `json:"tag" jsonschema:"default=Chart.appVersion"`
PullPolicy string `json:"pullPolicy" jsonschema:"required,pattern=^(Always|Never|IfNotPresent)$,description=The Kubernetes Pod image pull policy."`
}
Expand Down Expand Up @@ -383,7 +383,7 @@ type Statefulset struct {
Controllers struct {
Image struct {
Tag ImageTag `json:"tag" jsonschema:"required,default=Chart.appVersion"`
Repository ImageRepository `json:"repository" jsonschema:"required,default=docker.redpanda.com/redpandadata/redpanda-operator"`
Repository string `json:"repository" jsonschema:"required,default=docker.redpanda.com/redpandadata/redpanda-operator"`
} `json:"image"`
Enabled bool `json:"enabled"`
Resources any `json:"resources"`
Expand Down
2 changes: 0 additions & 2 deletions charts/redpanda/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@
"repository": {
"default": "docker.redpanda.com/redpandadata/redpanda",
"description": "container image repository",
"pattern": "^[a-z0-9-_/.]+$",
"type": "string"
},
"tag": {
Expand Down Expand Up @@ -1590,7 +1589,6 @@
"properties": {
"repository": {
"default": "docker.redpanda.com/redpandadata/redpanda-operator",
"pattern": "^[a-z0-9-_/.]+$",
"type": "string"
},
"tag": {
Expand Down
10 changes: 5 additions & 5 deletions charts/redpanda/values_partial.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ type PartialSecurityContext struct {
}

type PartialImage struct {
Repository *ImageRepository `json:"repository,omitempty" jsonschema:"required,default=docker.redpanda.com/redpandadata/redpanda"`
Tag *ImageTag `json:"tag,omitempty" jsonschema:"default=Chart.appVersion"`
PullPolicy *string `json:"pullPolicy,omitempty" jsonschema:"required,pattern=^(Always|Never|IfNotPresent)$,description=The Kubernetes Pod image pull policy."`
Repository *string `json:"repository,omitempty" jsonschema:"required,default=docker.redpanda.com/redpandadata/redpanda"`
Tag *ImageTag `json:"tag,omitempty" jsonschema:"default=Chart.appVersion"`
PullPolicy *string `json:"pullPolicy,omitempty" jsonschema:"required,pattern=^(Always|Never|IfNotPresent)$,description=The Kubernetes Pod image pull policy."`
}

type PartialService struct {
Expand Down Expand Up @@ -271,8 +271,8 @@ type PartialStatefulset struct {
} `json:"configWatcher,omitempty"`
Controllers struct {
Image struct {
Tag *ImageTag `json:"tag,omitempty" jsonschema:"required,default=Chart.appVersion"`
Repository *ImageRepository `json:"repository,omitempty" jsonschema:"required,default=docker.redpanda.com/redpandadata/redpanda-operator"`
Tag *ImageTag `json:"tag,omitempty" jsonschema:"required,default=Chart.appVersion"`
Repository *string `json:"repository,omitempty" jsonschema:"required,default=docker.redpanda.com/redpandadata/redpanda-operator"`
} `json:"image,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Resources any `json:"resources,omitempty"`
Expand Down
6 changes: 0 additions & 6 deletions charts/redpanda/values_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ func (ImageTag) JSONSchemaExtend(schema *jsonschema.Schema) {
schema.Pattern = `^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$|^$`
}

type ImageRepository string

func (ImageRepository) JSONSchemaExtend(schema *jsonschema.Schema) {
schema.Pattern = "^[a-z0-9-_/.]+$"
}

type MemoryAmount string

func (MemoryAmount) JSONSchemaExtend(schema *jsonschema.Schema) {
Expand Down