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

Commit

Permalink
Merge pull request #2358 from ibuildthecloud/main
Browse files Browse the repository at this point in the history
Support .d dirs for acornfiles
  • Loading branch information
ibuildthecloud authored Nov 22, 2023
2 parents 9004245 + 9af321d commit 3ff4592
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ replace (
require (
cuelang.org/go v0.6.0
github.com/AlecAivazis/survey/v2 v2.3.6
github.com/acorn-io/aml v0.0.0-20231117162239-064dc5b61b1f
github.com/acorn-io/aml v0.0.0-20231122062516-f2ffb1e58cbd
github.com/acorn-io/aml/cli v0.0.0-20231113171943-4844e2f3e1a2
github.com/acorn-io/aml/legacy v0.0.0-20230929081514-1e9f3394432e
github.com/acorn-io/baaah v0.0.0-20231009165317-af2b68361b8a
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpH
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo=
github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ=
github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
github.com/acorn-io/aml v0.0.0-20231117162239-064dc5b61b1f h1:On6X24Ln2wHjQGwTNcZ6pIT8d88VjiF9zcRCXXEVjq8=
github.com/acorn-io/aml v0.0.0-20231117162239-064dc5b61b1f/go.mod h1:jImvyZGYOReKDJEEjS2SLjvVAEFcXFMA7OPQ96l1JYA=
github.com/acorn-io/aml v0.0.0-20231122062516-f2ffb1e58cbd h1:VfEyBeMeEXaz0R7KPZxkU9QKIfFuBWempchm4OAUXTU=
github.com/acorn-io/aml v0.0.0-20231122062516-f2ffb1e58cbd/go.mod h1:jImvyZGYOReKDJEEjS2SLjvVAEFcXFMA7OPQ96l1JYA=
github.com/acorn-io/aml/cli v0.0.0-20231113171943-4844e2f3e1a2 h1:CtflOEPAvtpALuC3SM1WApsfTuECXcDuq25E3fZaPdg=
github.com/acorn-io/aml/cli v0.0.0-20231113171943-4844e2f3e1a2/go.mod h1:D4tWmJlLdsmMbQ/MI4T+Tj4j2PjgTAdde2QDGkeWH20=
github.com/acorn-io/aml/legacy v0.0.0-20230929081514-1e9f3394432e h1:W67DG9AcoNvBwIOR9OFUCZlSJBaHuvM2kXQ2+C6EnLk=
Expand Down
6 changes: 6 additions & 0 deletions pkg/imagesource/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ func (i ImageSource) ResolveImageAndFile() (string, string, error) {
if isDir {
if st, err := os.Stat(filepath.Join(i.Image, "Acorndir")); err == nil && st.IsDir() {
i.File = filepath.Join(i.Image, "Acorndir")
} else if st, err := os.Stat(filepath.Join(i.Image, "Acornfile.d")); err == nil && st.IsDir() {
if _, err := os.Stat("Acornfile"); err == nil {
i.File = filepath.Join(i.Image, "Acornfile")
} else {
i.File = filepath.Join(i.Image, "Acornfile.d")
}
} else {
i.File = filepath.Join(i.Image, "Acornfile")
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/log/default_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ func (d *DefaultLoggerImpl) AppStatus(ready bool, msg string, app *apiv1.App) {
}

func (d *DefaultLoggerImpl) Container(timeStamp metav1.Time, containerName, line string) {
d.lock.Lock()
defer d.lock.Unlock()
color, ok := d.containerColors[containerName]
if !ok {
color = nextColor()
Expand Down
15 changes: 15 additions & 0 deletions pkg/login/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,23 @@ func createSecret(ctx context.Context, c client.Client, app *apiv1.App, secretNa
return err
}

asked := map[string]struct{}{}
data := map[string][]byte{}
promptOrder, _ := app.Status.AppSpec.Secrets[secretName].Params.GetData()["promptOrder"].([]string)
for _, key := range promptOrder {
if _, ok := app.Status.AppSpec.Secrets[secretName].Data[key]; ok {
value, err := prompt.Password(key)
if err != nil {
return err
}
data[key] = value
asked[key] = struct{}{}
}
}
for _, key := range typed.SortedKeys(app.Status.AppSpec.Secrets[secretName].Data) {
if _, asked := asked[key]; asked {
continue
}
value, err := prompt.Password(key)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion pkg/secrets/interpolation.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func (i *Interpolator) serviceProperty(svc *v1.ServiceInstance, prop string, ext
}
return "", &ErrInterpolation{
ExpressionError: v1.ExpressionError{
Error: fmt.Sprintf("endpoint on service [%s] undefined", svc.Name),
Error: fmt.Sprintf("endpoint on service [%s] undefined, check that at least one port as marked as published", svc.Name),
},
}
case "address", "host", "hostname":
Expand Down

0 comments on commit 3ff4592

Please sign in to comment.