Skip to content

Commit

Permalink
Merge pull request redpanda-data#14202 from rockwotj/wasm-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rockwotj authored Oct 17, 2023
2 parents 6458d20 + e72c129 commit 7f2cb35
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/go/rpk/pkg/adminapi/api_transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type TransformMetadata struct {
InputTopic string `json:"input_topic"`
OutputTopics []string `json:"output_topics"`
Status []PartitionTransformStatus `json:"status,omitempty"`
Environment []EnvironmentVariable `json:"environment"`
Environment []EnvironmentVariable `json:"environment,omitempty"`
}

// ListWasmTransforms lists the transforms that are running on a cluster.
Expand Down
4 changes: 2 additions & 2 deletions src/go/rpk/pkg/cli/transform/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The --env-var can be repeated to specify multiple variables.
fileConfig, err := project.LoadCfg(fs)
// We allow users to deploy if they aren't in a directory with transform.yaml
// in that case all config needs to be specified on the command line.
if err != nil {
if err == nil {
cfg = mergeProjectConfigs(fileConfig, cfg)
}
err = validateProjectConfig(cfg, err)
Expand Down Expand Up @@ -192,7 +192,7 @@ func isEmptyProjectConfig(cfg project.Config) bool {
func validateProjectConfig(cfg project.Config, fileConfigErr error) error {
// If the user just typed `rpk transform deploy` then we assume they expected to take the configuration values from
// the file, so print out that error.
if isEmptyProjectConfig(cfg) && fileConfigErr == nil {
if isEmptyProjectConfig(cfg) && fileConfigErr != nil {
return fmt.Errorf("unable to find %q: %v", project.ConfigFileName, fileConfigErr)
}
if cfg.Name == "" {
Expand Down
4 changes: 2 additions & 2 deletions src/v/redpanda/admin_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5884,8 +5884,8 @@ admin_server::deploy_transform(std::unique_ptr<ss::http::request> req) {
output_topics.push_back(output_nt);
}
absl::flat_hash_map<ss::sstring, ss::sstring> env;
if (doc.HasMember("env")) {
for (const auto& e : doc["env"].GetArray()) {
if (doc.HasMember("environment")) {
for (const auto& e : doc["environment"].GetArray()) {
auto v = e.GetObject();
env.insert_or_assign(v["key"].GetString(), v["value"].GetString());
}
Expand Down

0 comments on commit 7f2cb35

Please sign in to comment.