Skip to content

Commit

Permalink
✨ Add capsule-level extensions through Platform config (#1199)
Browse files Browse the repository at this point in the history
  • Loading branch information
andersjohnsen authored Sep 9, 2024
1 parent 0b52517 commit 726bc24
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/docs/api/config/v1alpha1.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,20 @@ _Appears in:_



### Extension



Extension is a typed (through JSON Schema) expansion of a Platform resource, that allows extending the default customization.

_Appears in:_
- [PlatformConfig](#platformconfig)

| Field | Description |
| --- | --- |
| `schema` _[JSONSchemaProps](#jsonschemaprops)_ | The schema of the extension, expressed as a json-schema (https://json-schema.org/). While the full syntax is supported, some features may be semantically disabled which would make the Platform not start or not process Rollouts. |


### GitAuth


Expand Down Expand Up @@ -619,6 +633,7 @@ PlatformConfig is the Schema for the platform config API
| `logging` _[Logging](#logging)_ | Logging holds information about the granularity of logging |
| `clusters` _object (keys:string, values:[Cluster](#cluster))_ | Clusters the platform has access to. |
| `dockerRegistries` _object (keys:string, values:[DockerRegistryCredentials](#dockerregistrycredentials))_ | DockerRegistries holds configuration for multiple docker registries. The key is the host-prefix of the registry |
| `capsuleExtensions` _object (keys:string, values:[Extension](#extension))_ | CapsuleExtensions contains typed extensions to the Capsule spec. |


### Plugin
Expand Down
32 changes: 32 additions & 0 deletions docs/docs/api/platform-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9347,6 +9347,23 @@ Platform wide static configuration.
| client | [Client](#api-v1-settings-Client) | | |
| docker_registries | [string](#string) | repeated | |
| default_email | [EmailClient](#api-v1-settings-EmailClient) | | |
| capsule_extensions | [Configuration.CapsuleExtensionsEntry](#api-v1-settings-Configuration-CapsuleExtensionsEntry) | repeated | |






<a name="api-v1-settings-Configuration-CapsuleExtensionsEntry"></a>

### Configuration.CapsuleExtensionsEntry



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [string](#string) | | |
| value | [Extension](#api-v1-settings-Extension) | | |



Expand All @@ -9369,6 +9386,21 @@ Platform wide static configuration.



<a name="api-v1-settings-Extension"></a>

### Extension



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| json_schema | [string](#string) | | The schema of the extension, expressed as a json-schema (https://json-schema.org/). |






<a name="api-v1-settings-Git"></a>

### Git
Expand Down
14 changes: 14 additions & 0 deletions pkg/api/config/v1alpha1/platform_config_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"

"go.uber.org/zap/zapcore"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/validation/field"
Expand Down Expand Up @@ -53,6 +54,19 @@ type PlatformConfig struct {

// DockerRegistries holds configuration for multiple docker registries. The key is the host-prefix of the registry
DockerRegistries map[string]DockerRegistryCredentials `json:"dockerRegistries,omitempty"`

// CapsuleExtensions contains typed extensions to the Capsule spec.
CapsuleExtensions map[string]Extension `json:"capsuleExtensions,omitempty"`
}

// Extension is a typed (through JSON Schema) expansion of a Platform resource,
// that allows extending the default customization.
type Extension struct {
// The schema of the extension, expressed as a json-schema
// (https://json-schema.org/). While the full syntax is supported,
// some features may be semantically disabled which would make the Platform
// not start or not process Rollouts.
Schema *apiextensionsv1.JSONSchemaProps `json:"schema,omitempty"`
}

// Auth specifies authentication configuration.
Expand Down
26 changes: 26 additions & 0 deletions pkg/api/config/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions proto/rig/api/v1/settings/configuration.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ message Configuration {
Client client = 1;
repeated string docker_registries = 2;
EmailClient default_email = 3;
map<string, Extension> capsule_extensions = 4;
}

message Client {
Expand Down Expand Up @@ -40,3 +41,9 @@ message Git {
// URLPrefix is a prefix-match for the repo urls this auth can be used for.
string url_prefix = 2;
}

message Extension {
// The schema of the extension, expressed as a json-schema
// (https://json-schema.org/).
string json_schema = 1;
}

0 comments on commit 726bc24

Please sign in to comment.