-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #441 from loft-sh/new-fabi-dev
- Loading branch information
Repo Sync Bot
committed
Dec 1, 2021
1 parent
9b97fa3
commit 6d373bc
Showing
120 changed files
with
56,653 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module github.com/loft-sh/agentapi/v2 | ||
|
||
go 1.13 | ||
|
||
require ( | ||
github.com/go-openapi/spec v0.20.1 | ||
github.com/loft-sh/apiserver v0.0.0-20210607160412-10c99558fdeb | ||
k8s.io/api v0.21.1 | ||
k8s.io/apimachinery v0.21.1 | ||
k8s.io/apiserver v0.21.1 | ||
k8s.io/client-go v0.21.1 | ||
k8s.io/kube-openapi v0.0.0-20210527164424-3c818078ee3d | ||
sigs.k8s.io/controller-runtime v0.9.0 | ||
) | ||
|
||
replace ( | ||
github.com/go-openapi/jsonpointer => github.com/go-openapi/jsonpointer v0.19.3 | ||
github.com/go-openapi/jsonreference => github.com/go-openapi/jsonreference v0.19.3 | ||
github.com/go-openapi/swag => github.com/go-openapi/swag v0.19.5 | ||
github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.4.1 | ||
github.com/kubernetes-incubator/reference-docs => github.com/kubernetes-sigs/reference-docs v0.0.0-20170929004150-fcf65347b256 | ||
github.com/markbates/inflect => github.com/markbates/inflect v1.0.4 | ||
k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 | ||
) |
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 @@ | ||
package apis |
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,3 @@ | ||
// +k8s:openapi-gen=true | ||
// +groupName=config.kiosk.sh | ||
package config |
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,117 @@ | ||
/* | ||
Copyright 2020 DevSpace Technologies Inc. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
rbacv1 "k8s.io/api/rbac/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// AccountSpec defines a single account configuration | ||
type AccountSpec struct { | ||
// Space defines default options for created spaces by the account | ||
// +optional | ||
Space AccountSpace `json:"space,omitempty"` | ||
|
||
// Subjects are the account users | ||
// +optional | ||
Subjects []rbacv1.Subject `json:"subjects,omitempty"` | ||
} | ||
|
||
// AccountSpace defines properties how many spaces can be owned by the account and how they should be created | ||
type AccountSpace struct { | ||
// This defines the cluster role that will be used for the rolebinding when | ||
// creating a new space for the selected subjects | ||
// +optional | ||
ClusterRole *string `json:"clusterRole,omitempty"` | ||
|
||
// Limit defines how many spaces are allowed to be owned by this account. If no value is specified, | ||
// unlimited spaces can be created by the account (if the users have the rights to create spaces) | ||
// +optional | ||
Limit *int `json:"limit,omitempty"` | ||
|
||
// TemplateInstances are templates that should be created by default in a newly created space by | ||
// this account. Kiosk makes sure that these templates are deployed successfully, before the users of | ||
// this account will get access to the space | ||
// +optional | ||
TemplateInstances []AccountTemplateInstanceTemplate `json:"templateInstances,omitempty"` | ||
|
||
// SpaceTemplate defines a space template with default annotations and labels the space should have after | ||
// creation | ||
// +optional | ||
SpaceTemplate AccountSpaceTemplate `json:"spaceTemplate,omitempty"` | ||
} | ||
|
||
// AccountSpaceTemplate defines a space template | ||
type AccountSpaceTemplate struct { | ||
// The default metadata of the space to create | ||
// +optional | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
} | ||
|
||
// AccountTemplateInstanceTemplate defines a template instance template | ||
type AccountTemplateInstanceTemplate struct { | ||
// The metadata of the template instance to create | ||
// +optional | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
// The spec of the template instance | ||
// +optional | ||
Spec TemplateInstanceSpec `json:"spec,omitempty"` | ||
} | ||
|
||
// AccountStatus describes the current status of the account is the cluster | ||
type AccountStatus struct { | ||
// +optional | ||
Namespaces []AccountNamespaceStatus `json:"namespaces,omitempty"` | ||
} | ||
|
||
// AccountNamespaceStatus is the status for the account access objects that belong to the account | ||
type AccountNamespaceStatus struct { | ||
// +optional | ||
Name string `json:"name,omitempty"` | ||
} | ||
|
||
// +genclient | ||
// +genclient:nonNamespaced | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// Account | ||
// +k8s:openapi-gen=true | ||
type Account struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
// +optional | ||
Spec AccountSpec `json:"spec,omitempty"` | ||
|
||
// +optional | ||
Status AccountStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// AccountList contains a list of Account | ||
type AccountList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []Account `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&Account{}, &AccountList{}) | ||
} |
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,90 @@ | ||
/* | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! | ||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||
|
||
// AccountQuotaSpec defines the desired state of AccountQuota | ||
type AccountQuotaSpec struct { | ||
// account is the name of the account this quota should apply to | ||
Account string `json:"account"` | ||
|
||
// quota is the quota definition with all the limits and selectors | ||
// +optional | ||
Quota corev1.ResourceQuotaSpec `json:"quota,omitempty"` | ||
} | ||
|
||
// AccountQuotaStatus defines the observed state of AccountQuota | ||
type AccountQuotaStatus struct { | ||
// Total defines the actual enforced quota and its current usage across all projects | ||
// +optional | ||
Total corev1.ResourceQuotaStatus `json:"total"` | ||
|
||
// Namespaces slices the usage by project. This division allows for quick resolution of | ||
// deletion reconciliation inside of a single project without requiring a recalculation | ||
// across all projects. This can be used to pull the deltas for a given project. | ||
// +optional | ||
// +nullable | ||
Namespaces AccountQuotasStatusByNamespace `json:"namespaces"` | ||
} | ||
|
||
// AccountQuotasStatusByNamespace bundles multiple resource quota status | ||
type AccountQuotasStatusByNamespace []AccountQuotaStatusByNamespace | ||
|
||
// AccountQuotaStatusByNamespace holds the status of a specific namespace | ||
type AccountQuotaStatusByNamespace struct { | ||
// Namespace of the account this account quota applies to | ||
Namespace string `json:"namespace"` | ||
|
||
// Status indicates how many resources have been consumed by this project | ||
// +optional | ||
Status corev1.ResourceQuotaStatus `json:"status"` | ||
} | ||
|
||
// +genclient | ||
// +genclient:nonNamespaced | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// AccountQuota is the Schema for the accountquotas API | ||
// +k8s:openapi-gen=true | ||
type AccountQuota struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec AccountQuotaSpec `json:"spec,omitempty"` | ||
|
||
// +optional | ||
Status AccountQuotaStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// AccountQuotaList contains a list of AccountQuota | ||
type AccountQuotaList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []AccountQuota `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&AccountQuota{}, &AccountQuotaList{}) | ||
} |
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,25 @@ | ||
/* | ||
Copyright 2020 DevSpace Technologies Inc. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// Api versions allow the api contract for a resource to be changed while keeping | ||
// backward compatibility by support multiple concurrent versions | ||
// of the same resource | ||
|
||
// +k8s:openapi-gen=true | ||
// +k8s:deepcopy-gen=package,register | ||
// +k8s:defaulter-gen=TypeMeta | ||
// +groupName=config.kiosk.sh | ||
package v1alpha1 // import "github.com/loft-sh/agentapi/v2/pkg/apis/kiosk/config/v1alpha1" |
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,38 @@ | ||
/* | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// Package v1alpha1 contains API Schema definitions for the config v1alpha1 API group | ||
// +kubebuilder:object:generate=true | ||
// +groupName=config.kiosk.sh | ||
package v1alpha1 | ||
|
||
import ( | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"sigs.k8s.io/controller-runtime/pkg/scheme" | ||
) | ||
|
||
var ( | ||
// GroupVersion is group version used to register these objects | ||
GroupVersion = schema.GroupVersion{Group: "config.kiosk.sh", Version: "v1alpha1"} | ||
|
||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme | ||
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} | ||
|
||
// AddToScheme adds the types in this group-version to the given scheme. | ||
AddToScheme = SchemeBuilder.AddToScheme | ||
|
||
// SchemeGroupVersion is a shim that expect this to be present in the api package | ||
SchemeGroupVersion = GroupVersion | ||
) |
Oops, something went wrong.