Skip to content

Commit

Permalink
changed patch type name to workarounf osdk issue
Browse files Browse the repository at this point in the history
Signed-off-by: raffaelespazzoli <raffaele.spazzoli@gmail.com>
  • Loading branch information
raffaelespazzoli committed Dec 14, 2021
1 parent 863a1e6 commit c87b639
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion api/v1alpha1/enforcingpatch_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type EnforcingPatchSpec struct {

// Patches is a list of pacthes that should be encforced at runtime.
// +kubebuilder:validation:Optional
Patches map[string]Patch `json:"patches,omitempty"`
Patches map[string]PatchSpec `json:"patches,omitempty"`
}

// EnforcingPatchStatus defines the observed state of EnforcingPatch
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/lockedpatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

// Patch describes a patch to be enforced at runtime
// +k8s:openapi-gen=true
type Patch struct {
type PatchSpec struct {
//Name represents a unique name for this patch, it has no particular effect, except for internal bookeeping

// SourceObjectRefs is an arrays of refereces to source objects that will be used as input for the template processing. These refernces must resolve to single instance. The resolution rule is as follows (+ present, - absent):
Expand Down
10 changes: 5 additions & 5 deletions api/v1alpha1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func GetLockedPatchesFromLockedPatcheSet(lockedPatchSet *strset.Set, lockedPatch
}

//GetLockedPatches returns a slice of LockedPatches from a slice of apis.Patches
func GetLockedPatches(patches map[string]utilsapi.Patch, config *rest.Config, logger logr.Logger) ([]LockedPatch, error) {
func GetLockedPatches(patches map[string]utilsapi.PatchSpec, config *rest.Config, logger logr.Logger) ([]LockedPatch, error) {
lockedPatches := []LockedPatch{}
for key, patch := range patches {
template, err := template.New(patch.PatchTemplate).Funcs(utilstemplate.AdvancedTemplateFuncMap(config, logger)).Parse(patch.PatchTemplate)
Expand Down

0 comments on commit c87b639

Please sign in to comment.