-
Notifications
You must be signed in to change notification settings - Fork 160
Open
Description
I found this while I test the service qualities function.
I set state to "false" and result to "nginxok"
apiVersion: game.kruise.io/v1alpha1
kind: GameServerSet
metadata:
name: test
namespace: default
spec:
replicas: 3
gameServerTemplate:
spec:
containers:
- image: nginx: perl
name: nginx
serviceQualities:
- name: test
containerName: nginx
permanent: false
exec:
command: ["bash", "-c", "echo nginxok; exit 1"]
serviceQualityAction:
- state: false
result: nginxok
opsState: WaitToBeDeletedBut gs opsState did still “None”
And pod.status.conditions
------------------------------------------------
when I set serviceQualityAction like this:
serviceQualities:
- name: test
containerName: nginx
permanent: false
exec:
command: ["bash", "-c", "echo nginxok; exit 0"]
serviceQualityAction:
- state: true
result: nginxok
opsState: WaitToBeDeleted
it seems like when state set to "false", the result part won't work.
and I found when set state to "false", pod conditions didn't get message
these code maybe related
kruise-game-master/pkg/controllers/gameserver/gameserver_manager.go
if !exist || ((sqCondition.Status != string(podCondition.Status) || (sqCondition.Result != podConditionMessage)) && (sqCondition.LastActionTransitionTime.IsZero() || !sq.Permanent)) {
// exec action
for _, action := range sq.ServiceQualityAction {
state, err := strconv.ParseBool(string(podCondition.Status))
if err == nil && state == action.State && (action.Result == "" || podConditionMessage == action.Result) {
gs.Spec.DeletionPriority = action.DeletionPriority
gs.Spec.UpdatePriority = action.UpdatePriority
gs.Spec.OpsState = action.OpsState
gs.Spec.NetworkDisabled = action.NetworkDisabled
gs.SetLabels(util.MergeMapString(gs.GetLabels(), action.Labels))
gs.SetAnnotations(util.MergeMapString(gs.GetAnnotations(), action.Annotations))
lastActionTransitionTime = timeNow
}
}
} else {
lastActionTransitionTime = sqCondition.LastActionTransitionTime
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels