chore(deps): bump github.com/compose-spec/compose-go

This commit is contained in:
Ambrose Chua
2024-03-19 14:34:58 +08:00
parent ad04bc0894
commit ea485a7806
8 changed files with 40 additions and 20 deletions
+2 -2
View File
@@ -21,7 +21,7 @@ import (
"strconv"
"time"
"github.com/compose-spec/compose-go/types"
"github.com/compose-spec/compose-go/v2/types"
deployapi "github.com/openshift/api/apps/v1"
"github.com/pkg/errors"
"github.com/spf13/cast"
@@ -250,7 +250,7 @@ func (s *ServiceConfig) GetConfigMapKeyFromMeta(name string) (string, error) {
}
config := s.ConfigsMetaData[name]
if config.External.External {
if config.External {
return "", errors.Errorf("config %s is external", name)
}
+11 -4
View File
@@ -17,6 +17,7 @@ limitations under the License.
package compose
import (
"context"
"fmt"
"os"
"reflect"
@@ -24,8 +25,8 @@ import (
"strings"
"time"
"github.com/compose-spec/compose-go/cli"
"github.com/compose-spec/compose-go/types"
"github.com/compose-spec/compose-go/v2/cli"
"github.com/compose-spec/compose-go/v2/types"
"github.com/fatih/structs"
"github.com/google/shlex"
"github.com/kubernetes/kompose/pkg/kobject"
@@ -167,7 +168,7 @@ func (c *Compose) LoadFile(files []string, profiles []string) (kobject.KomposeOb
return kobject.KomposeObject{}, errors.Wrap(err, "Unable to create compose options")
}
project, err := cli.ProjectFromOptions(projectOptions)
project, err := cli.ProjectFromOptions(context.Background(), projectOptions)
if err != nil {
return kobject.KomposeObject{}, errors.Wrap(err, "Unable to load files")
}
@@ -565,7 +566,7 @@ func dockerComposeToKomposeMapping(composeObject *types.Project) (kobject.Kompos
parseEnvironment(&composeServiceConfig, &serviceConfig)
// Get env_file
serviceConfig.EnvFile = composeServiceConfig.EnvFile
parseEnvFiles(&composeServiceConfig, &serviceConfig)
// Parse the ports
// v3 uses a new format called "long syntax" starting in 3.2
@@ -694,6 +695,12 @@ func parseEnvironment(composeServiceConfig *types.ServiceConfig, serviceConfig *
}
}
func parseEnvFiles(composeServiceConfig *types.ServiceConfig, serviceConfig *kobject.ServiceConfig) {
for _, value := range composeServiceConfig.EnvFiles {
serviceConfig.EnvFile = append(serviceConfig.EnvFile, value.Path)
}
}
func handleCronJobConcurrencyPolicy(policy string) (batchv1.ConcurrencyPolicy, error) {
switch policy {
case "Allow":
+1 -1
View File
@@ -24,7 +24,7 @@ import (
"testing"
"time"
"github.com/compose-spec/compose-go/types"
"github.com/compose-spec/compose-go/v2/types"
"github.com/google/go-cmp/cmp"
"github.com/kubernetes/kompose/pkg/kobject"
"github.com/pkg/errors"
+1 -1
View File
@@ -31,7 +31,7 @@ import (
"text/template"
"time"
"github.com/compose-spec/compose-go/types"
"github.com/compose-spec/compose-go/v2/types"
"github.com/joho/godotenv"
"github.com/kubernetes/kompose/pkg/kobject"
"github.com/kubernetes/kompose/pkg/loader/compose"
+2 -2
View File
@@ -29,7 +29,7 @@ import (
"strconv"
"strings"
"github.com/compose-spec/compose-go/types"
"github.com/compose-spec/compose-go/v2/types"
"github.com/fatih/structs"
"github.com/kubernetes/kompose/pkg/kobject"
"github.com/kubernetes/kompose/pkg/loader/compose"
@@ -1314,7 +1314,7 @@ func (k *Kubernetes) createConfigMapFromComposeConfig(name string, service kobje
for _, config := range service.Configs {
currentConfigName := config.Source
currentConfigObj := service.ConfigsMetaData[currentConfigName]
if currentConfigObj.External.External {
if currentConfigObj.External {
continue
}
currentFileName := currentConfigObj.File
@@ -23,7 +23,7 @@ import (
"strings"
"testing"
"github.com/compose-spec/compose-go/types"
"github.com/compose-spec/compose-go/v2/types"
"github.com/kubernetes/kompose/pkg/kobject"
"github.com/kubernetes/kompose/pkg/loader/compose"