Merge pull request #2347 from RainbowMango/pr_rename_interprete_healthy
Rename interpreter operation health
This commit is contained in:
commit
b45087c491
|
@ -163,9 +163,9 @@ const (
|
||||||
// Only necessary for those resource types that want to aggregate status to resource template.
|
// Only necessary for those resource types that want to aggregate status to resource template.
|
||||||
InterpreterOperationAggregateStatus InterpreterOperation = "AggregateStatus"
|
InterpreterOperationAggregateStatus InterpreterOperation = "AggregateStatus"
|
||||||
|
|
||||||
// InterpreterOperationInterpretHealthy indicates that karmada want to figure out the healthy status of a specific object.
|
// 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 healthy status.
|
// Only necessary for those resource types that have and want to reflect their health status.
|
||||||
InterpreterOperationInterpretHealthy InterpreterOperation = "InterpretHealthy"
|
InterpreterOperationInterpretHealth InterpreterOperation = "InterpretHealth"
|
||||||
|
|
||||||
// InterpreterOperationInterpretDependency indicates that karmada want to figure out the dependencies of a specific object.
|
// 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
|
// Only necessary for those resource types that have dependencies resources and expect the dependencies be propagated
|
||||||
|
@ -357,9 +357,9 @@ type DependentObjectReference struct {
|
||||||
#### Configuration
|
#### Configuration
|
||||||
The example below show two webhooks 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
|
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
|
The `bar.example.com` webhook serves for `bars` under `bar.example.com` group and implemented `InterpretDependency` and
|
||||||
`InterpretHealthy` operations.
|
`InterpretHealth` operations.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: config.karmada.io/v1alpha1
|
apiVersion: config.karmada.io/v1alpha1
|
||||||
|
@ -369,7 +369,7 @@ metadata:
|
||||||
webhooks:
|
webhooks:
|
||||||
- name: foo.example.com
|
- name: foo.example.com
|
||||||
rules:
|
rules:
|
||||||
- operations: ["Retain", "InterpretHealthy"]
|
- operations: ["Retain", "InterpretHealth"]
|
||||||
apiGroups: ["foo.example.com"]
|
apiGroups: ["foo.example.com"]
|
||||||
apiVersions: ["*"]
|
apiVersions: ["*"]
|
||||||
kinds: ["Foo"]
|
kinds: ["Foo"]
|
||||||
|
@ -381,7 +381,7 @@ webhooks:
|
||||||
timeoutSeconds: 3
|
timeoutSeconds: 3
|
||||||
- name: bar.example.com
|
- name: bar.example.com
|
||||||
rules:
|
rules:
|
||||||
- operations: ["InterpretDependency", "InterpretHealthy"]
|
- operations: ["InterpretDependency", "InterpretHealth"]
|
||||||
apiGroups: ["bar.example.com"]
|
apiGroups: ["bar.example.com"]
|
||||||
apiVersions: ["*"]
|
apiVersions: ["*"]
|
||||||
kinds: ["Bar"]
|
kinds: ["Bar"]
|
||||||
|
@ -393,7 +393,7 @@ webhooks:
|
||||||
timeoutSeconds: 3
|
timeoutSeconds: 3
|
||||||
```
|
```
|
||||||
#### Request and Response
|
#### Request and Response
|
||||||
Take `InterpretHealthy` for example, Karmada will send the request like:
|
Take `InterpretHealth` for example, Karmada will send the request like:
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: config.karmada.io/v1alpha1
|
apiVersion: config.karmada.io/v1alpha1
|
||||||
kind: ResourceInterpreterContext
|
kind: ResourceInterpreterContext
|
||||||
|
@ -405,7 +405,7 @@ request:
|
||||||
Kind: Foo
|
Kind: Foo
|
||||||
- name: foo
|
- name: foo
|
||||||
- namespace: default
|
- namespace: default
|
||||||
- operation: InterpretHealthy
|
- operation: InterpretHealth
|
||||||
- object: <raw data of the object>
|
- object: <raw data of the object>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -108,9 +108,9 @@ const (
|
||||||
// Only necessary for those resource types that want to aggregate status to resource template.
|
// Only necessary for those resource types that want to aggregate status to resource template.
|
||||||
InterpreterOperationAggregateStatus InterpreterOperation = "AggregateStatus"
|
InterpreterOperationAggregateStatus InterpreterOperation = "AggregateStatus"
|
||||||
|
|
||||||
// InterpreterOperationInterpretHealthy indicates that karmada want to figure out the healthy status of a specific object.
|
// 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 healthy status.
|
// Only necessary for those resource types that have and want to reflect their health status.
|
||||||
InterpreterOperationInterpretHealthy InterpreterOperation = "InterpretHealthy"
|
InterpreterOperationInterpretHealth InterpreterOperation = "InterpretHealth"
|
||||||
|
|
||||||
// InterpreterOperationInterpretDependency indicates that karmada want to figure out the dependencies of a specific object.
|
// 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
|
// Only necessary for those resource types that have dependencies resources and expect the dependencies be propagated
|
||||||
|
|
|
@ -117,7 +117,7 @@ func verifyResourceInterpreterContext(operation configv1alpha1.InterpreterOperat
|
||||||
}
|
}
|
||||||
res.RawStatus = *response.RawStatus
|
res.RawStatus = *response.RawStatus
|
||||||
return res, nil
|
return res, nil
|
||||||
case configv1alpha1.InterpreterOperationInterpretHealthy:
|
case configv1alpha1.InterpreterOperationInterpretHealth:
|
||||||
if response.Healthy == nil {
|
if response.Healthy == nil {
|
||||||
return nil, fmt.Errorf("webhook returned nil response.healthy")
|
return nil, fmt.Errorf("webhook returned nil response.healthy")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue