Commit 41994327 authored by Patrick Bajao's avatar Patrick Bajao

Merge branch 'gql-fix-network-policies-updated-at' into 'master'

Format network policies update time

See merge request gitlab-org/gitlab!64205
parents 9874b6bd 6020f38c
...@@ -26,7 +26,7 @@ module Resolvers ...@@ -26,7 +26,7 @@ module Resolvers
{ {
name: policy_json[:name], name: policy_json[:name],
namespace: policy_json[:namespace], namespace: policy_json[:namespace],
updated_at: policy_json[:creation_timestamp], updated_at: Time.iso8601(policy_json[:creation_timestamp]),
yaml: policy_json[:manifest], yaml: policy_json[:manifest],
from_auto_devops: policy_json[:is_autodevops], from_auto_devops: policy_json[:is_autodevops],
enabled: policy_json[:is_enabled] enabled: policy_json[:is_enabled]
......
...@@ -8,13 +8,13 @@ RSpec.describe Resolvers::NetworkPolicyResolver do ...@@ -8,13 +8,13 @@ RSpec.describe Resolvers::NetworkPolicyResolver do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let(:user) { project.owner } let(:user) { project.owner }
let(:time_now) { Time.current } let(:time_now) { Time.utc(2021, 6, 16) }
let(:policy) do let(:policy) do
Gitlab::Kubernetes::NetworkPolicy.new( Gitlab::Kubernetes::NetworkPolicy.new(
name: 'policy', name: 'policy',
namespace: 'another', namespace: 'another',
creation_timestamp: time_now, creation_timestamp: time_now.iso8601,
selector: { matchLabels: { role: 'db' } }, selector: { matchLabels: { role: 'db' } },
ingress: [{ from: [{ namespaceSelector: { matchLabels: { project: 'myproject' } } }] }] ingress: [{ from: [{ namespaceSelector: { matchLabels: { project: 'myproject' } } }] }]
) )
...@@ -24,7 +24,7 @@ RSpec.describe Resolvers::NetworkPolicyResolver do ...@@ -24,7 +24,7 @@ RSpec.describe Resolvers::NetworkPolicyResolver do
Gitlab::Kubernetes::CiliumNetworkPolicy.new( Gitlab::Kubernetes::CiliumNetworkPolicy.new(
name: 'cilium_policy', name: 'cilium_policy',
namespace: 'another', namespace: 'another',
creation_timestamp: time_now, creation_timestamp: time_now.iso8601,
resource_version: '102', resource_version: '102',
selector: { matchLabels: { role: 'db' } }, selector: { matchLabels: { role: 'db' } },
ingress: [{ endpointFrom: [{ matchLabels: { project: 'myproject' } }] }] ingress: [{ endpointFrom: [{ matchLabels: { project: 'myproject' } }] }]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment