Skip to content

Commit

Permalink
modify task20 (#3563)
Browse files Browse the repository at this point in the history
Signed-off-by: CLL908 <522023330013@smail.nju.edu.cn>
  • Loading branch information
CLL908 authored Nov 21, 2023
1 parent 8c28e0f commit 4d2b5de
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/ddc/goosefs/transform_hadoop_config.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2022 The Fluid Authors.
Copyright 2023 The Fluid Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -37,16 +37,16 @@ func (e *GooseFSEngine) transformHadoopConfig(runtime *datav1alpha1.GooseFSRunti
Namespace: runtime.Namespace,
Name: runtime.Spec.HadoopConfig,
}

hadoopConfigMap := &v1.ConfigMap{}

if err = e.Client.Get(context.TODO(), key, hadoopConfigMap); err != nil {
if apierrs.IsNotFound(err) {
err = fmt.Errorf("specified hadoopConfig \"%v\" is not found", runtime.Spec.HadoopConfig)
}
return err
}

var confFiles []string
for k := range hadoopConfigMap.Data {
switch k {
Expand All @@ -58,15 +58,15 @@ func (e *GooseFSEngine) transformHadoopConfig(runtime *datav1alpha1.GooseFSRunti
confFiles = append(confFiles, HADOOP_CONF_MOUNT_PATH+"/"+HADOOP_CONF_CORE_SITE_FILENAME)
}
}

// Neither hdfs-site.xml nor core-site.xml is found in the configMap
if !value.HadoopConfig.IncludeCoreSite && !value.HadoopConfig.IncludeHdfsSite {
err = fmt.Errorf("neither \"%v\" nor \"%v\" is found in the specified configMap \"%v\" ", HADOOP_CONF_HDFS_SITE_FILENAME, HADOOP_CONF_CORE_SITE_FILENAME, runtime.Spec.HadoopConfig)
return err
}

value.HadoopConfig.ConfigMap = runtime.Spec.HadoopConfig
value.Properties["goosefs.underfs.hdfs.configuration"] = strings.Join(confFiles, ":")

return nil
}

0 comments on commit 4d2b5de

Please sign in to comment.