Skip to content

Commit 606e96f

Browse files
committed
operation names and responses
Signed-off-by: leecalcote <[email protected]>
1 parent f1f8326 commit 606e96f

File tree

3 files changed

+17
-55
lines changed

3 files changed

+17
-55
lines changed

.all-contributorsrc

Lines changed: 0 additions & 42 deletions
This file was deleted.

internal/config/operations.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,32 @@ func getOperations(dev adapter.Operations) adapter.Operations {
2828

2929
dev[LabelNamespace] = &adapter.Operation{
3030
Type: int32(meshes.OpCategory_CONFIGURE),
31-
Description: "Label Namespace for Automatic Sidecar Injection",
31+
Description: "Automatic Sidecar Injection",
3232
}
3333

3434
dev[PrometheusAddon] = &adapter.Operation{
3535
Type: int32(meshes.OpCategory_CONFIGURE),
36-
Description: "Prometheus Monitoring",
36+
Description: "Add-on: Prometheus",
3737
}
3838

3939
dev[GrafanaAddon] = &adapter.Operation{
4040
Type: int32(meshes.OpCategory_CONFIGURE),
41-
Description: "Grafana Dashboard",
41+
Description: "Add-on: Grafana",
4242
}
4343

4444
dev[KialiAddon] = &adapter.Operation{
4545
Type: int32(meshes.OpCategory_CONFIGURE),
46-
Description: "Kiali Dashboard",
46+
Description: "Add-on: Kiali",
4747
}
4848

4949
dev[JaegerAddon] = &adapter.Operation{
5050
Type: int32(meshes.OpCategory_CONFIGURE),
51-
Description: "Jaeger Dashboard",
51+
Description: "Add-on: Jaeger",
5252
}
5353

5454
dev[ZipkinAddon] = &adapter.Operation{
5555
Type: int32(meshes.OpCategory_CONFIGURE),
56-
Description: "Zipkin Dashboard",
56+
Description: "Add-on: Zipkin",
5757
}
5858

5959
dev[IstioVetOperation] = &adapter.Operation{
@@ -63,7 +63,7 @@ func getOperations(dev adapter.Operations) adapter.Operations {
6363

6464
dev[EnvoyFilterOperation] = &adapter.Operation{
6565
Type: int32(meshes.OpCategory_CONFIGURE),
66-
Description: "Envoy Filter for Imagehub",
66+
Description: "Envoy Filter for Image Hub",
6767
Versions: adapter.NoneVersion,
6868
Templates: []adapter.Template{
6969
"file://templates/imagehub-filter.yaml",
@@ -76,31 +76,31 @@ func getOperations(dev adapter.Operations) adapter.Operations {
7676

7777
dev[DenyAllPolicyOperation] = &adapter.Operation{
7878
Type: int32(meshes.OpCategory_CONFIGURE),
79-
Description: "Deny-All Policy",
79+
Description: "Policy: Deny-All",
8080
Templates: []adapter.Template{
8181
"file://templates/policy-denyall.yaml",
8282
},
8383
}
8484

8585
dev[StrictMTLSPolicyOperation] = &adapter.Operation{
8686
Type: int32(meshes.OpCategory_CONFIGURE),
87-
Description: "Strict MTLS Policy",
87+
Description: "Policy: Strict MTLS",
8888
Templates: []adapter.Template{
8989
"file://templates/policy-strict.yaml",
9090
},
9191
}
9292

9393
dev[MutualMTLSPolicyOperation] = &adapter.Operation{
9494
Type: int32(meshes.OpCategory_CONFIGURE),
95-
Description: "Mutual MTLS Policy",
95+
Description: "Policy: Mutual MTLS",
9696
Templates: []adapter.Template{
9797
"file://templates/policy-mutual.yaml",
9898
},
9999
}
100100

101101
dev[DisableMTLSPolicyOperation] = &adapter.Operation{
102102
Type: int32(meshes.OpCategory_CONFIGURE),
103-
Description: "Disable MTLS Policy",
103+
Description: "Policy: Disable MTLS",
104104
Templates: []adapter.Template{
105105
"file://templates/policy-disable.yaml",
106106
},

istio/istio.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,18 @@ func (istio *Istio) ApplyOperation(ctx context.Context, opReq adapter.OperationR
118118
case internalconfig.LabelNamespace:
119119
go func(hh *Istio, ee *adapter.Event) {
120120
err := hh.LoadNamespaceToMesh(opReq.Namespace, opReq.IsDeleteOperation)
121+
operation := "enabled"
122+
if opReq.IsDeleteOperation {
123+
operation = "removed"
124+
}
121125
if err != nil {
122126
e.Summary = fmt.Sprintf("Error while labelling %s", opReq.Namespace)
123127
e.Details = err.Error()
124128
hh.StreamErr(e, err)
125129
return
126130
}
127-
ee.Summary = "Labelling successful"
128-
ee.Details = ""
131+
ee.Summary = fmt.Sprintf("Label updated on %s namespace", opReq.Namespace)
132+
ee.Details = fmt.Sprintf("ISTIO-INJECTION label %s on %s namespace", operation, opReq.Namespace)
129133
hh.StreamInfo(e)
130134
}(istio, e)
131135
case internalconfig.PrometheusAddon, internalconfig.GrafanaAddon, internalconfig.KialiAddon, internalconfig.JaegerAddon, internalconfig.ZipkinAddon:

0 commit comments

Comments
 (0)