Skip to content

Commit

Permalink
fix: component probe create failure
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhangSetSail committed Dec 19, 2023
1 parent b8fc897 commit 0278059
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions worker/appm/conversion/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ func createPorts(as *v1.AppService, dbmanager db.Manager) (ports []corev1.Contai

func createProbe(as *v1.AppService, dbmanager db.Manager, mode string) *corev1.Probe {
if mode == "liveness" {
var probe *corev1.Probe
probe := new(corev1.Probe)
probeAttribute, err := dbmanager.ComponentK8sAttributeDao().GetByComponentIDAndName(as.ServiceID, model.K8sAttributeNameLiveNessProbe)
if probeAttribute != nil && probeAttribute.AttributeValue != "" {
err = yaml.Unmarshal([]byte(probeAttribute.AttributeValue), probe)
Expand All @@ -876,7 +876,7 @@ func createProbe(as *v1.AppService, dbmanager db.Manager, mode string) *corev1.P
return probe
}
} else {
var probe *corev1.Probe
probe := new(corev1.Probe)
probeAttribute, err := dbmanager.ComponentK8sAttributeDao().GetByComponentIDAndName(as.ServiceID, model.K8sAttributeNameReadinessProbe)
if probeAttribute != nil && probeAttribute.AttributeValue != "" {
err = yaml.Unmarshal([]byte(probeAttribute.AttributeValue), probe)
Expand Down

0 comments on commit 0278059

Please sign in to comment.