Skip to content

Commit 02f1626

Browse files
committed
Construct CRD for slack channel
1 parent e167c14 commit 02f1626

File tree

3 files changed

+51
-13
lines changed

3 files changed

+51
-13
lines changed

api/v1alpha1/channel_types.go

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,31 @@ import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121
)
2222

23-
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
24-
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
25-
2623
// ChannelSpec defines the desired state of Channel
2724
type ChannelSpec struct {
28-
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
29-
// Important: Run "make" to regenerate code after modifying this file
25+
// Name of the slack channel
26+
Name string `json:"name"`
27+
28+
// Make the channel private or public
29+
Private bool `json:"private,omitempty"`
30+
31+
// List of user IDs of the users to invite
32+
Users []string `json:"users,omitempty"`
3033

31-
// Foo is an example field of Channel. Edit Channel_types.go to remove/update
32-
Foo string `json:"foo,omitempty"`
34+
// Description of the channel
35+
Description string `json:"description,omitempty"`
36+
37+
// Topic of the channel
38+
Topic string `json:"topic,omitempty"`
3339
}
3440

3541
// ChannelStatus defines the observed state of Channel
3642
type ChannelStatus struct {
37-
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
38-
// Important: Run "make" to regenerate code after modifying this file
43+
// ID of the slack channel
44+
ID string `json:"id"`
45+
46+
// Error message if any error has occurred
47+
Error string `json:"error,omitempty"`
3948
}
4049

4150
// +kubebuilder:object:root=true

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/slack.stakater.com_channels.yaml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,37 @@ spec:
3636
spec:
3737
description: ChannelSpec defines the desired state of Channel
3838
properties:
39-
foo:
40-
description: Foo is an example field of Channel. Edit Channel_types.go
41-
to remove/update
39+
description:
40+
description: Description of the channel
4241
type: string
42+
name:
43+
description: Name of the slack channel
44+
type: string
45+
private:
46+
description: Make the channel private or public
47+
type: boolean
48+
topic:
49+
description: Topic of the channel
50+
type: string
51+
users:
52+
description: List of user IDs of the users to invite
53+
items:
54+
type: string
55+
type: array
56+
required:
57+
- name
4358
type: object
4459
status:
4560
description: ChannelStatus defines the observed state of Channel
61+
properties:
62+
error:
63+
description: Error message if any error has occurred
64+
type: string
65+
id:
66+
description: ID of the slack channel
67+
type: string
68+
required:
69+
- id
4670
type: object
4771
type: object
4872
version: v1alpha1

0 commit comments

Comments
 (0)