Skip to content

Commit

Permalink
feat: rename default provisioners file and change header comment
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Meier <[email protected]>
  • Loading branch information
astromechza committed Jul 8, 2024
1 parent 1685dbf commit 9eac993
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
16 changes: 3 additions & 13 deletions internal/command/default.provisioners.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
# Copyright 2024 Humanitec
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is generated by score-compose when score-compose init is called. This presents the default set of
# template provisioners provided for a basic set of resource types. This file can be overridden by adding new
# *.provisioners.yaml files in this directory or by editing this file in place and checking it into the source code.

# The default volume provisioner provided by score-compose allows basic volume resources to be created in the resources
# system. The volume resource just creates an ephemeral Docker volume with a random string as the name, and source
Expand Down
2 changes: 1 addition & 1 deletion internal/command/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ acts as a namespace when multiple score files and containers are used.
}

// create and write the default provisioners file if it doesn't already exist
dst := "99-default" + loader.DefaultSuffix
dst := "zz-default" + loader.DefaultSuffix
if f, err := os.OpenFile(filepath.Join(sd.Path, dst), os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0644); err != nil {
if !errors.Is(err, os.ErrExist) {
return fmt.Errorf("failed to open default provisioners for writing: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion internal/command/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func TestInitNominal_run_twice(t *testing.T) {
assert.NotEqual(t, "", strings.TrimSpace(stderr))

// check default provisioners exists and overwrite it with an empty array
dpf, err := os.Stat(filepath.Join(td, ".score-compose", "99-default.provisioners.yaml"))
dpf, err := os.Stat(filepath.Join(td, ".score-compose", "zz-default.provisioners.yaml"))
assert.NoError(t, err)
assert.NoError(t, os.WriteFile(filepath.Join(td, ".score-compose", dpf.Name()), []byte("[]"), 0644))

Expand Down

0 comments on commit 9eac993

Please sign in to comment.