Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Release v1.2.0 #211

Merged
merged 52 commits into from
Sep 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
6e7516c
Fix/Flex mount idempotent improvements (#177)
shay-berman Mar 28, 2018
96ae20e
glide update to use ubiquity dev branch
shay-berman Mar 28, 2018
417ce25
Merge pull request #183 from IBM/fix/glide_ubiquity_to_dev_branch
shay-berman Mar 28, 2018
ac72ec8
Fix typo in debug message & positional arguments in error (Dana review)
shay-berman Apr 29, 2018
ba084f6
Merge pull request #186 from IBM/fix/typo_in_debug_and_error_messages
shay-berman May 2, 2018
10a4347
Apply gofmt fixes
shay-berman May 9, 2018
5966dc0
Merge pull request #188 from IBM/v1.1.1_power_support
shay-berman May 10, 2018
40b2290
Merge pull request #187 from IBM/fix/gofmt_alignment
shay-berman May 13, 2018
0df1bfe
#177 : Improve error message for mount idempotent step.
shay-berman May 21, 2018
815a42e
Merge pull request #190 from IBM/fix/improve_err_message_pr177
shay-berman May 22, 2018
4e4a319
Fix/ub 624 flex should not write log into flex driver director (#166)
hfeish May 24, 2018
0a523a7
UB-1099: add go_id:request_id to flex and provisioner logs (#191)
olgashtivelman Jun 13, 2018
7f6f6c0
Return glide.yaml - ubiquity version to dev
Jun 13, 2018
a13bc08
Update to k8s 1.9 in glide (#192)
beckmani Jun 21, 2018
b5a2162
Fix/idempotent umount for slink not exist and PV not exist (#193)
shay-berman Jun 26, 2018
a5f114e
Fix/ub 1325 change logger not to show pid and goroutine (#194)
olgashtivelman Jun 27, 2018
fad3eca
Remove old ubiquity linux service, config files and few old deploymen…
shay-berman Jul 2, 2018
6844c53
Move the acceptance test scripts to a dedicated directory scripts/acc…
shay-berman Jul 2, 2018
3df34f4
Merge pull request #201 from IBM/cleanup_old_installation_method
shay-berman Jul 5, 2018
cb41c80
logging message: changed is to does
Jul 8, 2018
2d28d7d
Merge branch 'dev' of https://github.com/ibm/ubiquity-k8s into dev
Jul 8, 2018
82497a0
UB-1098: change info messages to warning (#202)
olgashtivelman Jul 9, 2018
3ccbbfd
glide.yml update with missing dependencies and improve Dockerfile to …
beckmani Jul 9, 2018
2fbda99
Fixed logging message syntax
Jul 9, 2018
2bbb2ac
UB-1001: fix idempotent - calling detach with an empty host -> not at…
olgashtivelman Jul 9, 2018
ffaf543
Merge branch 'dev' of https://github.com/ibm/ubiquity-k8s into dev
Jul 9, 2018
f5c2a30
Fix/ub 1325 adda action name to the logs (#199)
olgashtivelman Jul 15, 2018
454de02
Merge branch 'dev' of https://github.com/ibm/ubiquity-k8s into dev
Jul 15, 2018
6313520
Align ubiquity-k8s with ubiquity in glide.yaml
Jul 16, 2018
a943e43
using latest ubiquity dev commit#
Jul 16, 2018
a0e0b40
Fix tolerations flex-daemonset.yml to operator:Exists for ICP 2.1.0.2…
shay-berman Jul 22, 2018
ec3882d
Merge pull request #203 from IBM/fix/flex-daemonset-fix-for-icp2.1.0.2
shay-berman Jul 24, 2018
c132809
UB-1433: update commit# to use the new warning log changes in ubiquit…
Jul 24, 2018
186fbd2
UB-1405: update commit# - fixed: unmount flow should not fail if dis…
Aug 5, 2018
2c1bb51
Changed ubiquity commit# after fixing a typo
Aug 6, 2018
59b6a96
Fix/ub 1349 not allow the attachment of two pods to one pvc (#204)
olgashtivelman Aug 8, 2018
05ec337
Updated the glide file to hold fixed commit hashes
Aug 8, 2018
ceaf4c8
Merge pull request #206 from IBM/fix/fixed_glide_file
ranhrl Aug 9, 2018
80649f7
Fix/ub 1449 should not fail unmount when slink is broken (#205)
olgashtivelman Aug 9, 2018
1539a86
UB-1474: change glide# - added idempotent message to the log
Aug 13, 2018
d220f72
Align ubiquity-k8s with ubiquity latest commit
Aug 16, 2018
8658088
Resolve conflicts in glide
Aug 16, 2018
d023821
Align glide on golang.org/x/sys
Aug 16, 2018
9bb3f5c
Align ubiquity-k8s with ubiquity latest commit
Aug 19, 2018
252827c
Merge branch 'dev' into resolve_glide_conflicts
Aug 19, 2018
dd7b8b4
UB-1475: returning the actual error from the Discover instead of mask…
Aug 19, 2018
1f24221
UB-1407: added timeouts to umount commands
Aug 23, 2018
234e4f7
UB-1474: added log message for idempotent issue
Aug 23, 2018
a89181a
ub-1436: umount when pv does not exist fix
Aug 27, 2018
89b621c
Add contribution-guide.md for build and testing (#189)
shay-berman Aug 27, 2018
c4501ea
Update notices file for version 1.2 and update ubiquity_installer.con…
shay-berman Aug 28, 2018
9350ac9
Update README.md
shay-berman Sep 2, 2018
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
7 changes: 3 additions & 4 deletions Dockerfile.Flex
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
FROM golang:1.9.1
WORKDIR /go/src/github.com/IBM/ubiquity-k8s/
COPY . .
RUN go get -v github.com/Masterminds/glide
ADD glide.yaml .
RUN glide up --strip-vendor
COPY . .
RUN CGO_ENABLED=1 GOOS=linux go build -tags netgo -v -a --ldflags '-w -linkmode external -extldflags "-static"' -installsuffix cgo -o ubiquity-k8s-flex cmd/flex/main/cli.go


FROM alpine:3.7
RUN apk --no-cache add ca-certificates=20171114-r0
RUN apk --update add logrotate
ENV UBIQUITY_PLUGIN_VERIFY_CA=/var/lib/ubiquity/ssl/public/ubiquity-trusted-ca.crt
WORKDIR /root/
COPY --from=0 /go/src/github.com/IBM/ubiquity-k8s/deploy/k8s_deployments/ubiquity_logrotate /etc/logrotate.d/
COPY --from=0 /go/src/github.com/IBM/ubiquity-k8s/ubiquity-k8s-flex .
COPY --from=0 /go/src/github.com/IBM/ubiquity-k8s/deploy/k8s_deployments/setup_flex.sh .
COPY --from=0 /go/src/github.com/IBM/ubiquity-k8s/scripts/setup_flex.sh .
COPY --from=0 /go/src/github.com/IBM/ubiquity-k8s/LICENSE .
COPY --from=0 /go/src/github.com/IBM/ubiquity-k8s/scripts/notices_file_for_ibm_storage_enabler_for_containers ./NOTICES
3 changes: 2 additions & 1 deletion Dockerfile.Provisioner
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM golang:1.9.1
WORKDIR /go/src/github.com/IBM/ubiquity-k8s/
COPY . .
RUN go get -v github.com/Masterminds/glide
ADD glide.yaml .
RUN glide up --strip-vendor
COPY . .
RUN CGO_ENABLED=1 GOOS=linux go build -tags netgo -v -a --ldflags '-w -linkmode external -extldflags "-static"' -installsuffix cgo -o ubiquity-k8s-provisioner cmd/provisioner/main/main.go


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This project includes components for managing [Kubernetes persistent storage](ht
Currently, the following storage systems use Ubiquity:
* IBM block storage.

The IBM block storage is supported for Kubernetes via IBM Spectrum Connect (3.4.0), previously known as IBM Spectrum Control Base Edition. Ubiquity communicates with the IBM storage systems through Spectrum Connect. Spectrum Connect creates a storage profile (for example, gold, silver or bronze) and makes it available for Kubernetes. For details about supported storage systems, refer to the latest Spectrum Connect release notes.
The IBM block storage is supported for Kubernetes via IBM Spectrum Connect. Ubiquity communicates with the IBM storage systems through Spectrum Connect. Spectrum Connect creates a storage profile (for example, gold, silver or bronze) and makes it available for Kubernetes. For details about supported storage systems, refer to the latest Spectrum Connect release notes.

The IBM official solution for Kubernetes, based on the Ubiquity project, is referred to as IBM Storage Enabler for Containers. You can download the installation package and its documentation from [IBM Fix Central](https://www.ibm.com/support/fixcentral/swg/selectFixes?parent=Software%2Bdefined%2Bstorage&product=ibm/StorageSoftware/IBM+Spectrum+Connect&release=All&platform=Linux&function=all). For details on the IBM Storage Enabler for Containers, see the relevant sections in the Spectrum Connect user guide.

Expand Down
62 changes: 40 additions & 22 deletions cmd/flex/main/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,19 @@ import (
"flag"
"fmt"
"os"
"path"

"github.com/BurntSushi/toml"
"github.com/IBM/ubiquity-k8s/controller"
flags "github.com/jessevdk/go-flags"

"strconv"

k8sresources "github.com/IBM/ubiquity-k8s/resources"
"github.com/IBM/ubiquity/resources"
"github.com/IBM/ubiquity/remote"
"github.com/IBM/ubiquity/resources"
"github.com/IBM/ubiquity/utils"
"github.com/IBM/ubiquity/utils/logs"
"strconv"
k8sutils "github.com/IBM/ubiquity-k8s/utils"
)

var configFile = flag.String(
Expand Down Expand Up @@ -88,6 +89,9 @@ type AttachCommand struct {
func (a *AttachCommand) Execute(args []string) error {
var version string
var hostname string

requestContext := logs.GetNewRequestContext("Attach")

if len(args) < 1 {

response := k8sresources.FlexVolumeResponse{
Expand Down Expand Up @@ -119,7 +123,7 @@ func (a *AttachCommand) Execute(args []string) error {
}
return printResponse(response)
}
defer logs.InitFileLogger(logs.GetLogLevelFromString(config.LogLevel), path.Join(config.LogPath, k8sresources.UbiquityFlexLogFileName))()
defer k8sutils.InitFlexLogger(config)()
controller, err := createController(config)

if err != nil {
Expand All @@ -135,7 +139,7 @@ func (a *AttachCommand) Execute(args []string) error {
return printResponse(response)
}

attachRequest := k8sresources.FlexVolumeAttachRequest{Name: volumeName, Host: hostname, Opts: attachRequestOpts, Version: version}
attachRequest := k8sresources.FlexVolumeAttachRequest{Name: volumeName, Host: hostname, Opts: attachRequestOpts, Version: version, Context: requestContext}

attachResponse := controller.Attach(attachRequest)
return printResponse(attachResponse)
Expand All @@ -148,6 +152,7 @@ type WaitForAttachCommand struct {
}

func (wfa *WaitForAttachCommand) Execute(args []string) error {
requestContext := logs.GetNewRequestContext("WaitForAttach")
if len(args) < 2 {

response := k8sresources.FlexVolumeResponse{
Expand All @@ -160,11 +165,11 @@ func (wfa *WaitForAttachCommand) Execute(args []string) error {
if err != nil {
response := k8sresources.FlexVolumeResponse{
Status: "Failure",
Message: fmt.Sprintf("Failed to read config in waitForAttach volume %#v", err),
Message: fmt.Sprintf("Failed to read config in waitForAttach volume %#v ", err),
}
return printResponse(response)
}
defer logs.InitFileLogger(logs.GetLogLevelFromString(config.LogLevel), path.Join(config.LogPath, k8sresources.UbiquityFlexLogFileName))()
defer k8sutils.InitFlexLogger(config)()
controller, err := createController(config)
opts := make(map[string]string)
err = json.Unmarshal([]byte(args[1]), &opts)
Expand All @@ -175,7 +180,7 @@ func (wfa *WaitForAttachCommand) Execute(args []string) error {
}
return printResponse(response)
}
waitForAttachRequest := k8sresources.FlexVolumeWaitForAttachRequest{Name: args[0], Opts: opts}
waitForAttachRequest := k8sresources.FlexVolumeWaitForAttachRequest{Name: args[0], Opts: opts, Context: requestContext}
response := controller.WaitForAttach(waitForAttachRequest)
return printResponse(response)
}
Expand All @@ -187,6 +192,7 @@ type IsAttachedCommand struct {
}

func (d *IsAttachedCommand) Execute(args []string) error {
requestContext := logs.GetNewRequestContext("IsAttached")
if len(args) < 2 {

response := k8sresources.FlexVolumeResponse{
Expand All @@ -203,7 +209,7 @@ func (d *IsAttachedCommand) Execute(args []string) error {
}
return printResponse(response)
}
defer logs.InitFileLogger(logs.GetLogLevelFromString(config.LogLevel), path.Join(config.LogPath, k8sresources.UbiquityFlexLogFileName))()
defer k8sutils.InitFlexLogger(config)()
controller, err := createController(config)
opts := make(map[string]string)
err = json.Unmarshal([]byte(args[0]), &opts)
Expand All @@ -214,7 +220,7 @@ func (d *IsAttachedCommand) Execute(args []string) error {
}
return printResponse(response)
}
isAttachedRequest := k8sresources.FlexVolumeIsAttachedRequest{Opts: opts, Host: args[1]}
isAttachedRequest := k8sresources.FlexVolumeIsAttachedRequest{Opts: opts, Host: args[1], Context: requestContext}
response := controller.IsAttached(isAttachedRequest)
return printResponse(response)
}
Expand All @@ -227,6 +233,7 @@ type DetachCommand struct {
}

func (d *DetachCommand) Execute(args []string) error {
requestContext := logs.GetNewRequestContext("Detach")
var hostname string
var version string
if len(args) < 1 {
Expand All @@ -253,14 +260,14 @@ func (d *DetachCommand) Execute(args []string) error {
}
return printResponse(response)
}
defer logs.InitFileLogger(logs.GetLogLevelFromString(config.LogLevel), path.Join(config.LogPath, k8sresources.UbiquityFlexLogFileName))()
defer k8sutils.InitFlexLogger(config)()
controller, err := createController(config)

if err != nil {
panic("backend not found")
}

detachRequest := k8sresources.FlexVolumeDetachRequest{Name: mountDevice, Host: hostname, Version: version}
detachRequest := k8sresources.FlexVolumeDetachRequest{Name: mountDevice, Host: hostname, Version: version, Context: requestContext}
detachResponse := controller.Detach(detachRequest)
return printResponse(detachResponse)
}
Expand All @@ -272,6 +279,7 @@ type MountDeviceCommand struct {
}

func (d *MountDeviceCommand) Execute(args []string) error {
requestContext := logs.GetNewRequestContext("MountDevice")
if len(args) < 3 {

response := k8sresources.FlexVolumeResponse{
Expand All @@ -288,7 +296,7 @@ func (d *MountDeviceCommand) Execute(args []string) error {
}
return printResponse(response)
}
defer logs.InitFileLogger(logs.GetLogLevelFromString(config.LogLevel), path.Join(config.LogPath, k8sresources.UbiquityFlexLogFileName))()
defer k8sutils.InitFlexLogger(config)()
controller, err := createController(config)
opts := make(map[string]string)
err = json.Unmarshal([]byte(args[2]), &opts)
Expand All @@ -299,7 +307,7 @@ func (d *MountDeviceCommand) Execute(args []string) error {
}
return printResponse(response)
}
mountDeviceRequest := k8sresources.FlexVolumeMountDeviceRequest{Path: args[0], Name: args[1], Opts: opts}
mountDeviceRequest := k8sresources.FlexVolumeMountDeviceRequest{Path: args[0], Name: args[1], Opts: opts, Context: requestContext}
response := controller.MountDevice(mountDeviceRequest)
return printResponse(response)
}
Expand All @@ -311,6 +319,7 @@ type UnmountDeviceCommand struct {
}

func (d *UnmountDeviceCommand) Execute(args []string) error {
requestContext := logs.GetNewRequestContext("UnmountDevice")
if len(args) < 1 {

response := k8sresources.FlexVolumeResponse{
Expand All @@ -327,10 +336,10 @@ func (d *UnmountDeviceCommand) Execute(args []string) error {
}
return printResponse(response)
}
defer logs.InitFileLogger(logs.GetLogLevelFromString(config.LogLevel), path.Join(config.LogPath, k8sresources.UbiquityFlexLogFileName))()
defer k8sutils.InitFlexLogger(config)()
controller, err := createController(config)

unmountDeviceRequest := k8sresources.FlexVolumeUnmountDeviceRequest{Name: args[0]}
unmountDeviceRequest := k8sresources.FlexVolumeUnmountDeviceRequest{Name: args[0], Context: requestContext}
response := controller.UnmountDevice(unmountDeviceRequest)
return printResponse(response)
}
Expand All @@ -349,6 +358,8 @@ func (m *MountCommand) Execute(args []string) error {
var ok bool
var version string

requestContext := logs.GetNewRequestContext("Mount")

//should error out when not enough args
if len(args) < 2 {

Expand Down Expand Up @@ -394,9 +405,10 @@ func (m *MountCommand) Execute(args []string) error {

mountRequest := k8sresources.FlexVolumeMountRequest{
MountPath: targetMountDir,
MountDevice: volumeName,
MountDevice: volumeName, // The PV name
Opts: mountOpts,
Version: version,
Context: requestContext,
}

config, err := readConfig(*configFile)
Expand All @@ -408,13 +420,14 @@ func (m *MountCommand) Execute(args []string) error {
return printResponse(response)
}

defer logs.InitFileLogger(logs.GetLogLevelFromString(config.LogLevel), path.Join(config.LogPath, k8sresources.UbiquityFlexLogFileName))()
defer k8sutils.InitFlexLogger(config)()
controller, err := createController(config)

if err != nil {
panic("backend not found")
}
mountResponse := controller.Mount(mountRequest)

return printResponse(mountResponse)
}

Expand All @@ -425,6 +438,7 @@ type UnmountCommand struct {
}

func (u *UnmountCommand) Execute(args []string) error {
requestContext := logs.GetNewRequestContext("Unmount")
if len(args) < 1 {

response := k8sresources.FlexVolumeResponse{
Expand All @@ -443,7 +457,8 @@ func (u *UnmountCommand) Execute(args []string) error {
}
return printResponse(response)
}
defer logs.InitFileLogger(logs.GetLogLevelFromString(config.LogLevel), path.Join(config.LogPath, k8sresources.UbiquityFlexLogFileName))()

defer k8sutils.InitFlexLogger(config)()
controller, err := createController(config)

if err != nil {
Expand All @@ -452,6 +467,7 @@ func (u *UnmountCommand) Execute(args []string) error {

unmountRequest := k8sresources.FlexVolumeUnmountRequest{
MountPath: mountDir,
Context: requestContext,
}
unmountResponse := controller.Unmount(unmountRequest)
return printResponse(unmountResponse)
Expand All @@ -470,7 +486,8 @@ func (i *TestUbiquityCommand) Execute(args []string) error {
}
return printResponse(response)
}
defer logs.InitFileLogger(logs.GetLogLevelFromString(config.LogLevel), path.Join(config.LogPath, k8sresources.UbiquityFlexLogFileName))()

defer k8sutils.InitFlexLogger(config)()
controller, err := createController(config)
if err != nil {
response := k8sresources.FlexVolumeResponse{
Expand Down Expand Up @@ -567,8 +584,8 @@ func readConfig(configFile string) (resources.UbiquityPluginConfig, error) {

}
// Create environment variables for some of the config params
os.Setenv(remote.KeyUseSsl, strconv.FormatBool(config.SslConfig.UseSsl))
os.Setenv(resources.KeySslMode, config.SslConfig.SslMode)
os.Setenv(remote.KeyUseSsl, strconv.FormatBool(config.SslConfig.UseSsl))
os.Setenv(resources.KeySslMode, config.SslConfig.SslMode)
os.Setenv(remote.KeyVerifyCA, config.SslConfig.VerifyCa)
return config, nil
}
Expand All @@ -581,3 +598,4 @@ func printResponse(f k8sresources.FlexVolumeResponse) error {
fmt.Printf("%s", string(responseBytes[:]))
return nil
}

4 changes: 1 addition & 3 deletions cmd/provisioner/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/IBM/ubiquity-k8s/volume"
"github.com/IBM/ubiquity/remote"
"github.com/IBM/ubiquity/utils"
"github.com/IBM/ubiquity/utils/logs"
"github.com/kubernetes-incubator/external-storage/lib/controller"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/kubernetes"
Expand All @@ -51,7 +50,7 @@ func main() {
panic(fmt.Errorf("Failed to setup log dir"))
}

defer logs.InitStdoutLogger(logs.GetLogLevelFromString(ubiquityConfig.LogLevel))()
defer k8sutils.InitProvisionerLogger(ubiquityConfig)()
logger := utils.SetupOldLogger(k8sresources.UbiquityProvisionerName)

logger.Printf("Provisioner %s specified", provisioner)
Expand Down Expand Up @@ -100,4 +99,3 @@ func main() {
pc := controller.NewProvisionController(clientset, provisioner, flexProvisioner, serverVersion.GitVersion)
pc.Run(wait.NeverStop)
}

40 changes: 40 additions & 0 deletions contribution-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Contribution guide
The Ubiquity team accepts contributions from IBM employees using GitHub pull requests.
Pushing to master is not allowed. Any direct push to master might interfere with our CI process.

If you want to make a change, create your own branch out of `dev` branch, make your changes. Once you are done, submit a pull request to the `dev` branch. When accepted, the changes will make their way into `master` after we merge.

Verify your changes before submitting a pull request by running the unit, integration and acceptance tests. See the testing section for details. In addition, make sure that your changes are covered by existing or new unit testing.

# Build prerequisites
* Install [golang](https://golang.org/) (>=1.9.1).
* Install [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
* Install gcc.
* Configure go. GOPATH environment variable must be set correctly before starting the build process. Create a new directory and set it as GOPATH.

### Download and build source code
* Configure ssh-keys for github.com. go tools require passwordless ssh access to github. If you have not set up ssh keys for your github profile, follow these [instructions](https://help.github.com/enterprise/2.7/user/articles/generating-an-ssh-key/) before you proceed.
* Build Ubiquity Provisioner and FlexVolume from source.
```bash
mkdir -p $HOME/workspace
export GOPATH=$HOME/workspace
mkdir -p $GOPATH/src/github.com/IBM
cd $GOPATH/src/github.com/IBM
git clone [email protected]:IBM/ubiquity-k8s.git
cd ubiquity-k8s
./scripts/run_glide_up
./scripts/build_provisioner
./scripts/build_flex_driver
```
# Testing Ubiquity Provisioner and FlexVolume

Run the tests:
```bash
./scripts/run_glide_up
./scripts/run_units.sh
```

# Squash and merge

Upon the merge (by either you or your reviewer), all commits on the review branch must represent meaningful milestones or units of work. Use commit message to detail the development and review process.
Before merging a PR, squash any fix review feedback, typo, and rebased sorts of commits.
Loading