Skip to content

Update CR status field with values from pod output in GO #3410

@raghu017

Description

@raghu017

Type of question

Are you asking about community best practices, how to implement a specific feature, or about general context and help around the operator-sdk?
Help around operator-sdk

Question

How can controller update CR's status fields based on results from CR's pod?

What did you do?
I have a CR that has a Job with a pod. CR has a Status struct something like below

type CRStatus {
    TestStatus string `json:"testStatus"`
    TestCount int `json:"testCount"`
}

Pod within Job does some processing and prints output TestStatus and TestCount values. How can controller update CR's TestStatus and TestCount fields with values from Pod output?

What did you expect to see?

What did you see instead? Under which circumstances?

Environment

  • operator-sdk version:

"v0.17.2", commit: "0258db0119e8e18e15d035532427c329fce1e871"

  • Kubernetes version information:

v1.15.3

  • Kubernetes cluster kind:

Additional context
Add any other context about the question here.

Metadata

Metadata

Labels

triage/supportIndicates an issue that is a support question.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions