Example #1
0
func (t *ETCDHelper) SetRawDomain(domain string) {
	_, err := t.client.Set(etcddb.DomainSchemaPath(domain), []byte{}, 0)
	Expect(err).NotTo(HaveOccurred())
}
				for rows.Next() {
					var tableName string
					err := rows.Scan(&tableName)
					Expect(err).NotTo(HaveOccurred())
					tables = append(tables, tableName)
				}
				Expect(tables).To(ContainElement("domains"))
				Expect(tables).To(ContainElement("desired_lrps"))
				Expect(tables).To(ContainElement("actual_lrps"))
				Expect(tables).To(ContainElement("tasks"))
			})
		})

		Describe("Domains", func() {
			BeforeEach(func() {
				_, err := storeClient.Set(etcddb.DomainSchemaPath("domain-1"), []byte(""), 100)
				Expect(err).NotTo(HaveOccurred())
				_, err = storeClient.Set(etcddb.DomainSchemaPath("domain-2"), []byte(""), 100)
				Expect(err).NotTo(HaveOccurred())
			})

			It("creates a domain entry in sql for each domain in etcd", func() {
				Expect(migrationErr).NotTo(HaveOccurred())

				rows, err := rawSQLDB.Query(`SELECT domain, expire_time FROM domains`)
				Expect(err).NotTo(HaveOccurred())
				defer rows.Close()

				domains := map[string]int64{}
				for rows.Next() {
					var domain string