Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] - sts will never be created #663

Merged
merged 2 commits into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion k8sutils/poddisruption.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func CreateOrUpdatePodDisruptionBudget(pdbDef *policyv1.PodDisruptionBudget) err
logger := pdbLogger(pdbDef.Namespace, pdbDef.Name)
storedPDB, err := GetPodDisruptionBudget(pdbDef.Namespace, pdbDef.Name)
if err != nil {
if err = patch.DefaultAnnotator.SetLastAppliedAnnotation(pdbDef); err != nil {
if err := patch.DefaultAnnotator.SetLastAppliedAnnotation(pdbDef); err != nil { //nolint
logger.Error(err, "Unable to patch redis PodDisruptionBudget with comparison object")
return err
}
Expand Down
2 changes: 1 addition & 1 deletion k8sutils/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func CreateOrUpdateService(namespace string, serviceMeta metav1.ObjectMeta, owne
storedService, err := getService(namespace, serviceMeta.Name)
if err != nil {
if errors.IsNotFound(err) {
if err = patch.DefaultAnnotator.SetLastAppliedAnnotation(serviceDef); err != nil {
if err := patch.DefaultAnnotator.SetLastAppliedAnnotation(serviceDef); err != nil { //nolint
logger.Error(err, "Unable to patch redis service with compare annotations")
}
return createService(namespace, serviceDef)
Expand Down
4 changes: 2 additions & 2 deletions k8sutils/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func CreateOrUpdateStateFul(namespace string, stsMeta metav1.ObjectMeta, params
storedStateful, err := GetStatefulSet(namespace, stsMeta.Name)
statefulSetDef := generateStatefulSetsDef(stsMeta, params, ownerDef, initcontainerParams, containerParams, getSidecars(sidecars))
if err != nil {
if err = patch.DefaultAnnotator.SetLastAppliedAnnotation(statefulSetDef); err != nil {
if err := patch.DefaultAnnotator.SetLastAppliedAnnotation(statefulSetDef); err != nil { //nolint
logger.Error(err, "Unable to patch redis statefulset with comparison object")
return err
}
Expand Down Expand Up @@ -661,7 +661,7 @@ func updateStatefulSet(namespace string, stateful *appsv1.StatefulSet, recreateS
}
logger.V(1).Info("recreating StatefulSet because the update operation wasn't possible", "reason", strings.Join(failMsg, ", "))
propagationPolicy := metav1.DeletePropagationForeground
if err = generateK8sClient().AppsV1().StatefulSets(namespace).Delete(context.TODO(), stateful.GetName(), metav1.DeleteOptions{PropagationPolicy: &propagationPolicy}); err != nil {
if err := generateK8sClient().AppsV1().StatefulSets(namespace).Delete(context.TODO(), stateful.GetName(), metav1.DeleteOptions{PropagationPolicy: &propagationPolicy}); err != nil { //nolint
return errors.Wrap(err, "failed to delete StatefulSet to avoid forbidden action")
}
}
Expand Down
Loading