Skip to content

Instantly share code, notes, and snippets.

@hkdsun
Last active October 30, 2020 17:47
Show Gist options
  • Save hkdsun/87d2e2ed942a0b167b876e730910293e to your computer and use it in GitHub Desktop.
Save hkdsun/87d2e2ed942a0b167b876e730910293e to your computer and use it in GitHub Desktop.
require 'json'
suffixes = %w(ahwi8l eefei2 theu4d ueng9m hoot3k quach7 weesh5 phey8v ahsh6s xoh3ee abegh8
la0tei ii2ohm ahz4bi oiban5 jeiz3i ui2cho aidee3 maghu3 om1tah foo5ui enu7ih
cho6pu mau2vi pai9ka ughan6 phe9th eej4ja wie6ei xeeb5r tha7ei meip5z shie4e
oosi4g dee9ub eizoh5 hosai5 bue0ii oov0ec oe7zei yei7ph quut0i baij2g kaep6l
aid6iv aim0ra heeth8 xah3fe soh1ae ohzai1 ahgoo8 moh9uo zei5ae ko8lij sach3w
lohv1h meek2e gen3ee ho1uho cie5sh dah7mi aech7a chi6ah duboh4 phef7m eihis7
rolee4 johc4o nee8ae di6ief eiph5a ulut7h mat8ae eikoo4 oe1iez aed1ux iek1gi
ejee6x ga2sho eib4lo dei1ie thi0qu vo5vo3 ing1li chu6ae eev2yu athoh0 iv7xoh
eigae1 ohcoh9 fei5ai taice5 te7pha ie3ahg eivae1 ka0ief osai6m shae4e kee3te
aeg4ie ieloh2 boog2j gaiqu4 eigh7v eet3ie aeghe4 wavoo9 ie2jo4 she1xa phai3o
he6qua vei8ch xu3wo3 yielo7 lev0eu yoos8e ar3the duf9wa vu4wuu ainee9 eefae8
pe8zae zoo3ie has7au zei5ch oosha8 eer1ie ahtea7 ebahy8 iebao7 ref2at xe1aen
ve0doe ee3ea6 oalas7 eer1ah ieha2w aeng7c shee8j gee9su an4oek ci3eeg kiel2i
vah8uj uo4xie ir1eli uvai5o iemu0e ui8pai iecho8 jaequ1 nae6ke ohqu2m eil8ur
aitoa2 joh7zi iex4ko exeel9 voqu8s eboox8 yeiph0 al6ohp aiw8ru phahh8 ou9ohh
ooch9z ohsu4z phoh8w aig7ku fu9aig xah5po cel7eu xit5nu chah2a un6aez aehoh5
ahw0ch etui6o oxoh9j shait9 ainee8 na8pey iej7zu ahbi4l yij8yo ehohs0 goo6ie
eeh3fo li2eeb veev8e chaew9 ofah2y fij1ah dai7jo hahqu3 wah3ae eeti3d riqu4k
voch3a geeng9 aech1c eo4ach aesok1 aoth5u ag2shu eey1ma kiuj2x ais0oh aaf0xo
qui2n toh6th oom6da iewe1j poh4po thohb7 chiex8 maca3g eem6ah mies6u lo8eic taew6m
teesh4 ealei0 miu1aw aga9qu co7eet pein2e ak1eew viqu1u ue0aem bi8oor vooy0u
tahsh1 neej5t et8aht be0bie kied1o aeze5z ohr6oh wo0eob rae0gu ohgh6h zey6ai
eichu4 fohgh7 shool8 lea0eg een4uw ukoh1a eef9oo chefo6 gei3zu mooci3 udoo1i
cei7ap aixoh3 ci5va2 phapi6 yough5 gahpu2 ue8dah dok9wa cinee4 tah4mu iel7wa
ih7yoo aihah3 eeboh8 aeb3ru ew5eem beih1e aquog9 ood0ie sei6ku eu5aed pe7dok
oy3ahm ach8go veif5e phaa0n ohvee8 ic4aun oah3gu loo1ca ong0ti cah7oh oomae9
nies3i haexo8 eezai7 pie9vi ophah2 eix9ei lohm2p ifo9mo gie3hu ohu5be ohqua9
tah3ou aex7oe gumeh3 wahch5 eezee9 shaet4 ce8eir phee1y fo5aex hee6ph eigh4o
de6da9 ooji2g ohy6th quoh5g zoh2oo quoh8a mai2ai being3 phe1si phah8y kee1ho
oxohp5 aix8ne chie6l iolai0 ieba9c ziet4d in8iat dahn3e eith0a kiul4o zafae8
caa4bi hu5foo iex6yi iech3o ei7cho looj7u yaf6ae cheib0 oohoh8 yah7ph pai0sh
xai2be chej0u ul0rae eehae8 aes4ah fah8ah ohw3ee nai8oo thah5f lenae1 ceeth3
eir4to ro5aod oz5yai ahgie7 phi9sh sha5ai doy6go ieyie3 ju2ooz ieth8i iequ9t
ouf3oo ne2oow ohhaz4 loo4ki ahziw4 joo0oo ohgh5c quei5c eegh0u ohz2so ahkee0
was9me wunei0 zeezo4 esei4h oob4ie topae9 aif5we roh9li aux5wi thaig1 phae9y
ahrie4 gud8ou ieng5a zah8ne qua6hi oor2ee aing4f ahdah9 aihae5 aes0on tae8oo
mei7ie oowa3s xoo0ei thi0ew aetei5 jat5am yei0oh ahl0ie au3pho quael1 kiev6x
zohm2y xod6ru eitu9i taim7t soh6te bim2io eev0pa ahno8l ieyie6 uef4bu ahz9da
pha3ah mo9dul iec2gu iaquu1 gie7do fipie1 eelie1 aefe6r kiu1oo iu2eoy kaey0f)
suffixes = suffixes.uniq
tiers = ['good-tier', 'bad-tier']
locations = ['us-east1', 'us-west1', 'us-central1', 'us-australia1']
clusters = []
tiers.each do |tier|
name= nil
locations.each do |location|
(3..6).to_a.sample.times do
group = [:a, :a, :a, :b].sample
name = "cluster-group:#{group}-#{location}-#{suffixes.shift}"
clusters << {
"name": "#{name}",
"namespaces": {
"foo-bar-service-production": {
"namespace_dirs": ["config/deploy/production"],
"bindings": {},
"labels": {},
"options": [],
"env": {},
"timeout": 20,
"dir": "123/#{name}/foo-bar-service-production"
}
},
"location": "#{location}",
"project": "shopify-testing",
"cluster_labels": {
"tier": "good",
"group": group,
}
}
end
name = "special-#{name}-#{suffixes.shift}"
clusters << {
"name": "#{name}",
"namespaces": {
"foo-bar-service-production": {
"namespace_dirs": ["config/deploy/production"],
"bindings": {},
"labels": {},
"options": [],
"env": {},
"timeout": 20,
"dir": "123/#{name}/foo-bar-service-production"
}
},
"location": "#{location}",
"project": "shopify-testing",
"cluster_labels": {
"tier": "bad",
"group": "#{[:a, :a, :a, :a].sample}",
}
}
end
end
File.write("test/fixtures/registry_query_multi_cluster_core_multi_region_response.json", JSON.pretty_generate(clusters))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment