Skip to content

Commit

Permalink
Merge pull request #161 from mshitrit/add-label-on-default-template
Browse files Browse the repository at this point in the history
adding label on default template
  • Loading branch information
openshift-ci[bot] authored Nov 9, 2023
2 parents b5894be + 2e4afa3 commit 5662737
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions api/v1alpha1/selfnoderemediation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
const (
ResourceDeletionRemediationStrategy = RemediationStrategyType("ResourceDeletion")
OutOfServiceTaintRemediationStrategy = RemediationStrategyType("OutOfServiceTaint")
DefaultRemediationStrategy = ResourceDeletionRemediationStrategy
// ProcessingConditionType is the condition type used to signal NHC the remediation status
ProcessingConditionType = "Processing"
// SucceededConditionType is the condition type used to signal NHC whether the remediation was successful or not
Expand Down
11 changes: 8 additions & 3 deletions api/v1alpha1/selfnoderemediationtemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ limitations under the License.
package v1alpha1

import (
"github.com/medik8s/common/pkg/labels"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
resourceDeletionTemplateName = "self-node-remediation-resource-deletion-template"
defaultTemplateName = "self-node-remediation-resource-deletion-template"
)

// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
Expand Down Expand Up @@ -71,15 +73,18 @@ func init() {
}

func NewRemediationTemplates() []*SelfNodeRemediationTemplate {
templateLabels := make(map[string]string)
templateLabels[labels.DefaultTemplate] = "true"
return []*SelfNodeRemediationTemplate{
{
ObjectMeta: metav1.ObjectMeta{
Name: resourceDeletionTemplateName,
Name: defaultTemplateName,
Labels: templateLabels,
},
Spec: SelfNodeRemediationTemplateSpec{
Template: SelfNodeRemediationTemplateResource{
Spec: SelfNodeRemediationSpec{
RemediationStrategy: ResourceDeletionRemediationStrategy,
RemediationStrategy: DefaultRemediationStrategy,
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/go-logr/logr v1.2.3
github.com/go-ping/ping v1.1.0
github.com/medik8s/common v1.9.0
github.com/medik8s/common v1.10.0
github.com/onsi/ginkgo/v2 v2.9.1
github.com/onsi/gomega v1.27.4
github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7 // release-4.13
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.2 h1:hAHbPm5IJGijwng3PWk09JkG9WeqChjprR5s9bBZ+OM=
github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/medik8s/common v1.9.0 h1:nMMffmj+e0l0xRB0RfpsbdDpW9upXU2MFeGGADJlwyE=
github.com/medik8s/common v1.9.0/go.mod h1:ZT/3hfMXJLmZEcqmxRWB5LGC8Wl+qKGGQ4zM8hOE7PY=
github.com/medik8s/common v1.10.0 h1:ghvW/Kiv9xdkJbFhzeh38dSmx0ltoZNT7cHrCh3WpX4=
github.com/medik8s/common v1.10.0/go.mod h1:ZT/3hfMXJLmZEcqmxRWB5LGC8Wl+qKGGQ4zM8hOE7PY=
github.com/mitchellh/copystructure v1.1.2 h1:Th2TIvG1+6ma3e/0/bopBKohOTY7s4dA8V2q4EUcBJ0=
github.com/mitchellh/copystructure v1.1.2/go.mod h1:EBArHfARyrSWO/+Wyr9zwEkc6XMFB9XyNgFNmRkZZU4=
github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE=
Expand Down
2 changes: 2 additions & 0 deletions vendor/github.com/medik8s/common/pkg/labels/labels.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ github.com/mailru/easyjson/jwriter
# github.com/matttproud/golang_protobuf_extensions v1.0.2
## explicit; go 1.9
github.com/matttproud/golang_protobuf_extensions/pbutil
# github.com/medik8s/common v1.9.0
# github.com/medik8s/common v1.10.0
## explicit; go 1.20
github.com/medik8s/common/pkg/labels
github.com/medik8s/common/pkg/nodes
Expand Down

0 comments on commit 5662737

Please sign in to comment.