func (l Hostname) Apply(bndl goci.Bndl, spec gardener.DesiredContainerSpec) goci.Bndl { hostname := spec.Hostname if len(hostname) > 49 { hostname = hostname[len(hostname)-49:] } return bndl.WithHostname(hostname) }
var _ = Describe("Bundle", func() { var initialBundle goci.Bndl var returnedBundle goci.Bndl BeforeEach(func() { initialBundle = goci.Bundle() }) It("specifies the correct version", func() { Expect(initialBundle.Spec.Version).To(Equal("0.2.0")) }) Describe("WithHostname", func() { It("sets the Hostname in the bundle", func() { returnedBundle := initialBundle.WithHostname("hostname") Expect(returnedBundle.Hostname()).To(Equal("hostname")) }) }) Describe("WithCapabilities", func() { It("adds capabilities to the bundle", func() { returnedBundle := initialBundle.WithCapabilities("growtulips", "waterspuds") Expect(returnedBundle.Capabilities()).To(ContainElement("growtulips")) Expect(returnedBundle.Capabilities()).To(ContainElement("waterspuds")) }) It("does not modify the initial bundle", func() { returnedBundle := initialBundle.WithCapabilities("growtulips", "waterspuds") Expect(returnedBundle).NotTo(Equal(initialBundle)) })