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

Get values for CRD's additionalPrinterColumns from annotations and labels instead of machine provider config #360

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
5 changes: 3 additions & 2 deletions Gopkg.lock

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

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ required = [
"sigs.k8s.io/controller-tools/cmd/controller-gen", # for crd/rbac generation
]

[[override]]
name = "github.com/openshift/cluster-api"
branch = "openshift-4.2-cluster-api-0.1.0"

[[override]]
name = "k8s.io/utils"

Expand Down
24 changes: 15 additions & 9 deletions install/0000_30_machine-api-operator_02_machine.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,36 @@ metadata:
name: machines.machine.openshift.io
spec:
additionalPrinterColumns:
- JSONPath: .status.providerStatus.instanceId
description: Instance ID of machine created in AWS
name: Instance
type: string
- JSONPath: .status.providerStatus.instanceState
description: State of the AWS instance
- JSONPath: .metadata.annotations['machine\.openshift\.io/instance-state']
description: State of instance
name: State
type: string
- JSONPath: .spec.providerSpec.value.instanceType
- JSONPath: .metadata.labels['machine\.openshift\.io/instance-type']
description: Type of instance
name: Type
type: string
- JSONPath: .spec.providerSpec.value.placement.region
- JSONPath: .metadata.labels['machine\.openshift\.io/region']
description: Region associated with machine
name: Region
type: string
- JSONPath: .spec.providerSpec.value.placement.availabilityZone
- JSONPath: .metadata.labels['machine\.openshift\.io/zone']
description: Zone associated with machine
name: Zone
type: string
- JSONPath: .metadata.creationTimestamp
description: Machine age
name: Age
type: date
- JSONPath: .status.nodeRef.name
description: Node associated with machine
name: Node
priority: 1
type: string
- JSONPath: .spec.providerID
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be from the status??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ProviderID is spec field and there was a long discussion which of spec or status is the right place to put it. Spec won.

description: Provider ID of machine created in cloud provider
name: ProviderID
priority: 1
type: string
group: machine.openshift.io
names:
kind: Machine
Expand Down

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

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