Skip to content

spec.hostsConfRef: Invalid value: \"null\" #1694

@PangQingcheng

Description

@PangQingcheng

Describe the version
version about:

  1. kubean

Describe the bug
In the current version of kubean-controller, if hostsConfRef is not specified when deploying ClusterOperation, it will result in errors similar to:

E1215 06:35:15.979448       1 controller.go:250] "failed to update ownreference" err="ClusterOperation.kubean.io \"cluster-mini-ping-ops\" is invalid: spec.hostsConfRef: Invalid value: \"null\": spec.hostsConfRef in body must be of type object: \"null\"" cluster="cluster-mini" clusterOps="cluster-mini-ping-ops"

How To Reproduce

apiVersion: kubean.io/v1alpha1
kind: ClusterOperation
metadata:
  name: cluster-mini-ping-ops
spec:
  cluster: cluster-mini
  image: xxxx/spray-job:v0.30.2
  actionType: playbook
  action: ping.yml
  preHook: []
  postHook: []

Expected behavior

Screenshots and log

Image

Additional context
Repair suggestions:
Add the omitempty json tag to HostsConfRef, PreHook, and PostHook in ClusterOperation.spec

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions