Skip to content

Commit 1f73816

Browse files
committed
update CRD
1 parent ac209ff commit 1f73816

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44

55
cmd/mobile/mobile
66
mobile
7-
87
coverage.out
98
integration.test

artifacts/mobileclient.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
"spec": {
1515
"name": "myapp",
1616
"apiKey": "25113a4f-48b3-4dbb-b462-e2d388a475ac",
17-
"clientType": "cordova"
17+
"clientType": "cordova",
18+
"excludedServices": [
19+
"test",
20+
"test2"
21+
]
1822
}
1923
}

artifacts/mobileclient.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ Spec:
1111
clientType: iOS
1212
apiKey: 834d44f-d697-4c56-aec6-47940679f79a
1313
name: app2
14-
14+
excludedServices:
15+
- test1
16+
test2

artifacts/mobileclient_crd.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,8 @@ spec:
3232
type: string
3333
pattern: '(\w-)'
3434
appIdentifier:
35-
type: string
35+
type: string
36+
excludedServices:
37+
type: array
38+
items:
39+
type: string

pkg/cmd/clients.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ func (cc *ClientCmd) ListClientsCmd() *cobra.Command {
6969
mClients := mobileClientList.(*v1alpha1.MobileClientList)
7070
var data [][]string
7171
for _, mClient := range mClients.Items {
72-
data = append(data, []string{mClient.Name, mClient.Spec.Name, mClient.Spec.ClientType, mClient.Spec.AppIdentifier})
72+
data = append(data, []string{mClient.Name, mClient.Spec.Name, mClient.Spec.ClientType, mClient.Spec.AppIdentifier, strings.Join(mClient.Spec.ExcludedServices, ", ")})
7373
}
7474
table := tablewriter.NewWriter(out)
7575
table.AppendBulk(data)
76-
table.SetHeader([]string{"ID", "Name", "ClientType", "AppIdentifier"})
76+
table.SetHeader([]string{"ID", "Name", "ClientType", "AppIdentifier", "ExcludedServices"})
7777
table.Render()
7878
return nil
7979
})
@@ -113,10 +113,10 @@ Run the "mobile get clients" command from this tool to get the client ID.`,
113113
cc.Out.AddRenderer(command.Name(), "table", func(out io.Writer, mobileClient interface{}) error {
114114
mClient := mobileClient.(*v1alpha1.MobileClient)
115115
var data [][]string
116-
data = append(data, []string{mClient.Name, mClient.Namespace, mClient.Spec.Name, mClient.Spec.ClientType, mClient.Spec.ApiKey, mClient.Spec.AppIdentifier})
116+
data = append(data, []string{mClient.Name, mClient.Namespace, mClient.Spec.Name, mClient.Spec.ClientType, mClient.Spec.ApiKey, mClient.Spec.AppIdentifier, strings.Join(mClient.Spec.ExcludedServices, ", ")})
117117
table := tablewriter.NewWriter(out)
118118
table.AppendBulk(data)
119-
table.SetHeader([]string{"ID", "Namespace", "Name", "ClientType", "ApiKey", "AppIdentifier"})
119+
table.SetHeader([]string{"ID", "Namespace", "Name", "ClientType", "ApiKey", "AppIdentifier", "Excluded Services"})
120120
table.Render()
121121
return nil
122122
})

0 commit comments

Comments
 (0)