Skip to content

Commit

Permalink
operation names and responses
Browse files Browse the repository at this point in the history
Signed-off-by: leecalcote <[email protected]>
  • Loading branch information
leecalcote committed Dec 8, 2020
1 parent f1f8326 commit 606e96f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 55 deletions.
42 changes: 0 additions & 42 deletions .all-contributorsrc

This file was deleted.

22 changes: 11 additions & 11 deletions internal/config/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,32 @@ func getOperations(dev adapter.Operations) adapter.Operations {

dev[LabelNamespace] = &adapter.Operation{
Type: int32(meshes.OpCategory_CONFIGURE),
Description: "Label Namespace for Automatic Sidecar Injection",
Description: "Automatic Sidecar Injection",
}

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

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

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

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

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

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

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

dev[DenyAllPolicyOperation] = &adapter.Operation{
Type: int32(meshes.OpCategory_CONFIGURE),
Description: "Deny-All Policy",
Description: "Policy: Deny-All",
Templates: []adapter.Template{
"file://templates/policy-denyall.yaml",
},
}

dev[StrictMTLSPolicyOperation] = &adapter.Operation{
Type: int32(meshes.OpCategory_CONFIGURE),
Description: "Strict MTLS Policy",
Description: "Policy: Strict MTLS",
Templates: []adapter.Template{
"file://templates/policy-strict.yaml",
},
}

dev[MutualMTLSPolicyOperation] = &adapter.Operation{
Type: int32(meshes.OpCategory_CONFIGURE),
Description: "Mutual MTLS Policy",
Description: "Policy: Mutual MTLS",
Templates: []adapter.Template{
"file://templates/policy-mutual.yaml",
},
}

dev[DisableMTLSPolicyOperation] = &adapter.Operation{
Type: int32(meshes.OpCategory_CONFIGURE),
Description: "Disable MTLS Policy",
Description: "Policy: Disable MTLS",
Templates: []adapter.Template{
"file://templates/policy-disable.yaml",
},
Expand Down
8 changes: 6 additions & 2 deletions istio/istio.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,18 @@ func (istio *Istio) ApplyOperation(ctx context.Context, opReq adapter.OperationR
case internalconfig.LabelNamespace:
go func(hh *Istio, ee *adapter.Event) {
err := hh.LoadNamespaceToMesh(opReq.Namespace, opReq.IsDeleteOperation)
operation := "enabled"
if opReq.IsDeleteOperation {
operation = "removed"
}
if err != nil {
e.Summary = fmt.Sprintf("Error while labelling %s", opReq.Namespace)
e.Details = err.Error()
hh.StreamErr(e, err)
return
}
ee.Summary = "Labelling successful"
ee.Details = ""
ee.Summary = fmt.Sprintf("Label updated on %s namespace", opReq.Namespace)
ee.Details = fmt.Sprintf("ISTIO-INJECTION label %s on %s namespace", operation, opReq.Namespace)
hh.StreamInfo(e)
}(istio, e)
case internalconfig.PrometheusAddon, internalconfig.GrafanaAddon, internalconfig.KialiAddon, internalconfig.JaegerAddon, internalconfig.ZipkinAddon:
Expand Down

0 comments on commit 606e96f

Please sign in to comment.