Skip to content

Commit

Permalink
Remove the default_to_predeployed function from previous iterations…
Browse files Browse the repository at this point in the history
… on this PR

Also add CRDs and CRs to their previous functionality, not using the `default_to_predeployed` functionality
  • Loading branch information
c-gerke committed Dec 3, 2024
1 parent 5016db4 commit bfd40a7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
10 changes: 1 addition & 9 deletions lib/krane/kubernetes_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -395,15 +395,7 @@ def use_generated_name(instance_data)

def predeployed?
predeployed = krane_annotation_value("predeployed")
if PREDEPLOYED_RESOURCE_TYPES.include?(type)
true
else
default_to_predeployed? ? (predeployed != "false") : (predeployed == "true")
end
end

def default_to_predeployed?
false
PREDEPLOYED_RESOURCE_TYPES.include?(type) || predeployed == "true"
end

class Event
Expand Down
9 changes: 5 additions & 4 deletions lib/krane/kubernetes_resource/custom_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ def type
kind
end

def predeployed?
predeployed = krane_annotation_value("predeployed")
predeployed.nil? || predeployed == "true"
end

def validate_definition(*, **)
super

Expand All @@ -74,10 +79,6 @@ def validate_definition(*, **)
"Validation failed with: #{e}"
end

def default_to_predeployed?
true
end

private

def kind
Expand Down
9 changes: 3 additions & 6 deletions lib/krane/kubernetes_resource/custom_resource_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ def prunable?
prunable == "true"
end

def default_to_predeployed?
true
def predeployed?
predeployed = krane_annotation_value("predeployed")
predeployed.nil? || predeployed == "true"
end

def rollout_conditions
Expand Down Expand Up @@ -89,10 +90,6 @@ def validate_rollout_conditions
@rollout_conditions_validated = true
end

def default_to_predeployed?
true
end

private

def names_accepted_condition
Expand Down

0 comments on commit bfd40a7

Please sign in to comment.