Merge pull request #2347 from RainbowMango/pr_rename_interprete_healthy

Rename interpreter operation health
This commit is contained in:
karmada-bot 2022-08-09 15:49:07 +08:00 committed by GitHub
commit b45087c491
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 13 deletions

View File

@ -163,9 +163,9 @@ const (
// Only necessary for those resource types that want to aggregate status to resource template.
InterpreterOperationAggregateStatus InterpreterOperation = "AggregateStatus"
// InterpreterOperationInterpretHealthy indicates that karmada want to figure out the healthy status of a specific object.
// Only necessary for those resource types that have and want to reflect their healthy status.
InterpreterOperationInterpretHealthy InterpreterOperation = "InterpretHealthy"
// InterpreterOperationInterpretHealth indicates that karmada want to figure out the health status of a specific object.
// Only necessary for those resource types that have and want to reflect their health status.
InterpreterOperationInterpretHealth InterpreterOperation = "InterpretHealth"
// InterpreterOperationInterpretDependency indicates that karmada want to figure out the dependencies of a specific object.
// Only necessary for those resource types that have dependencies resources and expect the dependencies be propagated
@ -357,9 +357,9 @@ type DependentObjectReference struct {
#### Configuration
The example below show two webhooks configuration.
The `foo.example.com` webhook serves for `foos` under `foo.example.com` group and implemented `Retain` and
`InterpretHealthy` operations.
`InterpretHealth` operations.
The `bar.example.com` webhook serves for `bars` under `bar.example.com` group and implemented `InterpretDependency` and
`InterpretHealthy` operations.
`InterpretHealth` operations.
```yaml
apiVersion: config.karmada.io/v1alpha1
@ -369,7 +369,7 @@ metadata:
webhooks:
- name: foo.example.com
rules:
- operations: ["Retain", "InterpretHealthy"]
- operations: ["Retain", "InterpretHealth"]
apiGroups: ["foo.example.com"]
apiVersions: ["*"]
kinds: ["Foo"]
@ -381,7 +381,7 @@ webhooks:
timeoutSeconds: 3
- name: bar.example.com
rules:
- operations: ["InterpretDependency", "InterpretHealthy"]
- operations: ["InterpretDependency", "InterpretHealth"]
apiGroups: ["bar.example.com"]
apiVersions: ["*"]
kinds: ["Bar"]
@ -393,7 +393,7 @@ webhooks:
timeoutSeconds: 3
```
#### Request and Response
Take `InterpretHealthy` for example, Karmada will send the request like:
Take `InterpretHealth` for example, Karmada will send the request like:
```yaml
apiVersion: config.karmada.io/v1alpha1
kind: ResourceInterpreterContext
@ -405,7 +405,7 @@ request:
Kind: Foo
- name: foo
- namespace: default
- operation: InterpretHealthy
- operation: InterpretHealth
- object: <raw data of the object>
```

View File

@ -108,9 +108,9 @@ const (
// Only necessary for those resource types that want to aggregate status to resource template.
InterpreterOperationAggregateStatus InterpreterOperation = "AggregateStatus"
// InterpreterOperationInterpretHealthy indicates that karmada want to figure out the healthy status of a specific object.
// Only necessary for those resource types that have and want to reflect their healthy status.
InterpreterOperationInterpretHealthy InterpreterOperation = "InterpretHealthy"
// InterpreterOperationInterpretHealth indicates that karmada want to figure out the health status of a specific object.
// Only necessary for those resource types that have and want to reflect their health status.
InterpreterOperationInterpretHealth InterpreterOperation = "InterpretHealth"
// InterpreterOperationInterpretDependency indicates that karmada want to figure out the dependencies of a specific object.
// Only necessary for those resource types that have dependencies resources and expect the dependencies be propagated

View File

@ -117,7 +117,7 @@ func verifyResourceInterpreterContext(operation configv1alpha1.InterpreterOperat
}
res.RawStatus = *response.RawStatus
return res, nil
case configv1alpha1.InterpreterOperationInterpretHealthy:
case configv1alpha1.InterpreterOperationInterpretHealth:
if response.Healthy == nil {
return nil, fmt.Errorf("webhook returned nil response.healthy")
}