-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(controller): add globalproxysettings crd
Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
- Loading branch information
1 parent
67b34ac
commit 4705a99
Showing
17 changed files
with
712 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright 2020-2023 Project Capsule Authors. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package v1beta1 | ||
|
||
import ( | ||
"github.com/projectcapsule/capsule/api/v1beta2" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// GlobalProxySettingsSpec defines the desired state of GlobalProxySettings. | ||
type GlobalProxySettingsSpec struct { | ||
// Subjects that should receive additional permissions. | ||
// The subjects are selected based on the oncoming requests. They don't have to relate to an existing tenant. | ||
// However they must be part of the capsule-user groups. | ||
// +kubebuilder:validation:MinItems=1 | ||
Rules []GlobalSubjectSpec `json:"rules"` | ||
} | ||
|
||
type GlobalSubjectSpec struct { | ||
// Subjects that should receive additional permissions. | ||
// The subjects are selected based on the oncoming requests. They don't have to relate to an existing tenant. | ||
// However they must be part of the capsule-user groups. | ||
Subjects []GlobalSubject `json:"subjects"` | ||
// Cluster Resources for tenant Owner. | ||
ClusterResources []ClusterResource `json:"clusterResources,omitempty"` | ||
} | ||
|
||
type GlobalSubject struct { | ||
// Kind of tenant owner. Possible values are "User", "Group", and "ServiceAccount". | ||
Kind v1beta2.OwnerKind `json:"kind"` | ||
// Name of tenant owner. | ||
Name string `json:"name"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
//+kubebuilder:resource:scope=Cluster | ||
|
||
// GlobalProxySettings is the Schema for the globalproxysettings API. | ||
type GlobalProxySettings struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec GlobalProxySettingsSpec `json:"spec,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// GlobalProxySettingsList contains a list of GlobalProxySettings. | ||
type GlobalProxySettingsList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []GlobalProxySettings `json:"items"` | ||
} | ||
|
||
//nolint:gochecknoinits | ||
func init() { | ||
SchemeBuilder.Register(&GlobalProxySettings{}, &GlobalProxySettingsList{}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.