Skip to content

Commit

Permalink
Changes based on the code review
Browse files Browse the repository at this point in the history
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
  • Loading branch information
jpkrohling committed Dec 5, 2019
1 parent 9bf0035 commit 8c5197c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion deploy/crds/jaegertracing.io_jaegers_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
spec:
additionalPrinterColumns:
- JSONPath: .status.phase
description: Instance's status
description: Jaeger instance's status
name: Status
type: string
- JSONPath: .status.version
Expand Down
8 changes: 3 additions & 5 deletions pkg/apis/jaegertracing/v1/jaeger_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,16 @@ type JaegerSpec struct {
// JaegerStatus defines the observed state of Jaeger
// +k8s:openapi-gen=true
type JaegerStatus struct {
Version string `json:"version"`

// +kubebuilder:validation:Default=Pending
Phase JaegerPhase `json:"phase"`
Version string `json:"version"`
Phase JaegerPhase `json:"phase"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// Jaeger is the Schema for the jaegers API
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.phase",description="Instance's status"
// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.phase",description="Jaeger instance's status"
// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".status.version",description="Jaeger Version"
type Jaeger struct {
metav1.TypeMeta `json:",inline"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/jaeger/jaeger_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func (r *ReconcileJaeger) Reconcile(request reconcile.Request) (reconcile.Result
if instance.Status.Phase != v1.JaegerPhaseRunning {
instance.Status.Phase = v1.JaegerPhaseRunning
if err := r.client.Status().Update(ctx, instance); err != nil {
logFields.WithError(err).Error("failed to store the status into the current CustomResource")
logFields.WithError(err).Error("failed to store the running status into the current CustomResource")
return reconcile.Result{}, tracing.HandleError(err, span)
}
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/controller/jaeger/jaeger_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ func TestSkipOnNonOwnedCR(t *testing.T) {

// the only way to reliably test this is to verify that the operator didn't attempt to set the ownership field
assert.Equal(t, "another-identity", persisted.Labels[v1.LabelOperatedBy])

// condition shouldn't be touched when the object belongs to another operator
assert.Equal(t, v1.JaegerPhase(""), persisted.Status.Phase)
}

Expand Down

0 comments on commit 8c5197c

Please sign in to comment.