Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
5b359213
Commit
5b359213
authored
Mar 11, 2016
by
harry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor env into sub pkg
Refactor env into sub pkg
parent
9f62a2b1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
env.go
pkg/util/env/env.go
+1
-1
env_test.go
pkg/util/env/env_test.go
+1
-1
plugin.go
pkg/volume/flocker/plugin.go
+6
-6
No files found.
pkg/util/env.go
→
pkg/util/env
/env
.go
View file @
5b359213
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
*/
*/
package
util
package
env
import
(
import
(
"os"
"os"
...
...
pkg/util/env_test.go
→
pkg/util/env
/env
_test.go
View file @
5b359213
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
*/
*/
package
util
package
env
import
(
import
(
"os"
"os"
...
...
pkg/volume/flocker/plugin.go
View file @
5b359213
...
@@ -24,7 +24,7 @@ import (
...
@@ -24,7 +24,7 @@ import (
flockerclient
"github.com/ClusterHQ/flocker-go"
flockerclient
"github.com/ClusterHQ/flocker-go"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util
/env
"
"k8s.io/kubernetes/pkg/util/exec"
"k8s.io/kubernetes/pkg/util/exec"
"k8s.io/kubernetes/pkg/util/mount"
"k8s.io/kubernetes/pkg/util/mount"
"k8s.io/kubernetes/pkg/util/strings"
"k8s.io/kubernetes/pkg/util/strings"
...
@@ -133,15 +133,15 @@ func (b flockerBuilder) SetUp(fsGroup *int64) error {
...
@@ -133,15 +133,15 @@ func (b flockerBuilder) SetUp(fsGroup *int64) error {
// newFlockerClient uses environment variables and pod attributes to return a
// newFlockerClient uses environment variables and pod attributes to return a
// flocker client capable of talking with the Flocker control service.
// flocker client capable of talking with the Flocker control service.
func
(
b
flockerBuilder
)
newFlockerClient
()
(
*
flockerclient
.
Client
,
error
)
{
func
(
b
flockerBuilder
)
newFlockerClient
()
(
*
flockerclient
.
Client
,
error
)
{
host
:=
util
.
GetEnvAsStringOrFallback
(
"FLOCKER_CONTROL_SERVICE_HOST"
,
defaultHost
)
host
:=
env
.
GetEnvAsStringOrFallback
(
"FLOCKER_CONTROL_SERVICE_HOST"
,
defaultHost
)
port
,
err
:=
util
.
GetEnvAsIntOrFallback
(
"FLOCKER_CONTROL_SERVICE_PORT"
,
defaultPort
)
port
,
err
:=
env
.
GetEnvAsIntOrFallback
(
"FLOCKER_CONTROL_SERVICE_PORT"
,
defaultPort
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
caCertPath
:=
util
.
GetEnvAsStringOrFallback
(
"FLOCKER_CONTROL_SERVICE_CA_FILE"
,
defaultCACertFile
)
caCertPath
:=
env
.
GetEnvAsStringOrFallback
(
"FLOCKER_CONTROL_SERVICE_CA_FILE"
,
defaultCACertFile
)
keyPath
:=
util
.
GetEnvAsStringOrFallback
(
"FLOCKER_CONTROL_SERVICE_CLIENT_KEY_FILE"
,
defaultClientKeyFile
)
keyPath
:=
env
.
GetEnvAsStringOrFallback
(
"FLOCKER_CONTROL_SERVICE_CLIENT_KEY_FILE"
,
defaultClientKeyFile
)
certPath
:=
util
.
GetEnvAsStringOrFallback
(
"FLOCKER_CONTROL_SERVICE_CLIENT_CERT_FILE"
,
defaultClientCertFile
)
certPath
:=
env
.
GetEnvAsStringOrFallback
(
"FLOCKER_CONTROL_SERVICE_CLIENT_CERT_FILE"
,
defaultClientCertFile
)
c
,
err
:=
flockerclient
.
NewClient
(
host
,
port
,
b
.
flocker
.
pod
.
Status
.
HostIP
,
caCertPath
,
keyPath
,
certPath
)
c
,
err
:=
flockerclient
.
NewClient
(
host
,
port
,
b
.
flocker
.
pod
.
Status
.
HostIP
,
caCertPath
,
keyPath
,
certPath
)
return
c
,
err
return
c
,
err
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment