|
| 1 | +// Copyright 2026 Nokia |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +syntax = "proto3"; |
| 16 | + |
| 17 | +import "schema.proto"; |
| 18 | + |
| 19 | +package config_read; |
| 20 | + |
| 21 | +option go_package = "github.com/sdcio/sdc-protos/config_read;config_read"; |
| 22 | + |
| 23 | +// ConfigReadService is a unary, localhost-bound read API over config-server's |
| 24 | +// Config (+ joined SensitiveConfig) resources, backed by the colocated |
| 25 | +// controller's existing watch-synced informer cache. It lets data-server |
| 26 | +// treat a config-server Config the same way it treats a locally persisted |
| 27 | +// Intent, without persisting a second copy of that data itself. |
| 28 | +service ConfigReadService { |
| 29 | + // Get returns a single Config (joined with its SensitiveConfig, if any) by |
| 30 | + // name. Returns a NotFound gRPC status if no such Config exists for the |
| 31 | + // given target. |
| 32 | + rpc Get(GetConfigRequest) returns (GetConfigResponse); |
| 33 | + // List returns every Config (joined with its SensitiveConfig, if any) |
| 34 | + // scoped to a single target. |
| 35 | + rpc List(ListConfigRequest) returns (ListConfigResponse); |
| 36 | +} |
| 37 | + |
| 38 | +message GetConfigRequest { |
| 39 | + // target this Config belongs to. |
| 40 | + string target_namespace = 1; |
| 41 | + string target_name = 2; |
| 42 | + // Config resource name. |
| 43 | + string name = 3; |
| 44 | +} |
| 45 | + |
| 46 | +message GetConfigResponse { ConfigEntry config = 1; } |
| 47 | + |
| 48 | +message ListConfigRequest { |
| 49 | + // scopes the listing to Config resources for a single target, matching the |
| 50 | + // TargetNamespaceKey/TargetNameKey labels config-server already indexes by. |
| 51 | + string target_namespace = 1; |
| 52 | + string target_name = 2; |
| 53 | +} |
| 54 | + |
| 55 | +message ListConfigResponse { repeated ConfigEntry config = 1; } |
| 56 | + |
| 57 | +// ConfigEntry carries everything data-server's importer.ImportConfigAdapter |
| 58 | +// needs to treat a config-server Config as a real Intent: name, priority, |
| 59 | +// non-revertive/orphan flags, sensitive paths (joined from SensitiveConfig by |
| 60 | +// name), and the raw config payload. |
| 61 | +message ConfigEntry { |
| 62 | + // Config resource name and namespace (joined via config.GetGVKNSN). |
| 63 | + string name = 1; |
| 64 | + string namespace = 7; |
| 65 | + // non_revertive is the inverse of Config.Spec.Revertive (which defaults to |
| 66 | + // true, i.e. revertive, when unset). |
| 67 | + bool non_revertive = 2; |
| 68 | + // orphan reflects Config.Spec.Lifecycle.DeletionPolicy == DeletionOrphan. |
| 69 | + bool orphan = 3; |
| 70 | + int32 priority = 4; |
| 71 | + // sensitive_paths is joined from the Config's SensitiveConfig (by name), if |
| 72 | + // one exists. Keyless schema paths only. |
| 73 | + repeated schema.Path sensitive_paths = 5; |
| 74 | + // config is the raw path + JSON value payload from Config.Spec.Config. |
| 75 | + repeated ConfigBlob config = 6; |
| 76 | +} |
| 77 | + |
| 78 | +// ConfigBlob is a single raw path + JSON value entry from Config.Spec.Config. |
| 79 | +message ConfigBlob { |
| 80 | + string path = 1; |
| 81 | + // value is the raw JSON encoding of the ConfigBlob's runtime.RawExtension |
| 82 | + // value. |
| 83 | + bytes value = 2; |
| 84 | +} |
0 commit comments