Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change explainer to pointer reference in api types #1497

Merged
merged 1 commit into from
Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion operator/apis/machinelearning/v1/seldondeployment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ type PredictorSpec struct {
Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,7,opt,name=labels"`
SvcOrchSpec SvcOrchSpec `json:"svcOrchSpec,omitempty" protobuf:"bytes,8,opt,name=svcOrchSpec"`
Traffic int32 `json:"traffic,omitempty" protobuf:"bytes,9,opt,name=traffic"`
Explainer Explainer `json:"explainer,omitempty" protobuf:"bytes,10,opt,name=explainer"`
Explainer *Explainer `json:"explainer,omitempty" protobuf:"bytes,10,opt,name=explainer"`
Shadow bool `json:"shadow,omitempty" protobuf:"bytes,11,opt,name=shadow"`
Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,12,opt,name=protocol"`
Transport Transport `json:"transport,omitempty" protobuf:"bytes,13,opt,name=transport"`
Expand Down
6 changes: 5 additions & 1 deletion operator/apis/machinelearning/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion operator/controllers/controller_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func getEngineVarJson(p *machinelearningv1.PredictorSpec) (string, error) {
for _, compSpec := range pcopy.ComponentSpecs {
compSpec.Metadata.CreationTimestamp = metav1.Time{}
}
pcopy.Explainer = machinelearningv1.Explainer{}
pcopy.Explainer = nil

str, err := json.Marshal(pcopy)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion operator/controllers/seldondeployment_explainers.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (

func createExplainer(r *SeldonDeploymentReconciler, mlDep *machinelearningv1.SeldonDeployment, p *machinelearningv1.PredictorSpec, c *components, pSvcName string, log logr.Logger) error {

if p.Explainer.Type != "" {
if p.Explainer != nil {

seldonId := machinelearningv1.GetSeldonDeploymentName(mlDep)

Expand Down