Skip to content

Commit

Permalink
feat(v1alpha2): tenant spec
Browse files Browse the repository at this point in the history
feat(v1alpha2): remove unused structs and functions from v1alpha1. Rename v1alpha1 structs to follow new naming. Move v1alpha1 structs to separate files
  • Loading branch information
Maksim Fedotov authored and prometherion committed Jun 30, 2021
1 parent c398f73 commit 564efc2
Show file tree
Hide file tree
Showing 30 changed files with 1,125 additions and 391 deletions.
9 changes: 9 additions & 0 deletions api/v1alpha1/additional_metadata.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 2020-2021 Clastix Labs
// SPDX-License-Identifier: Apache-2.0

package v1alpha1

type AdditionalMetadataSpec struct {
AdditionalLabels map[string]string `json:"additionalLabels,omitempty"`
AdditionalAnnotations map[string]string `json:"additionalAnnotations,omitempty"`
}
12 changes: 12 additions & 0 deletions api/v1alpha1/additional_role_bindings.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2020-2021 Clastix Labs
// SPDX-License-Identifier: Apache-2.0

package v1alpha1

import rbacv1 "k8s.io/api/rbac/v1"

type AdditionalRoleBindingsSpec struct {
ClusterRoleName string `json:"clusterRoleName"`
// kubebuilder:validation:Minimum=1
Subjects []rbacv1.Subject `json:"subjects"`
}
4 changes: 2 additions & 2 deletions api/v1alpha1/conversion_hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
package v1alpha1

import (
"github.com/clastix/capsule/api/v1alpha2"
"sigs.k8s.io/controller-runtime/pkg/conversion"

"github.com/clastix/capsule/api/v1alpha2"
)

func (t *Tenant) ConvertTo(dstRaw conversion.Hub) error {
Expand All @@ -23,4 +24,3 @@ func (t *Tenant) ConvertFrom(srcRaw conversion.Hub) error {

return nil
}

9 changes: 0 additions & 9 deletions api/v1alpha1/domain/allowed.go

This file was deleted.

51 changes: 0 additions & 51 deletions api/v1alpha1/domain/imagepullpolicy.go

This file was deleted.

38 changes: 0 additions & 38 deletions api/v1alpha1/domain/podpriority.go

This file was deleted.

72 changes: 0 additions & 72 deletions api/v1alpha1/domain/registry.go

This file was deleted.

65 changes: 0 additions & 65 deletions api/v1alpha1/domain/registry_test.go

This file was deleted.

11 changes: 11 additions & 0 deletions api/v1alpha1/external_service_ips.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2020-2021 Clastix Labs
// SPDX-License-Identifier: Apache-2.0

package v1alpha1

// +kubebuilder:validation:Pattern="^([0-9]{1,3}.){3}[0-9]{1,3}(/([0-9]|[1-2][0-9]|3[0-2]))?$"
type AllowedIP string

type ExternalServiceIPsSpec struct {
Allowed []AllowedIP `json:"allowed"`
}
29 changes: 0 additions & 29 deletions api/v1alpha1/ingress_hostnames_list.go

This file was deleted.

17 changes: 17 additions & 0 deletions api/v1alpha1/owner.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2020-2021 Clastix Labs
// SPDX-License-Identifier: Apache-2.0

package v1alpha1

// OwnerSpec defines tenant owner name and kind
type OwnerSpec struct {
Name string `json:"name"`
Kind Kind `json:"kind"`
}

// +kubebuilder:validation:Enum=User;Group
type Kind string

func (k Kind) String() string {
return string(k)
}
Loading

0 comments on commit 564efc2

Please sign in to comment.