Пример #1
0
func createConsulStub() {
	By("creating the consul overrides stub")
	consulStub := fmt.Sprintf(`---
name_overrides:
  release_name: %s
  deployment_name: %s
`, consulRelease, consulDeployment)

	consulNameOverrideStub = helpers.WriteStub(consulStub)
}
func createEtcdStub() {
	By("creating the etcd overrides stub")
	etcdStub := fmt.Sprintf(`---
name_overrides:
  release_name: %s
  deployment_name: %s
`, etcdRelease, etcdDeployment)

	etcdNameOverrideStub = helpers.WriteStub(etcdStub)
}
func createTurbulenceStub() {
	By("creating the turbulence overrides stub")
	turbulenceStub := fmt.Sprintf(`---
name_overrides:
  deployment_name: %s
  turbulence:
    release_name: %s
  cpi:
    release_name: %s
`, turbulenceDeployment, config.TurbulenceReleaseName, config.CPIReleaseName)

	turbulenceNameOverrideStub = helpers.WriteStub(turbulenceStub)
}
		_, err := keyValueClient.Put(pair, nil)
		Expect(err).ToNot(HaveOccurred())

		resultPair, _, err := keyValueClient.Get(consatsKey, nil)
		Expect(err).ToNot(HaveOccurred())
		Expect(resultPair.Value).To(Equal(consatsValue))

		// generate new stub that overwrites a property
		consulStub := fmt.Sprintf(`---
property_overrides:
  consul:
    server_cert: something different
    require_ssl: false
`)

		consulRollingDeployStub := helpers.WriteStub(consulStub)

		bosh.GenerateAndSetDeploymentManifest(
			consulManifest,
			consulManifestGeneration,
			directorUUIDStub,
			helpers.InstanceCount3NodesStubPath,
			helpers.PersistentDiskStubPath,
			config.IAASSettingsConsulStubPath,
			consulRollingDeployStub,
			consulNameOverrideStub,
		)

		By("deploying")
		Expect(bosh.Command("-n", "deploy")).To(gexec.Exit(0))
		eatsValue := "eats-value"

		response, err := etcdClient.Create(eatsKey, eatsValue, 6000)
		Expect(err).ToNot(HaveOccurred())
		Expect(response).ToNot(BeNil())

		// generate new stub that overwrites a property
		etcdStub := fmt.Sprintf(`---
property_overrides:
  etcd:
    heartbeat_interval_in_milliseconds: 51
    require_ssl: false
    peer_require_ssl: false
`)

		etcdRollingDeployStub := helpers.WriteStub(etcdStub)

		bosh.GenerateAndSetDeploymentManifest(
			etcdManifest,
			etcdManifestGeneration,
			directorUUIDStub,
			helpers.InstanceCount3NodesStubPath,
			helpers.PersistentDiskStubPath,
			config.IAASSettingsEtcdStubPath,
			etcdRollingDeployStub,
			etcdNameOverrideStub,
		)

		By("deploying")
		Expect(bosh.Command("-n", "deploy")).To(Exit(0))