-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core)!: Introduce two new CRDs and update existing ones
Signed-off-by: Anurag Rajawat <[email protected]>
- Loading branch information
1 parent
f58a804
commit 7439b2b
Showing
33 changed files
with
1,352 additions
and
996 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright 2023 Authors of Nimbus | ||
|
||
package v1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// ClusterNimbusPolicySpec defines the desired state of ClusterNimbusPolicy | ||
type ClusterNimbusPolicySpec struct { | ||
Selector CwSelector `json:"selector"` | ||
NimbusRules []NimbusRules `json:"rules"` | ||
} | ||
|
||
// ClusterNimbusPolicyStatus defines the observed state of ClusterNimbusPolicy | ||
type ClusterNimbusPolicyStatus struct { | ||
Status string `json:"status"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
//+kubebuilder:resource:scope=Cluster,shortName="cwnp" | ||
//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// ClusterNimbusPolicy is the Schema for the clusternimbuspolicies API | ||
type ClusterNimbusPolicy struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec ClusterNimbusPolicySpec `json:"spec,omitempty"` | ||
Status ClusterNimbusPolicyStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// ClusterNimbusPolicyList contains a list of ClusterNimbusPolicy | ||
type ClusterNimbusPolicyList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []ClusterNimbusPolicy `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&ClusterNimbusPolicy{}, &ClusterNimbusPolicyList{}) | ||
} |
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,58 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright 2023 Authors of Nimbus | ||
|
||
package v1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
type CwResource struct { | ||
Kind string `json:"kind"` | ||
Name string `json:"name"` | ||
Namespace string `json:"namespace,omitempty"` | ||
MatchLabels map[string]string `json:"matchLabels,omitempty"` | ||
} | ||
|
||
type CwSelector struct { | ||
Resources []CwResource `json:"resources,omitempty"` | ||
CEL []string `json:"cel,omitempty"` | ||
} | ||
|
||
// ClusterSecurityIntentBindingSpec defines the desired state of ClusterSecurityIntentBinding | ||
type ClusterSecurityIntentBindingSpec struct { | ||
Intents []MatchIntent `json:"intents"` | ||
Selector CwSelector `json:"selector"` | ||
} | ||
|
||
// ClusterSecurityIntentBindingStatus defines the observed state of ClusterSecurityIntentBinding | ||
type ClusterSecurityIntentBindingStatus struct { | ||
Status string `json:"status"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
//+kubebuilder:resource:scope=Cluster,shortName="csib" | ||
//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// ClusterSecurityIntentBinding is the Schema for the clustersecurityintentbindings API | ||
type ClusterSecurityIntentBinding struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec ClusterSecurityIntentBindingSpec `json:"spec,omitempty"` | ||
Status ClusterSecurityIntentBindingStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// ClusterSecurityIntentBindingList contains a list of ClusterSecurityIntentBinding | ||
type ClusterSecurityIntentBindingList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []ClusterSecurityIntentBinding `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&ClusterSecurityIntentBinding{}, &ClusterSecurityIntentBindingList{}) | ||
} |
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.