diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 968534a..c554233 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,6 +12,7 @@ If you are interested in making a code contribution and would like to learn more - [https://score.dev/) - [https://github.com/score-spec/score-compose] +- [https://github.com/score-spec/score-k8s] ### **How do I make a contribution?** diff --git a/README.md b/README.md index c54b154..857f7a7 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ Alternative installation guides and implementations can be found in the [Score d ``` $ score-k8s init --help -The init subcommand will prepare the current directory for working with score-compose and write the initial +The init subcommand will prepare the current directory for working with score-k8s and write the initial empty state and default provisioners file into the '.score-k8s' subdirectory. The '.score-k8s' directory contains state that will be used to generate any Kubernetes resource manifests including @@ -127,7 +127,7 @@ $ score-k8s generate --help The generate command will convert Score files in the current Score state into a combined set of Kubernetes manifests. All resources and links between Workloads will be resolved and provisioned as required. -"score-compose init" MUST be run first. An error will be thrown if the project directory is not present. +"score-k8s init" MUST be run first. An error will be thrown if the project directory is not present. Usage: score-k8s generate [flags] diff --git a/go.mod b/go.mod index 26cce7d..31e54bc 100644 --- a/go.mod +++ b/go.mod @@ -35,9 +35,9 @@ require ( github.com/shopspring/decimal v1.2.0 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/crypto v0.16.0 // indirect - golang.org/x/net v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/text v0.15.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/klog/v2 v2.110.1 // indirect diff --git a/go.sum b/go.sum index ec92a0c..5053c16 100644 --- a/go.sum +++ b/go.sum @@ -87,6 +87,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -99,6 +101,9 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -120,6 +125,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= diff --git a/internal/project/state.go b/internal/project/state.go index d158802..40220a0 100644 --- a/internal/project/state.go +++ b/internal/project/state.go @@ -37,7 +37,7 @@ type ResourceExtras struct { type State = framework.State[framework.NoExtras, framework.NoExtras, ResourceExtras] -// The StateDirectory holds the local state of the score-compose project, including any configuration, extensions, +// The StateDirectory holds the local state of the score-k8s project, including any configuration, extensions, // plugins, or resource provisioning state when possible. type StateDirectory struct { // The path to the .score-k8s directory diff --git a/internal/provisioners/cmdprov/commandprov_test.go b/internal/provisioners/cmdprov/commandprov_test.go index 1b1cccf..19623e5 100644 --- a/internal/provisioners/cmdprov/commandprov_test.go +++ b/internal/provisioners/cmdprov/commandprov_test.go @@ -80,8 +80,8 @@ func TestDecodeBinary_success(t *testing.T) { func TestDecodeBinary_fail(t *testing.T) { for k, v := range map[string]string{ - "cmd://absolutely-unknown-score-compose-provisioner": "failed to find 'absolutely-unknown-score-compose-provisioner' on path: exec: \"absolutely-unknown-score-compose-provisioner\": executable file not found in $PATH", - "cmd://something/foo": "direct command reference cannot contain additional path parts", + "cmd://absolutely-unknown-score-provisioner": "failed to find 'absolutely-unknown-score-provisioner' on path: exec: \"absolutely-unknown-score-provisioner\": executable file not found in $PATH", + "cmd://something/foo": "direct command reference cannot contain additional path parts", } { t.Run(k, func(t *testing.T) { _, err := decodeBinary(k) diff --git a/internal/version/version.go b/internal/version/version.go index 6836a09..5dd0d1c 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -24,7 +24,7 @@ var ( ) // BuildVersionString constructs a version string by looking at the build metadata injected at build time. -// This is particularly useful when score-compose is stilled from the go module using go install. +// This is particularly useful when score-k8s is installed from the go module using go install. func BuildVersionString() string { versionNumber, buildTime, gitSha, isDirtySuffix := Version, "local", "unknown", "" if info, ok := debug.ReadBuildInfo(); ok { @@ -34,9 +34,13 @@ func BuildVersionString() string { for _, setting := range info.Settings { switch setting.Key { case "vcs.time": - buildTime = setting.Value + if setting.Value != "" { + buildTime = setting.Value + } case "vcs.revision": - gitSha = setting.Value + if setting.Value != "" { + gitSha = setting.Value + } case "vcs.modified": if setting.Value == "true" { isDirtySuffix = "-dirty" diff --git a/main_generate.go b/main_generate.go index e478ce7..31b561c 100644 --- a/main_generate.go +++ b/main_generate.go @@ -55,7 +55,7 @@ var generateCmd = &cobra.Command{ Long: `The generate command will convert Score files in the current Score state into a combined set of Kubernetes manifests. All resources and links between Workloads will be resolved and provisioned as required. -"score-compose init" MUST be run first. An error will be thrown if the project directory is not present. +"score-k8s init" MUST be run first. An error will be thrown if the project directory is not present. `, Example: ` # Specify Score files diff --git a/main_init.go b/main_init.go index 444aa4b..22a5b28 100644 --- a/main_init.go +++ b/main_init.go @@ -38,7 +38,7 @@ var initCmd = &cobra.Command{ Use: "init", Args: cobra.NoArgs, Short: "Initialise a new score-k8s project with local state directory and sample score file", - Long: `The init subcommand will prepare the current directory for working with score-compose and write the initial + Long: `The init subcommand will prepare the current directory for working with score-k8s and write the initial empty state and default provisioners file into the '.score-k8s' subdirectory. The '.score-k8s' directory contains state that will be used to generate any Kubernetes resource manifests including