Skip to content
This repository was archived by the owner on Mar 16, 2024. It is now read-only.

Commit 3ff4592

Browse files
Merge pull request #2358 from ibuildthecloud/main
Support .d dirs for acornfiles
2 parents 9004245 + 9af321d commit 3ff4592

File tree

6 files changed

+27
-4
lines changed

6 files changed

+27
-4
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ replace (
1212
require (
1313
cuelang.org/go v0.6.0
1414
github.com/AlecAivazis/survey/v2 v2.3.6
15-
github.com/acorn-io/aml v0.0.0-20231117162239-064dc5b61b1f
15+
github.com/acorn-io/aml v0.0.0-20231122062516-f2ffb1e58cbd
1616
github.com/acorn-io/aml/cli v0.0.0-20231113171943-4844e2f3e1a2
1717
github.com/acorn-io/aml/legacy v0.0.0-20230929081514-1e9f3394432e
1818
github.com/acorn-io/baaah v0.0.0-20231009165317-af2b68361b8a

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpH
109109
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo=
110110
github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ=
111111
github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
112-
github.com/acorn-io/aml v0.0.0-20231117162239-064dc5b61b1f h1:On6X24Ln2wHjQGwTNcZ6pIT8d88VjiF9zcRCXXEVjq8=
113-
github.com/acorn-io/aml v0.0.0-20231117162239-064dc5b61b1f/go.mod h1:jImvyZGYOReKDJEEjS2SLjvVAEFcXFMA7OPQ96l1JYA=
112+
github.com/acorn-io/aml v0.0.0-20231122062516-f2ffb1e58cbd h1:VfEyBeMeEXaz0R7KPZxkU9QKIfFuBWempchm4OAUXTU=
113+
github.com/acorn-io/aml v0.0.0-20231122062516-f2ffb1e58cbd/go.mod h1:jImvyZGYOReKDJEEjS2SLjvVAEFcXFMA7OPQ96l1JYA=
114114
github.com/acorn-io/aml/cli v0.0.0-20231113171943-4844e2f3e1a2 h1:CtflOEPAvtpALuC3SM1WApsfTuECXcDuq25E3fZaPdg=
115115
github.com/acorn-io/aml/cli v0.0.0-20231113171943-4844e2f3e1a2/go.mod h1:D4tWmJlLdsmMbQ/MI4T+Tj4j2PjgTAdde2QDGkeWH20=
116116
github.com/acorn-io/aml/legacy v0.0.0-20230929081514-1e9f3394432e h1:W67DG9AcoNvBwIOR9OFUCZlSJBaHuvM2kXQ2+C6EnLk=

pkg/imagesource/helper.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ func (i ImageSource) ResolveImageAndFile() (string, string, error) {
159159
if isDir {
160160
if st, err := os.Stat(filepath.Join(i.Image, "Acorndir")); err == nil && st.IsDir() {
161161
i.File = filepath.Join(i.Image, "Acorndir")
162+
} else if st, err := os.Stat(filepath.Join(i.Image, "Acornfile.d")); err == nil && st.IsDir() {
163+
if _, err := os.Stat("Acornfile"); err == nil {
164+
i.File = filepath.Join(i.Image, "Acornfile")
165+
} else {
166+
i.File = filepath.Join(i.Image, "Acornfile.d")
167+
}
162168
} else {
163169
i.File = filepath.Join(i.Image, "Acornfile")
164170
}

pkg/log/default_log.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ func (d *DefaultLoggerImpl) AppStatus(ready bool, msg string, app *apiv1.App) {
5959
}
6060

6161
func (d *DefaultLoggerImpl) Container(timeStamp metav1.Time, containerName, line string) {
62+
d.lock.Lock()
63+
defer d.lock.Unlock()
6264
color, ok := d.containerColors[containerName]
6365
if !ok {
6466
color = nextColor()

pkg/login/login.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,23 @@ func createSecret(ctx context.Context, c client.Client, app *apiv1.App, secretNa
102102
return err
103103
}
104104

105+
asked := map[string]struct{}{}
105106
data := map[string][]byte{}
107+
promptOrder, _ := app.Status.AppSpec.Secrets[secretName].Params.GetData()["promptOrder"].([]string)
108+
for _, key := range promptOrder {
109+
if _, ok := app.Status.AppSpec.Secrets[secretName].Data[key]; ok {
110+
value, err := prompt.Password(key)
111+
if err != nil {
112+
return err
113+
}
114+
data[key] = value
115+
asked[key] = struct{}{}
116+
}
117+
}
106118
for _, key := range typed.SortedKeys(app.Status.AppSpec.Secrets[secretName].Data) {
119+
if _, asked := asked[key]; asked {
120+
continue
121+
}
107122
value, err := prompt.Password(key)
108123
if err != nil {
109124
return err

pkg/secrets/interpolation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ func (i *Interpolator) serviceProperty(svc *v1.ServiceInstance, prop string, ext
339339
}
340340
return "", &ErrInterpolation{
341341
ExpressionError: v1.ExpressionError{
342-
Error: fmt.Sprintf("endpoint on service [%s] undefined", svc.Name),
342+
Error: fmt.Sprintf("endpoint on service [%s] undefined, check that at least one port as marked as published", svc.Name),
343343
},
344344
}
345345
case "address", "host", "hostname":

0 commit comments

Comments
 (0)