Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/context_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ type ContextFile struct {
ContextProvider string `yaml:"provider" json:"provider"`
EnvFnAPIURL string `yaml:"api-url" json:"apiUrl"`
EnvFnRegistry string `yaml:"registry" json:"registry"`
ObjectStorageBucketName string `yaml:"object_storage_bucket_name" json:"objectStorageBucketName"`
ObjectStorageNamespace string `yaml:"namespace" json:"namespace"`
}

// NewContextFile creates a new instance of the context YAML file
Expand Down
20 changes: 16 additions & 4 deletions config/context_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ func TestContextFile(t *testing.T) {
if actual.EnvFnRegistry != tst.expected.EnvFnRegistry {
t.Fatalf("EnvFnRegistry: expected '%s', but got '%s'", tst.expected.EnvFnRegistry, actual.EnvFnRegistry)
}

if actual.ObjectStorageBucketName != tst.expected.ObjectStorageBucketName {
t.Fatalf("ObjectStorageBucketName: expected '%s', but got '%s'", tst.expected.ObjectStorageBucketName, actual.ObjectStorageBucketName)
}

if actual.ObjectStorageNamespace != tst.expected.ObjectStorageNamespace {
t.Fatalf("ObjectStorageNamespace: expected '%s', but got '%s'", tst.expected.ObjectStorageNamespace, actual.ObjectStorageNamespace)
}
})
}
}
Expand All @@ -73,11 +81,15 @@ func prepareTestFiles(folder string) ([]testCase, error) {
contents: `
api-url: http://localhost:8080
provider: default
registry: "someregistry"`,
registry: "someregistry"
object_storage_bucket_name: "code-only-test-files"
namespace: "oracledevnamespace"`,
expected: &ContextFile{
ContextProvider: "default",
EnvFnAPIURL: "http://localhost:8080",
EnvFnRegistry: "someregistry",
ContextProvider: "default",
EnvFnAPIURL: "http://localhost:8080",
EnvFnRegistry: "someregistry",
ObjectStorageBucketName: "code-only-test-files",
ObjectStorageNamespace: "oracledevnamespace",
},
},
}
Expand Down