Skip to content

Commit 8312fac

Browse files
authored
Merge pull request #39 from appuio/team-definition
Add Team definition
2 parents aeba0a1 + 8ebaaa0 commit 8312fac

File tree

3 files changed

+245
-0
lines changed

3 files changed

+245
-0
lines changed

apis/v1/team_types.go

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package v1
2+
3+
import (
4+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
5+
)
6+
7+
// +kubebuilder:object:root=true
8+
// +kubebuilder:subresource:status
9+
10+
// Team is the collection of members of a team.
11+
type Team struct {
12+
metav1.TypeMeta `json:",inline"`
13+
metav1.ObjectMeta `json:"metadata,omitempty"`
14+
15+
Spec TeamSpec `json:"spec,omitempty"`
16+
Status TeamStatus `json:"status,omitempty"`
17+
}
18+
19+
// TeamSpec contains the desired members of a team.
20+
type TeamSpec struct {
21+
DisplayName string `json:"displayName,omitempty"`
22+
UserRefs []UserRef `json:"userRefs"`
23+
}
24+
25+
// GroupRef references the underlying group
26+
type GroupRef struct {
27+
ID string `json:"id,omitempty"`
28+
}
29+
30+
// TeamStatus contains the actual members of a team and a reference to the underlying group.
31+
type TeamStatus struct {
32+
GroupRef GroupRef `json:"groupRef,omitempty"`
33+
34+
ResolvedUserRefs []UserRef `json:"resolvedUserRefs,omitempty"`
35+
}
36+
37+
// +kubebuilder:object:root=true
38+
39+
// TeamList contains a list of Team resources
40+
type TeamList struct {
41+
metav1.TypeMeta `json:",inline"`
42+
metav1.ListMeta `json:"metadata,omitempty"`
43+
44+
Items []Team `json:"items"`
45+
}
46+
47+
func init() {
48+
SchemeBuilder.Register(&Team{}, &TeamList{})
49+
}

apis/v1/zz_generated.deepcopy.go

Lines changed: 115 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
2+
---
3+
apiVersion: apiextensions.k8s.io/v1
4+
kind: CustomResourceDefinition
5+
metadata:
6+
annotations:
7+
controller-gen.kubebuilder.io/version: v0.7.0
8+
creationTimestamp: null
9+
name: teams.appuio.io
10+
spec:
11+
group: appuio.io
12+
names:
13+
kind: Team
14+
listKind: TeamList
15+
plural: teams
16+
singular: team
17+
scope: Namespaced
18+
versions:
19+
- name: v1
20+
schema:
21+
openAPIV3Schema:
22+
description: Team is the collection of members of a team.
23+
properties:
24+
apiVersion:
25+
description: 'APIVersion defines the versioned schema of this representation
26+
of an object. Servers should convert recognized schemas to the latest
27+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
28+
type: string
29+
kind:
30+
description: 'Kind is a string value representing the REST resource this
31+
object represents. Servers may infer this from the endpoint the client
32+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
33+
type: string
34+
metadata:
35+
type: object
36+
spec:
37+
description: TeamSpec contains the desired members of a team.
38+
properties:
39+
displayName:
40+
type: string
41+
userRefs:
42+
items:
43+
description: UserRef points to a user
44+
properties:
45+
name:
46+
type: string
47+
type: object
48+
type: array
49+
required:
50+
- userRefs
51+
type: object
52+
status:
53+
description: TeamStatus contains the actual members of a team and a reference
54+
to the underlying group.
55+
properties:
56+
groupRef:
57+
description: GroupRef references the underlying group
58+
properties:
59+
id:
60+
type: string
61+
type: object
62+
resolvedUserRefs:
63+
items:
64+
description: UserRef points to a user
65+
properties:
66+
name:
67+
type: string
68+
type: object
69+
type: array
70+
type: object
71+
type: object
72+
served: true
73+
storage: true
74+
subresources:
75+
status: {}
76+
status:
77+
acceptedNames:
78+
kind: ""
79+
plural: ""
80+
conditions: []
81+
storedVersions: []

0 commit comments

Comments
 (0)