Skip to content

Commit 48919c0

Browse files
committed
[platform] Add secret selectors to app definitions
This patch expands the CozystackResourceDefinitions with new label selector fields to include and exclude secrets by their labelsets. This will enable application developers to selectively show or hide application secrets to and from end-users. ```release-note [platform] Add selectors for application secrets, offering developers an API to control secret visibility for end users. ``` Signed-off-by: Timofei Larkin <[email protected]>
1 parent 66b53cb commit 48919c0

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎api/v1alpha1/cozystackresourcedefinitions_types.go‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type CozystackResourceDefinition struct {
3232

3333
// +kubebuilder:object:root=true
3434

35-
// CozystackResourceDefinitionList contains a list of CozystackResourceDefinition
35+
// CozystackResourceDefinitionList contains a list of CozystackResourceDefinitions
3636
type CozystackResourceDefinitionList struct {
3737
metav1.TypeMeta `json:",inline"`
3838
metav1.ListMeta `json:"metadata,omitempty"`
@@ -48,6 +48,8 @@ type CozystackResourceDefinitionSpec struct {
4848
Application CozystackResourceDefinitionApplication `json:"application"`
4949
// Release configuration
5050
Release CozystackResourceDefinitionRelease `json:"release"`
51+
// Secret selectors
52+
Secrets CozystackResourceDefinitionSecrets `json:"secrets,omitempty"`
5153
}
5254

5355
type CozystackResourceDefinitionChart struct {
@@ -87,3 +89,15 @@ type CozystackResourceDefinitionRelease struct {
8789
// Prefix for the release name
8890
Prefix string `json:"prefix"`
8991
}
92+
93+
type CozystackResourceDefinitionSecrets struct {
94+
// Exclude contains an array of label selectors that target secrets.
95+
// If a secret matches the selector in any of the elements in the array, it is
96+
// hidden from the user, regardless of the matches in the include array.
97+
Exclude []*metav1.LabelSelector `json:"exclude,omitempty"`
98+
// Include contains an array of label selectors that target secrets.
99+
// If a secret matches the selector in any of the elements in the array, and
100+
// matches none of the selectors in the exclude array that secret is marked
101+
// as a tenant secret and is visible to users.
102+
Include []*metav1.LabelSelector `json:"include,omitempty"`
103+
}

0 commit comments

Comments
 (0)