Skip to content

Commit

Permalink
annotation saving test
Browse files Browse the repository at this point in the history
  • Loading branch information
liu-samuel committed Jul 1, 2024
1 parent ff46c70 commit c392960
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ def assert_specific_container_group(expected_extra_tags: [])
:dns_policy => "ClusterFirst",
:phase => "Running"
)
expect(@containergroup.annotations).to contain_exactly(
annotation_with_name_value("name", "kubernetes.io/created-by")
)
expect(@containergroup.labels).to contain_exactly(
label_with_name_value("name", "heapster")
)
Expand Down Expand Up @@ -203,6 +206,10 @@ def assert_specific_container_node
:max_container_groups => 40
)

# expect(@containernode.annotations).to contain_exactly(
# annotation_with_name_value("name", "machineconfiguration.openshift.io/desiredConfig")
# )

@containernodeconditions = ContainerCondition.where(:container_entity_type => "ContainerNode")
expect(@containernodeconditions.count).to eq(2)
expect(@containernodeconditions.first).to have_attributes(
Expand Down Expand Up @@ -253,6 +260,10 @@ def assert_specific_container_service
label_with_name_value("provider", "kubernetes"),
label_with_name_value("component", "apiserver")
)
# expect(@containersrv.annotations).to contain_exactly(
# annotation_with_name_value("provider", "kubernetes"),
# annotation_with_name_value("component", "apiserver")
# )
expect(@containersrv.selector_parts.count).to eq(0)

@confs = @containersrv.container_service_port_configs
Expand Down Expand Up @@ -407,6 +418,13 @@ def label_with_name_value(name, value)
)
end

def annotation_with_name_value(name, value)
an_object_having_attributes(
:section => 'annotations', :source => 'kubernetes',
:name => name, :value => value
)
end

def tag_in_category_with_description(category, description)
satisfy { |tag| tag.category == category && tag.classification.description == description }
end
Expand Down

0 comments on commit c392960

Please sign in to comment.