-
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: add globalproxysettings (#550)
Signed-off-by: Oliver Bähler <[email protected]>
- Loading branch information
1 parent
e53fa53
commit f2c393e
Showing
95 changed files
with
1,333 additions
and
581 deletions.
There are no files selected for viewing
File renamed without changes.
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,56 @@ | ||
name: e2e | ||
permissions: {} | ||
|
||
on: | ||
push: | ||
branches: [ "*" ] | ||
paths: | ||
- '.github/workflows/e2e.yml' | ||
- 'api/**' | ||
- 'controllers/**' | ||
- 'internal/**' | ||
- 'e2e/*' | ||
- 'Dockerfile' | ||
- 'go.*' | ||
- 'main.go' | ||
- 'Makefile' | ||
pull_request: | ||
branches: [ "*" ] | ||
paths: | ||
- '.github/workflows/e2e.yml' | ||
- 'api/**' | ||
- 'controllers/**' | ||
- 'internal/**' | ||
- 'e2e/*' | ||
- 'Dockerfile' | ||
- 'go.*' | ||
- 'main.go' | ||
- 'Makefile' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
kind: | ||
name: Kubernetes | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
k8s-version: [ 'v1.24.7', 'v1.25.3', 'v1.26.3', 'v1.27.2', 'v1.28.0', 'v1.29.0', 'v1.30.0', 'v1.31.0' ] | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 | ||
with: | ||
go-version-file: 'go.mod' | ||
- uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v3 | ||
with: | ||
version: v3.14.2 | ||
- uses: engineerd/setup-kind@aa272fe2a7309878ffc2a81c56cfe3ef108ae7d0 # v0.5.0 | ||
with: | ||
skipClusterCreation: true | ||
- name: e2e testing | ||
run: KIND_K8S_VERSION=${{ matrix.k8s-version }} make e2e |
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
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{}) | ||
} |
Oops, something went wrong.