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

Joshd/sc 99017/add embedded cluster config to vandoor linting #181

Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
{
"description": "Config is the Schema for the configs API",
"type": "object",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"description": "ConfigSpec defines the desired state of Config",
"type": "object",
"properties": {
"extensions": {
"type": "object",
"properties": {
"helm": {
"description": "HelmExtensions specifies settings for cluster helm based extensions",
"type": "object",
"properties": {
"charts": {
"description": "ChartsSettings charts settings",
"type": "array",
"items": {
"description": "Chart single helm addon",
"type": "object",
"properties": {
"chartname": {
"type": "string"
},
"name": {
"type": "string"
},
"namespace": {
"type": "string"
},
"order": {
"type": "integer"
},
"timeout": {
"description": "A Duration represents the elapsed time between two instants\nas an int64 nanosecond count. The representation limits the\nlargest representable duration to approximately 290 years.",
"type": "integer",
"format": "int64"
},
"values": {
"type": "string"
},
"version": {
"type": "string"
}
}
}
},
"concurrencyLevel": {
"type": "integer"
},
"repositories": {
"description": "RepositoriesSettings repository settings",
"type": "array",
"items": {
"description": "Repository describes single repository entry. Fields map to the CLI flags for the \"helm add\" command",
"type": "object",
"properties": {
"caFile": {
"type": "string"
},
"certFile": {
"type": "string"
},
"insecure": {
"type": "boolean"
},
"keyfile": {
"type": "string"
},
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"url": {
"type": "string"
},
"username": {
"type": "string"
}
}
}
}
}
}
}
},
"roles": {
"description": "Roles is the various roles in the cluster.",
"type": "object",
"properties": {
"controller": {
"description": "NodeRole is the role of a node in the cluster.",
"type": "object",
"properties": {
"description": {
"type": "string"
},
"labels": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"name": {
"type": "string"
},
"nodeCount": {
"description": "NodeCount holds a series of rules for a given node role.",
"type": "object",
"properties": {
"range": {
"description": "NodeRange contains a min and max or only one of them (conflicts\nwith Values).",
"type": "object",
"properties": {
"max": {
"description": "Max is the maximum number of nodes.",
"type": "integer"
},
"min": {
"description": "Min is the minimum number of nodes.",
"type": "integer"
}
}
},
"values": {
"description": "Values holds a list of allowed node counts.",
"type": "array",
"items": {
"type": "integer"
}
}
}
}
}
},
"custom": {
"type": "array",
"items": {
"description": "NodeRole is the role of a node in the cluster.",
"type": "object",
"properties": {
"description": {
"type": "string"
},
"labels": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"name": {
"type": "string"
},
"nodeCount": {
"description": "NodeCount holds a series of rules for a given node role.",
"type": "object",
"properties": {
"range": {
"description": "NodeRange contains a min and max or only one of them (conflicts\nwith Values).",
"type": "object",
"properties": {
"max": {
"description": "Max is the maximum number of nodes.",
"type": "integer"
},
"min": {
"description": "Min is the minimum number of nodes.",
"type": "integer"
}
}
},
"values": {
"description": "Values holds a list of allowed node counts.",
"type": "array",
"items": {
"type": "integer"
}
}
}
}
}
}
}
}
},
"unsupportedOverrides": {
"description": "UnsupportedOverrides holds the config overrides used to configure\nthe cluster.",
"type": "object",
"properties": {
"builtInExtensions": {
"description": "BuiltInExtensions holds overrides for the default add-ons we ship\nwith Embedded Cluster.",
"type": "array",
"items": {
"description": "BuiltInExtension holds the override for a built-in extension (add-on).",
"type": "object",
"required": [
"name",
"values"
],
"properties": {
"name": {
"description": "The name of the helm chart to override values of, for instance `openebs`.",
"type": "string"
},
"values": {
"description": "YAML-formatted helm values that will override those provided to the\nchart by Embedded Cluster. Properties are overridden individually -\nsetting a new value for `images.tag` here will not prevent Embedded\nCluster from setting `images.pullPolicy = IfNotPresent`, for example.",
"type": "string"
}
}
}
},
"k0s": {
"description": "K0s holds the overrides used to configure k0s. These overrides\nare merged on top of the default k0s configuration. As the data\nlayout inside this configuration is very dynamic we have chosen\nto use a string here.",
"type": "string"
}
}
},
"version": {
"type": "string"
}
}
},
"status": {
"description": "ConfigStatus defines the observed state of Config",
"type": "object"
}
}
}
23 changes: 23 additions & 0 deletions pkg/kots/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1642,6 +1642,29 @@ spec:
},
expect: []LintExpression{},
},
{
name: "embedded cluster no errors",
specFiles: SpecFiles{
{
Name: "ec-config.yaml",
Path: "ec-config.yaml",
Content: `apiVersion: embeddedcluster.replicated.com/v1beta1
kind: Config
spec:
version: "1.2.2+k8s-1.29"
roles:
controller:
name: management
labels:
management: "true"
custom:
- name: app
labels:
app: "true"`,
},
},
expect: []LintExpression{},
},
}

for _, test := range tests {
Expand Down
Loading