Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

healthscope apply failed[BUG] #231

Open
xishengcai opened this issue Oct 8, 2020 · 1 comment
Open

healthscope apply failed[BUG] #231

xishengcai opened this issue Oct 8, 2020 · 1 comment

Comments

@xishengcai
Copy link
Contributor

xishengcai commented Oct 8, 2020

Describe the bug
healthscope can't pave, will report error: no fields

59s         Warning   CannotApplyComponents    applicationconfiguration/example-appconfig                          cannot find scope workloadRef "core.oam.dev/v1alpha2" "HealthScope" "example-health-scope" with workloadRefsPath "spec.workloadRefs": spec: no such field

if value, err := fieldpath.Pave(s.UnstructuredContent()).GetValue(workloadRefsPath); err == nil

To Reproduce

  1. 定义healthscope
apiVersion: core.oam.dev/v1alpha2
kind: ScopeDefinition
metadata:
  name: healthscopes.core.oam.dev
spec:
  allowComponentOverlap: true
  workloadRefsPath: spec.workloadRefs
  definitionRef:
    name: healthscopes.core.oam.dev
  1. 创建healthscope
apiVersion: core.oam.dev/v1alpha2
kind: HealthScope
metadata:
  name: example-health-scope
  1. 应用scope
apiVersion: core.oam.dev/v1alpha2
kind: ApplicationConfiguration
metadata:
  name: example-appconfig
spec:
  components:
    - componentName: example-component
      parameterValues:
        - name: instance-name
          value: example-appconfig-workload1
        - name: image
          value: wordpress:php7.2
      traits:
        - trait:
            apiVersion: core.oam.dev/v1alpha2
            kind: ManualScalerTrait
            metadata:
              name: example-appconfig-trait
            spec:
              replicaCount: 2
      scopes:
        - scopeRef:
            apiVersion: core.oam.dev/v1alpha2
            kind: HealthScope
            name: example-health-scope
  1. kubectl get event -w , you will find the Warning
@captainroy-hy
Copy link
Contributor

Miss a required field when creating a HealthScope

apiVersion: core.oam.dev/v1alpha2
kind: HealthScope
metadata:
  name: example-health-scope
spec:
  workloadRefs: [] # <-- this field is required

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants