diff --git a/CHANGELOG.md b/CHANGELOG.md index d853b52207..7e5306bc7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ ### Improvements +- Enable multiple instances of Helm charts per stack (https://github.com/pulumi/pulumi-kubernetes/pull/599). - Enable multiple instances of YAML manifests per stack (https://github.com/pulumi/pulumi-kubernetes/pull/594). ### Bug fixes diff --git a/go.mod b/go.mod index 399a76a374..c96e282f30 100644 --- a/go.mod +++ b/go.mod @@ -13,12 +13,10 @@ require ( github.com/google/gofuzz v1.0.0 // indirect github.com/googleapis/gnostic v0.2.0 github.com/gophercloud/gophercloud v0.0.0-20190418141522-bb98932a7b3a // indirect - github.com/grpc/grpc-go v0.0.0-00010101000000-000000000000 // indirect github.com/imdario/mergo v0.3.7 // indirect github.com/jinzhu/copier v0.0.0-20180308034124-7e38e58719c3 github.com/json-iterator/go v1.1.6 // indirect github.com/mitchellh/go-wordwrap v1.0.0 - github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pkg/errors v0.8.1 github.com/pulumi/pulumi v0.17.15 github.com/stretchr/testify v1.2.2 @@ -31,7 +29,6 @@ require ( k8s.io/kube-openapi v0.0.0-20190418160015-6b3d3b2d5666 k8s.io/kubernetes v1.14.1 k8s.io/utils v0.0.0-20190308190857-21c4ce38f2a7 // indirect - sigs.k8s.io/kustomize v1.0.11 // indirect ) replace ( diff --git a/go.sum b/go.sum index 98c8dfc2cd..2a1211bc1f 100644 --- a/go.sum +++ b/go.sum @@ -58,12 +58,14 @@ github.com/Sirupsen/logrus v1.0.5 h1:447dy9LxSj+Iaa2uN3yoFHOzU9yJcJYiQPtNz8OXtv0 github.com/Sirupsen/logrus v1.0.5/go.mod h1:rmk17hk6i8ZSAJkSDa7nOxamrG+SP4P0mm+DAvExv4U= github.com/ahmetb/go-linq v3.0.0+incompatible h1:qQkjjOXKrKOTy83X8OpRmnKflXKQIL/mC/gMVVDMhOA= github.com/ahmetb/go-linq v3.0.0+incompatible/go.mod h1:PFffvbdbtw+QTB0WKRP0cNht7vnCfnGlEpak/DVg5cY= +github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190122153857-e0ace9b64d22/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= github.com/apache/arrow/go/arrow v0.0.0-20181031164735-a56c009257a7/go.mod h1:GjvccvtI06FGFvRU1In/maF7tKp3h7GBV9Sexo5rNPM= @@ -136,6 +138,7 @@ github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMa github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/djherbis/times v1.0.1 h1:nVRrVOTFd2r0C7wCQdIDz/fqt8yO0EEzr5f6aXfXiS0= github.com/djherbis/times v1.0.1/go.mod h1:CGMZlo255K5r4Yw0b9RRfFQpM2y7uOmxg4jm9HsaVf8= +github.com/dnaeon/go-vcr v1.0.1 h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/docker/distribution v2.6.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v0.0.0-20180422163414-57142e89befe/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= @@ -158,8 +161,10 @@ github.com/evanphx/json-patch v4.1.0+incompatible h1:K1MDoo4AZ4wU0GIU/fPmtZg7Vpz github.com/evanphx/json-patch v4.1.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fullsailor/pkcs7 v0.0.0-20180613152042-8306686428a5/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= github.com/gammazero/deque v0.0.0-20180920172122-f6adf94963e4/go.mod h1:GeIq9qoE43YdGnDXURnmKTnGg15pQz4mYkXSTChbneI= @@ -167,7 +172,9 @@ github.com/gammazero/workerpool v0.0.0-20181230203049-86a96b5d5d92/go.mod h1:w9R github.com/garyburd/redigo v1.6.0/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/getkin/kin-openapi v0.1.0/go.mod h1:+0ZtELZf+SlWH8ZdA/IeFb3L/PKOKJx8eGxAlUZ/sOU= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gliderlabs/ssh v0.1.1 h1:j3L6gSLQalDETeEg/Jg0mGY0/y/N6zI2xX1978P0Uqw= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20180728074245-46e3a41ad493/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= @@ -211,6 +218,7 @@ github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= @@ -219,6 +227,7 @@ github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSN github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/subcommands v0.0.0-20181012225330-46f0354f6315/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= @@ -309,6 +318,7 @@ github.com/hashicorp/vault-plugin-secrets-kv v0.0.0-20181106190520-2236f141171e/ github.com/hashicorp/vault-plugin-secrets-kv v0.0.0-20190115203747-edbfe287c5d9/go.mod h1:VJHHT2SC1tAPrfENQeBhLlb5FbZoKZM+oC/ROmEftz0= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/ijc25/Gotty v0.0.0-20170406111628-a8b993ba6abd h1:a0nQYN5aGC2AiAbRXGtbhFXVFEYhI8m0qm0rS4BZrlo= @@ -349,6 +359,7 @@ github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVY github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= +github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQF+M0ao65imhwqKnz3Q2z/d8PWZRMQvDM= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/kevinburke/go-bindata v3.11.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM= github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e h1:RgQk53JHp/Cjunrr1WlsXSZpqXn+uREuHvUVcK82CV8= @@ -356,11 +367,14 @@ github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e/go.mod h1:CT github.com/keybase/go-crypto v0.0.0-20181031135447-f919bfda4fc1/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/keybase/go-crypto v0.0.0-20181127160227-255a5089e85a/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -383,6 +397,7 @@ github.com/michaelklishin/rabbit-hole v1.4.0/go.mod h1:vvI1uOitYZi0O5HEGXhaWC1XT github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/miekg/dns v1.1.1/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -395,6 +410,7 @@ github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUb github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/mapstructure v1.0.0/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mna/pigeon v1.0.1-0.20180808201053-bb0192cfc2ae/go.mod h1:Iym28+kJVnC1hfQvv5MUtI6AiFFzvQjHcvI4RFTG/04= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -419,8 +435,10 @@ github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= @@ -439,7 +457,6 @@ github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtP github.com/pelletier/go-buffruneio v0.2.0 h1:U4t4R6YkofJ5xHm3dJzuRpPZ0mr5MMCoAWooScCR7aA= github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -507,6 +524,7 @@ github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYED github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.3.0 h1:hI/7Q+DtNZ2kINb6qt/lS+IyXnHQe9e90POfeewL/ME= github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -562,6 +580,7 @@ github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCO github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M= github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= +github.com/yudai/pp v2.0.1+incompatible h1:Q4//iY4pNF6yPLZIigmvcl7k/bPgrcTPIFIcmawg5bI= github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= go.etcd.io/etcd v3.3.11+incompatible/go.mod h1:yaeTdrJi5lOmYerz05bd8+V7KubZs8YSFZfzsF9A6aI= go.mongodb.org/mongo-driver v1.0.0/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= @@ -709,16 +728,20 @@ google.golang.org/grpc v1.20.1 h1:Hz2g2wirWK7H0qIIhGIqRGTuMwTE8HEKFnDZZ7lm9NU= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= gopkg.in/AlecAivazis/survey.v1 v1.4.1 h1:r9oZXE7hF7CsbiHdgGBEVIvy4E6QH64gQ+UGugPCPtI= gopkg.in/AlecAivazis/survey.v1 v1.4.1/go.mod h1:2Ehl7OqkBl3Xb8VmC4oFW2bItAhnUfzIjrOzwRxCrOU= +gopkg.in/airbrake/gobrake.v2 v2.0.9 h1:7z2uVWwn7oVeeugY1DtlPAy5H+KYgB1KeKTnqjNatLo= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20170511165959-379148ca0225/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/fatih/pool.v2 v2.0.0/go.mod h1:8xVGeu1/2jr2wm5V9SPuMht2H5AEmf5aFMGSQixtjTY= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 h1:OAj3g0cR6Dx/R07QgQe8wkA9RNjB2u4i700xBkIT4e0= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/gorethink/gorethink.v4 v4.1.0/go.mod h1:M7JgwrUAmshJ3iUbEK0Pt049MPyPK+CYDGGaEjdZb/c= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= @@ -734,9 +757,11 @@ gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76 gopkg.in/src-d/go-billy.v4 v4.2.1 h1:omN5CrMrMcQ+4I8bJ0wEhOBPanIRWzFC953IiXKdYzo= gopkg.in/src-d/go-billy.v4 v4.2.1/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk= gopkg.in/src-d/go-git-fixtures.v3 v3.1.1/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= +gopkg.in/src-d/go-git-fixtures.v3 v3.4.0 h1:KFpaNTUcLHLoP/OkdcRXR+MA5p55MhA41YVb7Wd8EfM= gopkg.in/src-d/go-git-fixtures.v3 v3.4.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= gopkg.in/src-d/go-git.v4 v4.8.1 h1:aAyBmkdE1QUUEHcP4YFCGKmsMQRAuRmUcPEQR7lOAa0= gopkg.in/src-d/go-git.v4 v4.8.1/go.mod h1:Vtut8izDyrM8BUVQnzJ+YvmNcem2J89EmfZYCkLokZk= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/vmihailenco/msgpack.v2 v2.9.1/go.mod h1:/3Dn1Npt9+MYyLpYYXjInO/5jvMLamn+AEGwNEOatn8= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= @@ -774,7 +799,6 @@ k8s.io/utils v0.0.0-20190308190857-21c4ce38f2a7/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3 layeh.com/radius v0.0.0-20190118135028-0f678f039617/go.mod h1:fywZKyu//X7iRzaxLgPWsvc0L26IUpVvE/aeIL2JtIQ= pack.ag/amqp v0.8.0/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= pack.ag/amqp v0.10.2/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= -sigs.k8s.io/kustomize v1.0.11/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= sigs.k8s.io/structured-merge-diff v0.0.0-20181214233322-d43a45b8663b/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/pkg/gen/python-templates/helm/v2/helm.py b/pkg/gen/python-templates/helm/v2/helm.py index 3b5ac459d9..0afaf207d1 100644 --- a/pkg/gen/python-templates/helm/v2/helm.py +++ b/pkg/gen/python-templates/helm/v2/helm.py @@ -158,17 +158,7 @@ def __init__(self, self.verify = verify -class ChartOpts: - """ - ChartOpts is a bag of configuration options for a remote Helm chart. - """ - - chart: pulumi.Input[str] - """ - The chart to deploy. If [repo] is provided, this chart name is looked up in the given repository. - Otherwise, this chart name must be a fully qualified chart URL or `repo/chartname`. - """ - +class BaseChartOpts: namespace: Optional[pulumi.Input[str]] """ Optional namespace to install chart resources into. @@ -185,6 +175,43 @@ class ChartOpts: creation. Allows customization of the chart behaviour without directly modifying the chart itself. """ + resource_prefix: Optional[str] + """ + Optional prefix for the auto-generated resource names. + Example: A resource created with resource_prefix="foo" would produce a resource named "foo-resourceName". + """ + + def __init__(self, + namespace: Optional[pulumi.Input[str]] = None, + values: Optional[pulumi.Inputs] = None, + transformations: Optional[List[Callable]] = None, + resource_prefix: Optional[str] = None) -> None: + """ + :param Optional[pulumi.Input[str]] namespace: Optional namespace to install chart resources into. + :param Optional[pulumi.Inputs] values: Optional overrides for chart values. + :param Optional[List[Callable]] transformations: Optional list of transformations to apply to + resources that will be created by this chart prior to creation. Allows customization of the + chart behaviour without directly modifying the chart itself. + :param Optional[str] resource_prefix: An optional prefix for the auto-generated resource names. + Example: A resource created with resource_prefix="foo" would produce a resource named "foo-resourceName". + """ + self.namespace = namespace + self.values = values + self.transformations = transformations + self.resource_prefix = resource_prefix + + +class ChartOpts(BaseChartOpts): + """ + ChartOpts is a bag of configuration options for a remote Helm chart. + """ + + chart: pulumi.Input[str] + """ + The chart to deploy. If [repo] is provided, this chart name is looked up in the given repository. + Otherwise, this chart name must be a fully qualified chart URL or `repo/chartname`. + """ + repo: Optional[pulumi.Input[str]] """ The repository containing the desired chart. If not provided, [chart] must be a fully qualified @@ -206,6 +233,7 @@ def __init__(self, namespace: Optional[pulumi.Input[str]] = None, values: Optional[pulumi.Inputs] = None, transformations: Optional[List[Callable]] = None, + resource_prefix: Optional[str] = None, repo: Optional[pulumi.Input[str]] = None, version: Optional[pulumi.Input[str]] = None, fetch_opts: Optional[pulumi.Input[FetchOpts]] = None) -> None: @@ -218,6 +246,8 @@ def __init__(self, :param Optional[List[Callable] transformations: Optional list of transformations to apply to resources that will be created by this chart prior to creation. Allows customization of the chart behaviour without directly modifying the chart itself. + :param Optional[str] resource_prefix: An optional prefix for the auto-generated resource names. + Example: A resource created with resource_prefix="foo" would produce a resource named "foo-resourceName". :param Optional[pulumi.Input[str]] repo: The repository containing the desired chart. If not provided, [chart] must be a fully qualified chart URL or repo/chartname. :param Optional[pulumi.Input[str]] version: The version of the chart to deploy. If not provided, @@ -225,10 +255,8 @@ def __init__(self, :param Optional[pulumi.Input[FetchOpts]] fetch_opts: Additional options to customize the fetching of the Helm chart. """ + super(ChartOpts, self).__init__(namespace, values, transformations, resource_prefix) self.chart = chart - self.namespace = namespace - self.values = values - self.transformations = transformations self.repo = repo self.version = version self.fetch_opts = fetch_opts @@ -244,27 +272,12 @@ class LocalChartOpts: The path to the chart directory which contains the `Chart.yaml` file. """ - namespace: Optional[pulumi.Input[str]] - """ - Optional namespace to install chart resources into. - """ - - values: Optional[pulumi.Inputs] - """ - Optional overrides for chart values. - """ - - transformations: Optional[List[Callable]] - """ - Optional list of transformations to apply to resources that will be created by this chart prior to - creation. Allows customization of the chart behaviour without directly modifying the chart itself. - """ - def __init__(self, path: pulumi.Input[str], namespace: Optional[pulumi.Input[str]] = None, values: Optional[pulumi.Inputs] = None, - transformations: Optional[List[Callable]] = None) -> None: + transformations: Optional[List[Callable]] = None, + resource_prefix: Optional[str] = None) -> None: """ :param pulumi.Input[str] path: The path to the chart directory which contains the `Chart.yaml` file. @@ -273,11 +286,12 @@ def __init__(self, :param Optional[List[Callable]] transformations: Optional list of transformations to apply to resources that will be created by this chart prior to creation. Allows customization of the chart behaviour without directly modifying the chart itself. + :param Optional[str] resource_prefix: An optional prefix for the auto-generated resource names. + Example: A resource created with resource_prefix="foo" would produce a resource named "foo-resourceName". """ + + super(LocalChartOpts, self).__init__(namespace, values, transformations, resource_prefix) self.path = path - self.namespace = namespace - self.values = values - self.transformations = transformations def _parse_chart(all_config: Tuple[str, Union[ChartOpts, LocalChartOpts], pulumi.ResourceOptions]) -> pulumi.Output: @@ -402,6 +416,9 @@ def __init__(self, release_name: str, __props__ = dict() + if config.resource_prefix: + release_name = f"{config.resource_prefix}-{release_name}" + super(Chart, self).__init__( "kubernetes:helm.sh/v2:Chart", release_name, diff --git a/sdk/nodejs/helm/v2/helm.ts b/sdk/nodejs/helm/v2/helm.ts index 5522084eac..8c2496a4f3 100644 --- a/sdk/nodejs/helm/v2/helm.ts +++ b/sdk/nodejs/helm/v2/helm.ts @@ -36,6 +36,12 @@ interface BaseChartOpts { * creation. Allows customization of the chart behaviour without directly modifying the chart itself. */ transformations?: ((o: any, opts: pulumi.CustomResourceOptions) => void)[]; + + /** + * An optional prefix for the auto-generated resource names. + * Example: A resource created with resourcePrefix="foo" would produce a resource named "foo-resourceName". + */ + resourcePrefix?: string } export interface ChartOpts extends BaseChartOpts { @@ -107,6 +113,9 @@ export class Chart extends yaml.CollectionComponentResource { config: ChartOpts | LocalChartOpts, opts?: pulumi.ComponentResourceOptions ) { + if (config.resourcePrefix !== undefined) { + releaseName = `${config.resourcePrefix}-${releaseName}` + } super("kubernetes:helm.sh/v2:Chart", releaseName, config, opts); const allConfig = pulumi.output(config); @@ -180,7 +189,7 @@ export class Chart extends yaml.CollectionComponentResource { parseTemplate( yamlStream: string, transformations: ((o: any, opts: pulumi.CustomResourceOptions) => void)[] | undefined, - dependsOn: pulumi.Resource[] + dependsOn: pulumi.Resource[], ): pulumi.Output<{ [key: string]: pulumi.CustomResource }> { // NOTE: We must manually split the YAML stream because of js-yaml#456. Perusing the // code and the spec, it looks like a YAML stream is delimited by `^---`, though it is @@ -196,7 +205,7 @@ export class Chart extends yaml.CollectionComponentResource { return yaml.parse( { yaml: objs.map(o => jsyaml.safeDump(o)), - transformations: transformations || [] + transformations: transformations || [], }, { parent: this, dependsOn: dependsOn } ); diff --git a/sdk/python/pulumi_kubernetes/helm/v2/helm.py b/sdk/python/pulumi_kubernetes/helm/v2/helm.py index 3b5ac459d9..0afaf207d1 100644 --- a/sdk/python/pulumi_kubernetes/helm/v2/helm.py +++ b/sdk/python/pulumi_kubernetes/helm/v2/helm.py @@ -158,17 +158,7 @@ def __init__(self, self.verify = verify -class ChartOpts: - """ - ChartOpts is a bag of configuration options for a remote Helm chart. - """ - - chart: pulumi.Input[str] - """ - The chart to deploy. If [repo] is provided, this chart name is looked up in the given repository. - Otherwise, this chart name must be a fully qualified chart URL or `repo/chartname`. - """ - +class BaseChartOpts: namespace: Optional[pulumi.Input[str]] """ Optional namespace to install chart resources into. @@ -185,6 +175,43 @@ class ChartOpts: creation. Allows customization of the chart behaviour without directly modifying the chart itself. """ + resource_prefix: Optional[str] + """ + Optional prefix for the auto-generated resource names. + Example: A resource created with resource_prefix="foo" would produce a resource named "foo-resourceName". + """ + + def __init__(self, + namespace: Optional[pulumi.Input[str]] = None, + values: Optional[pulumi.Inputs] = None, + transformations: Optional[List[Callable]] = None, + resource_prefix: Optional[str] = None) -> None: + """ + :param Optional[pulumi.Input[str]] namespace: Optional namespace to install chart resources into. + :param Optional[pulumi.Inputs] values: Optional overrides for chart values. + :param Optional[List[Callable]] transformations: Optional list of transformations to apply to + resources that will be created by this chart prior to creation. Allows customization of the + chart behaviour without directly modifying the chart itself. + :param Optional[str] resource_prefix: An optional prefix for the auto-generated resource names. + Example: A resource created with resource_prefix="foo" would produce a resource named "foo-resourceName". + """ + self.namespace = namespace + self.values = values + self.transformations = transformations + self.resource_prefix = resource_prefix + + +class ChartOpts(BaseChartOpts): + """ + ChartOpts is a bag of configuration options for a remote Helm chart. + """ + + chart: pulumi.Input[str] + """ + The chart to deploy. If [repo] is provided, this chart name is looked up in the given repository. + Otherwise, this chart name must be a fully qualified chart URL or `repo/chartname`. + """ + repo: Optional[pulumi.Input[str]] """ The repository containing the desired chart. If not provided, [chart] must be a fully qualified @@ -206,6 +233,7 @@ def __init__(self, namespace: Optional[pulumi.Input[str]] = None, values: Optional[pulumi.Inputs] = None, transformations: Optional[List[Callable]] = None, + resource_prefix: Optional[str] = None, repo: Optional[pulumi.Input[str]] = None, version: Optional[pulumi.Input[str]] = None, fetch_opts: Optional[pulumi.Input[FetchOpts]] = None) -> None: @@ -218,6 +246,8 @@ def __init__(self, :param Optional[List[Callable] transformations: Optional list of transformations to apply to resources that will be created by this chart prior to creation. Allows customization of the chart behaviour without directly modifying the chart itself. + :param Optional[str] resource_prefix: An optional prefix for the auto-generated resource names. + Example: A resource created with resource_prefix="foo" would produce a resource named "foo-resourceName". :param Optional[pulumi.Input[str]] repo: The repository containing the desired chart. If not provided, [chart] must be a fully qualified chart URL or repo/chartname. :param Optional[pulumi.Input[str]] version: The version of the chart to deploy. If not provided, @@ -225,10 +255,8 @@ def __init__(self, :param Optional[pulumi.Input[FetchOpts]] fetch_opts: Additional options to customize the fetching of the Helm chart. """ + super(ChartOpts, self).__init__(namespace, values, transformations, resource_prefix) self.chart = chart - self.namespace = namespace - self.values = values - self.transformations = transformations self.repo = repo self.version = version self.fetch_opts = fetch_opts @@ -244,27 +272,12 @@ class LocalChartOpts: The path to the chart directory which contains the `Chart.yaml` file. """ - namespace: Optional[pulumi.Input[str]] - """ - Optional namespace to install chart resources into. - """ - - values: Optional[pulumi.Inputs] - """ - Optional overrides for chart values. - """ - - transformations: Optional[List[Callable]] - """ - Optional list of transformations to apply to resources that will be created by this chart prior to - creation. Allows customization of the chart behaviour without directly modifying the chart itself. - """ - def __init__(self, path: pulumi.Input[str], namespace: Optional[pulumi.Input[str]] = None, values: Optional[pulumi.Inputs] = None, - transformations: Optional[List[Callable]] = None) -> None: + transformations: Optional[List[Callable]] = None, + resource_prefix: Optional[str] = None) -> None: """ :param pulumi.Input[str] path: The path to the chart directory which contains the `Chart.yaml` file. @@ -273,11 +286,12 @@ def __init__(self, :param Optional[List[Callable]] transformations: Optional list of transformations to apply to resources that will be created by this chart prior to creation. Allows customization of the chart behaviour without directly modifying the chart itself. + :param Optional[str] resource_prefix: An optional prefix for the auto-generated resource names. + Example: A resource created with resource_prefix="foo" would produce a resource named "foo-resourceName". """ + + super(LocalChartOpts, self).__init__(namespace, values, transformations, resource_prefix) self.path = path - self.namespace = namespace - self.values = values - self.transformations = transformations def _parse_chart(all_config: Tuple[str, Union[ChartOpts, LocalChartOpts], pulumi.ResourceOptions]) -> pulumi.Output: @@ -402,6 +416,9 @@ def __init__(self, release_name: str, __props__ = dict() + if config.resource_prefix: + release_name = f"{config.resource_prefix}-{release_name}" + super(Chart, self).__init__( "kubernetes:helm.sh/v2:Chart", release_name, diff --git a/tests/examples/examples_test.go b/tests/examples/examples_test.go index b8dc97fd82..2762a908e5 100644 --- a/tests/examples/examples_test.go +++ b/tests/examples/examples_test.go @@ -1,4 +1,16 @@ -// Copyright 2016-2018, Pulumi Corporation. All rights reserved. +// Copyright 2016-2019, Pulumi Corporation. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package examples @@ -157,7 +169,7 @@ func TestExamples(t *testing.T) { t *testing.T, stackInfo integration.RuntimeValidationStackInfo, ) { assert.NotNil(t, stackInfo.Deployment) - assert.Equal(t, 9, len(stackInfo.Deployment.Resources)) + assert.Equal(t, 15, len(stackInfo.Deployment.Resources)) }, }), diff --git a/tests/examples/helm-local/index.ts b/tests/examples/helm-local/index.ts index e94611ea95..5ff6acce82 100644 --- a/tests/examples/helm-local/index.ts +++ b/tests/examples/helm-local/index.ts @@ -18,39 +18,49 @@ import * as pulumi from "@pulumi/pulumi"; const namespace = new k8s.core.v1.Namespace("test"); const namespaceName = namespace.metadata.name; -const nginx = new k8s.helm.v2.Chart("simple-nginx-local", { - // Represents chart `stable/nginx-lego@v0.3.1`. - path: "nginx-lego", - values: { - // Override for the Chart's `values.yml` file. Use `null` to zero out resource requests so it - // can be scheduled on our (wimpy) CI cluster. (Setting these values to `null` is the "normal" - // way to delete values.) - nginx: { resources: null }, - default: { resources: null }, - lego: { resources: null } - }, - transformations: [ - // Make every service private to the cluster, i.e., turn all services into ClusterIP instead of - // LoadBalancer. - (obj: any) => { - if (obj.kind == "Service" && obj.apiVersion == "v1") { - if (obj.spec && obj.spec.type && obj.spec.type == "LoadBalancer") { - obj.spec.type = "ClusterIP"; - } - } +function chart(resourcePrefix?: string): k8s.helm.v2.Chart { + return new k8s.helm.v2.Chart("nginx-lego", { + // Represents chart `stable/nginx-lego@v0.3.1`. + path: "nginx-lego", + resourcePrefix: resourcePrefix, + values: { + // Override for the Chart's `values.yml` file. Use `null` to zero out resource requests so it + // can be scheduled on our (wimpy) CI cluster. (Setting these values to `null` is the "normal" + // way to delete values.) + nginx: {resources: null}, + default: {resources: null}, + lego: {resources: null} }, - // Put every resource in the created namespace. - (obj: any) => { - if (obj.metadata !== undefined) { - obj.metadata.namespace = namespaceName - } else { - obj.metadata = {namespace: namespaceName} + transformations: [ + // Make every service private to the cluster, i.e., turn all services into ClusterIP instead of + // LoadBalancer. + (obj: any) => { + if (obj.kind == "Service" && obj.apiVersion == "v1") { + if (obj.spec && obj.spec.type && obj.spec.type == "LoadBalancer") { + obj.spec.type = "ClusterIP"; + } + } + }, + // Put every resource in the created namespace. + (obj: any) => { + if (obj.metadata !== undefined) { + obj.metadata.namespace = namespaceName; + } else { + obj.metadata = {namespace: namespaceName}; + } } - } - ] -}); + ] + }); +} + +// Create the first instance of the Chart. +const nginx = chart(); // Export the (cluster-private) IP address of the Guestbook frontend. const frontendServiceSpec = pulumi.all([namespaceName, nginx]).apply(([nsName, nginx]) => - nginx.getResourceProperty("v1/Service", nsName, "simple-nginx-local-nginx", "spec")); + nginx.getResourceProperty("v1/Service", nsName, "nginx-lego-nginx", "spec")); export const frontendServiceIP = frontendServiceSpec.clusterIP; + +// Deploy a duplicate chart with a different resource prefix to verify that multiple instances of the Chart +// can be managed in the same stack. +chart("dup"); diff --git a/tests/examples/python/helm/__main__.py b/tests/examples/python/helm/__main__.py index 8f762b723c..a658ba9dcc 100644 --- a/tests/examples/python/helm/__main__.py +++ b/tests/examples/python/helm/__main__.py @@ -13,4 +13,8 @@ # limitations under the License. from pulumi_kubernetes.helm.v2 import Chart, ChartOpts -Chart("nginx-ingress", ChartOpts("stable/nginx-ingress")) +Chart("unbound", ChartOpts("stable/unbound")) + +# Deploy a duplicate chart with a different resource prefix to verify that multiple instances of the Chart +# can be managed in the same stack. +Chart("unbound", ChartOpts("stable/unbound", resource_prefix="dup")) diff --git a/tests/examples/python/python_test.go b/tests/examples/python/python_test.go index f8e1459b97..fc2d30ba94 100644 --- a/tests/examples/python/python_test.go +++ b/tests/examples/python/python_test.go @@ -67,7 +67,7 @@ func TestYaml(t *testing.T) { ExpectRefreshChanges: true, ExtraRuntimeValidation: func(t *testing.T, stackInfo integration.RuntimeValidationStackInfo) { assert.NotNil(t, stackInfo.Deployment) - assert.Equal(t, 24, len(stackInfo.Deployment.Resources)) + assert.Equal(t, 14, len(stackInfo.Deployment.Resources)) sort.Slice(stackInfo.Deployment.Resources, func(i, j int) bool { ri := stackInfo.Deployment.Resources[i] @@ -139,11 +139,11 @@ func TestYaml(t *testing.T) { // first ConfigFile. // Verify the provider resource. - provRes := stackInfo.Deployment.Resources[22] + provRes := stackInfo.Deployment.Resources[12] assert.True(t, providers.IsProviderType(provRes.URN.Type())) // Verify root resource. - stackRes := stackInfo.Deployment.Resources[23] + stackRes := stackInfo.Deployment.Resources[13] assert.Equal(t, resource.RootStackType, stackRes.URN.Type()) // TODO[pulumi/pulumi#2782] Testing of secrets blocked on a bug in Python support for secrets. @@ -288,7 +288,8 @@ func TestHelm(t *testing.T) { t.FailNow() } options := baseOptions.With(integration.ProgramTestOptions{ - Dir: filepath.Join(cwd, "helm"), + Dir: filepath.Join(cwd, "helm"), + ExpectRefreshChanges: true, // PodDisruptionBudget status gets updated by the Deployment. }) integration.ProgramTest(t, &options) } diff --git a/tests/examples/python/yaml-test/__main__.py b/tests/examples/python/yaml-test/__main__.py index b335632ec8..188782514c 100644 --- a/tests/examples/python/yaml-test/__main__.py +++ b/tests/examples/python/yaml-test/__main__.py @@ -43,17 +43,17 @@ def secret_status(obj, opts): ], ) -# Create resources from standard Kubernetes guestbook YAML example in the test namespace. +# Create resources from a simple YAML manifest in a test namespace. cf_url = ConfigFile( - "guestbook", - file_id="https://raw.githubusercontent.com/pulumi/pulumi-kubernetes/master/tests/examples/yaml-guestbook/yaml" - "/guestbook.yaml", + "deployment", + file_id="https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/controllers/" + "nginx-deployment.yaml", transformations=[set_namespace(ns)], ) cf_url2 = ConfigFile( - "guestbook", - file_id="https://raw.githubusercontent.com/pulumi/pulumi-kubernetes/master/tests/examples/yaml-guestbook/yaml" - "/guestbook.yaml", + "deployment", + file_id="https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/controllers/" + "nginx-deployment.yaml", transformations=[set_namespace(ns2)], resource_prefix="dup" ) diff --git a/tests/integration/yaml-url/step1/index.ts b/tests/integration/yaml-url/step1/index.ts index b12559e177..25a4d4018e 100644 --- a/tests/integration/yaml-url/step1/index.ts +++ b/tests/integration/yaml-url/step1/index.ts @@ -18,36 +18,28 @@ import * as k8s from "@pulumi/kubernetes"; const namespace = new k8s.core.v1.Namespace("test-namespace"); const namespace2 = new k8s.core.v1.Namespace("test-namespace2"); +function configFile(name: string, namespace: string, resourcePrefix?: string): k8s.yaml.ConfigFile { + return new k8s.yaml.ConfigFile(name, { + file: "https://raw.githubusercontent.com/pulumi/pulumi-kubernetes/master/tests/examples" + + "/yaml-guestbook/yaml/guestbook.yaml", + resourcePrefix: resourcePrefix, + transformations: [ + (obj: any) => { + if (obj !== undefined) { + if (obj.metadata !== undefined) { + obj.metadata.namespace = namespace; + } else { + obj.metadata = {namespace: namespace}; + } + } + } + ] + }); +} + // Create resources from standard Kubernetes guestbook YAML example in the first test namespace. -new k8s.yaml.ConfigFile("guestbook", { - file: "https://raw.githubusercontent.com/pulumi/pulumi-kubernetes/master/tests/examples/yaml-guestbook/yaml/guestbook.yaml", - transformations: [ - (obj: any) => { - if (obj !== undefined) { - if (obj.metadata !== undefined) { - obj.metadata.namespace = namespace.metadata.name; - } else { - obj.metadata = {namespace: namespace.metadata.name} - } - } - } - ] -}); +namespace.metadata.name.apply(ns => configFile("guestbook", ns)); // Create resources from standard Kubernetes guestbook YAML example in the second test namespace. // Disambiguate resource names with a specified prefix. -new k8s.yaml.ConfigFile("guestbook", { - file: "https://raw.githubusercontent.com/pulumi/pulumi-kubernetes/master/tests/examples/yaml-guestbook/yaml/guestbook.yaml", - transformations: [ - (obj: any) => { - if (obj !== undefined) { - if (obj.metadata !== undefined) { - obj.metadata.namespace = namespace2.metadata.name; - } else { - obj.metadata = {namespace: namespace2.metadata.name} - } - } - } -], - resourcePrefix: "dup" -}); +namespace2.metadata.name.apply(ns => configFile("guestbook", ns, "dup"));