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

Added basic status to CR{D} #802

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Changes based on the code review
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
jpkrohling committed Dec 5, 2019

Verified

This commit was signed with the committer’s verified signature.
jpkrohling Juraci Paixão Kröhling
commit 8c5197c798303c600af27bc01e8d0540cc3a9822
2 changes: 1 addition & 1 deletion deploy/crds/jaegertracing.io_jaegers_crd.yaml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 3 additions & 5 deletions pkg/apis/jaegertracing/v1/jaeger_types.go
Original file line number Diff line number Diff line change
@@ -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"`
2 changes: 1 addition & 1 deletion pkg/controller/jaeger/jaeger_controller.go
Original file line number Diff line number Diff line change
@@ -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)
}
}
2 changes: 0 additions & 2 deletions pkg/controller/jaeger/jaeger_controller_test.go
Original file line number Diff line number Diff line change
@@ -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)
}