Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.5.0 nfs (dummy) #1325

Open
wants to merge 77 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
14f45f9
Vendoring in k8s api 1.25 changes.
Jan 12, 2023
ba59169
PWX-28448: Changes for supporting k8s 1.25 apis.
Jan 12, 2023
5bb1d4b
PWX-28440: stork resourcecollector to handle the cases where cache is…
Jan 31, 2023
226935e
make file changes required for k8s 1.25 support in stork
Feb 2, 2023
707b1c8
vendor changes
px-kesavan Feb 5, 2023
d68e94d
Added rancher client to access projects
px-kesavan Feb 5, 2023
43ad17a
Added platform credential to hold rancher api secrets
px-kesavan Feb 5, 2023
f607920
Added test for Clone PVCs after DR on destination cluster (#1248)
gejain Feb 6, 2023
3e0cca9
pb-3474: vendoring torpedo master branch
Feb 6, 2023
5d7dcdb
PWX-28818: Update libxml for vulnerability fixes (#1270)
pp511 Feb 7, 2023
deed5fd
vendor udpate for torpedo, sched-ops from master and kdmp(1.2.4)
prashanthpx Feb 7, 2023
b4c8f2d
Changes required in backuplocation CR definition of NFS type.
Nov 3, 2022
0fb7443
pb-2939: enable NFS type backuplocation
lalat-das Jul 27, 2022
71ccdbd
Initializing resource export controller
prashanthpx Sep 12, 2022
a5d481d
pb-3062: Added code to create resource export CR for nfs resource
Sep 13, 2022
8240511
pb-3093: Setting nfs as type while creating ResourceExport CR
prashanthpx Sep 14, 2022
d9982ec
PB-3111: Support for nfs backuplocation in restore resources in appli…
diptiranjanpx Sep 20, 2022
c96d564
pb-3109: moved the const definition and api between kdmp driver and a…
Sep 24, 2022
58789ef
fixed the issue in accessing Resources from Status of the resourceExp…
Sep 26, 2022
20605cc
pb-3100: Enable Generic backup for NFS based backuplocation
lalat-das Oct 3, 2022
dd06c7f
Temporarily disabling namespace creation in vol restore path
prashanthpx Oct 10, 2022
2f98d5d
PB-3155: Updating the success status in application restore CR from r…
diptiranjanpx Oct 12, 2022
d4d7375
commented out the namespace related api temporarily
Oct 20, 2022
ed16d9d
PB-3144: Not creating namespaces for nfs backuplocation type in contr…
diptiranjanpx Oct 20, 2022
f09b24b
Uncommented the definition of namespaceRestoreAllowed and verifyNames…
Nov 2, 2022
f21ad77
fixed compilation error came as part of merger and rebase
Nov 2, 2022
4662240
NFS volume restore implementation
prashanthpx Oct 26, 2022
f2c4e90
PB-3211: Mapping nfs restore statuses to stork restore statuses and u…
diptiranjanpx Nov 3, 2022
359d849
Populating NFS backup size, appended nfs to job names
prashanthpx Nov 4, 2022
4ea8932
pb-3100: Added check to take kdmp backup, if it is PX volume and NFS
Nov 5, 2022
12959c7
pb-3213: Send the triggeredFrom values to nfs specific CRs
lalat-das Nov 6, 2022
4c41c42
Delete how ed4bac3825565902733b151138c32367231e48b3
lalat-das Nov 7, 2022
82b5d02
Prashanth - Addressing review comments
prashanthpx Nov 7, 2022
91a5f28
travis file change for 2.12-nfs branch
Nov 7, 2022
5bf94e8
pb-3258: Added TriggeredFromxxx field for resourceExport as well
Nov 11, 2022
e0cab3b
Appended restore backup with nfs for jobs
prashanthpx Nov 11, 2022
dc6cd00
pb-3306: Removing setting of CR status to success before checking for
prashanthpx Nov 17, 2022
a402768
pb-3312: Added steps to delete the resourceexport CR, when restore fails
Nov 19, 2022
1315e4b
fixed error message in restore
px-kesavan Nov 16, 2022
745782b
pb-3320: Enforce kdmp backup for all cloud provisioner for NFS BL
lalat-das Nov 23, 2022
78ff5b4
pb-3347: Make CSI volumes to use kdmp driver for NFS BL
lalat-das Nov 30, 2022
98d0674
pb-3358: In case of NFS BL prevent local snapshot
lalat-das Dec 7, 2022
6ecaab2
PB-3430: support for uploading storageclasses.json to nfs backuplocation
Jan 23, 2023
5b0409f
Fix a branch merge issue between 2.12-nfs and master
lalat-das Feb 8, 2023
f908c62
Revert "PWX-28818: Update libxml for vulnerability fixes (#1270)" (#1…
pp511 Feb 9, 2023
e281d6d
PWX-27015: Remove unwanted events during volume update retries. (#1272)
pp511 Feb 9, 2023
9249cd8
[PWX-27076, PWX-26970]: Fix confluent kafka async dr migration issues…
pp511 Feb 9, 2023
99276b8
vendored kdmp master to stork 2.5.0-nfs branch
lalat-das Feb 9, 2023
e0ade76
Removing the usage of kdmp driver for px volumes.
lalat-das Feb 9, 2023
2dc20b8
Makefile and .travis file changes
Feb 11, 2023
f53db0d
Revert "Added test for Clone PVCs after DR on destination cluster (#1…
Rohit-PX Feb 9, 2023
f4bb705
PWX-27511: applicationactivated to be set to true as part of storkctl…
diptiranjanpx Feb 9, 2023
b2283e1
PB-3514: Modified storkcache.Instance() nil check.
diptiranjanpx Feb 13, 2023
a37e248
PB-3397: Backed Nameapecs based on namespace label selector (#1258)
sgajawada-px Jan 31, 2023
51d8b57
pb-3338: Added support for handling default storage class request in the
Feb 5, 2023
ea26b2e
pb-3447: changes to upload snapshot.json for native csi driver.
Jan 27, 2023
15ed8c1
Fixed the compilation error
Feb 16, 2023
e7677b4
pb-3532: Added check to handle the cases where cache is not present.
Feb 16, 2023
6a5b2cb
Added changes to support rancher project mapping
px-kesavan Feb 9, 2023
c754021
Added changes for project id mapping when on retain
px-kesavan Feb 16, 2023
8b7c30e
Removed rancher project extraction from label.
px-kesavan Feb 18, 2023
2ffca9f
Added check for presence of platform cred name before calling a.updat…
Feb 21, 2023
779b167
PWX-29223: Remove finalizer when deleting CR during migration (#1295)
pp511 Feb 22, 2023
7f8e06e
PWX-29218: Do not log retry events during migration (#1293)
pp511 Feb 22, 2023
e2c826f
pb-3557: Added check to return from applicationbackup handler, if stage
Feb 21, 2023
89219c9
pb-3571: Added changes to seperate mergeSupportedForResource required…
Feb 21, 2023
082728a
Handled nil pointer case when rancher client is not created
px-kesavan Feb 22, 2023
764a3bb
PWX-28751: Fix svc and sa update issue on secondary cluster (#1290)
pp511 Feb 22, 2023
404efad
PWX-29170: Updating google cloud sdk to fix vulnerability issues. (#1…
pp511 Feb 23, 2023
4d489d8
pb-3554: Modified the status message if zero namespace is selected fo…
Feb 23, 2023
76da3f5
PB-3453: Enabling csi snapshot for generic backup for nfs backuplocat…
diptiranjanpx Feb 21, 2023
93ab855
PWX-29253: Adding support for gke-gcloud-auth-plugin (#1312)
pp511 Feb 27, 2023
10d7b89
PB-3588: ApplicationBackupSpec NamespaceSelector schema change from a…
sgajawada-px Feb 28, 2023
96feec3
vendored sched-ops master to 2.5.0-nfs branch
lalat-das Mar 1, 2023
f7faf04
PWX-29068: Improving storkctl create clusterpair help output. (#1314)
pp511 Feb 28, 2023
fde1467
Security fix - upgraded rancher pkg to fix critical issues
px-kesavan Mar 1, 2023
ac904c3
Added changes to fix nil dereferencing in PrepareResourceForApply.
px-kesavan Mar 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sudo: required
dist: xenial
language: go
go:
- 1.18.3
- 1.19.1
before_install:
- sudo apt-get update -yq || true
- sudo apt-get install go-md2man -y
Expand All @@ -12,16 +12,16 @@ cache:
- $HOME/.cache/go-build
script:
- |
if [ "${TRAVIS_BRANCH}" == "master" ]; then
export DOCKER_HUB_STORK_TAG=master
export DOCKER_HUB_STORK_TEST_TAG=latest
export DOCKER_HUB_CMD_EXECUTOR_TAG=master
if [ "${TRAVIS_BRANCH}" == "2.5.0-nfs" ]; then
export DOCKER_HUB_STORK_TAG="${TRAVIS_BRANCH}"-dev
export DOCKER_HUB_STORK_TEST_TAG="${TRAVIS_BRANCH}"-dev
export DOCKER_HUB_CMD_EXECUTOR_TAG="${TRAVIS_BRANCH}"-dev
else
export DOCKER_HUB_STORK_TAG=`git rev-parse --short HEAD`
export DOCKER_HUB_STORK_TEST_TAG=`git rev-parse --short HEAD`
export DOCKER_HUB_CMD_EXECUTOR_TAG=`git rev-parse --short HEAD`
fi
travis_wait 30 make -j 2 && make test && make container && make integration-test && make integration-test-container &&
travis_wait 45 make -j 2 && make test && make container && make integration-test && make integration-test-container &&
if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
docker login -u "${DOCKER_USER}" -p "${DOCKER_PASSWORD}";
make deploy;
Expand Down
21 changes: 12 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ RUN python3 -m pip install awscli && python3 -m pip install rsa --upgrade
RUN curl -q -o /usr/local/bin/aws-iam-authenticator https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-07-26/bin/linux/amd64/aws-iam-authenticator && \
chmod +x /usr/local/bin/aws-iam-authenticator

ARG GCLOUD_SDK=google-cloud-sdk-413.0.0-linux-x86_64.tar.gz
# Remove the test directories
# Also don't need gsutil
#Install Google Cloud SDK
ARG GCLOUD_SDK=google-cloud-sdk-418.0.0-linux-x86_64.tar.gz
ARG GCLOUD_INSTALL_DIR="/usr/lib"
RUN curl -q -o $GCLOUD_SDK https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/$GCLOUD_SDK && \
tar xf $GCLOUD_SDK && rm -rf $GCLOUD_SDK && \
rm -rf /google-cloud-sdk/platform/gsutil/third_party/oauth2client/tests \
/google-cloud-sdk/platform/gsutil/third_party/rsa/tests \
/google-cloud-sdk/platform/gsutil/third_party/httplib2/python2/httplib2/test \
/google-cloud-sdk/platform/gsutil && \
python3 -m pip install pyyaml>=5.1 rsa>=4.0 urllib3>=1.24.2 --upgrade -t /google-cloud-sdk/lib/third_party
tar xf $GCLOUD_SDK -C $GCLOUD_INSTALL_DIR && rm -rf $GCLOUD_SDK && \
rm -rf $GCLOUD_INSTALL_DIR/google-cloud-sdk/platform/gsutil \
$GCLOUD_INSTALL_DIR/google-cloud-sdk/RELEASE_NOTES
ENV PATH "${PATH}:$GCLOUD_INSTALL_DIR/google-cloud-sdk/bin"
#Install gke-gcloud-auth-plugin
RUN gcloud components install gke-gcloud-auth-plugin
#Create symlink /google-cloud-sdk/bin -> /usr/lib/google-cloud-sdk/bin for legacy cluster pair with gcp auth plugin
RUN mkdir google-cloud-sdk
RUN ln -s /usr/lib/google-cloud-sdk/bin /google-cloud-sdk/bin

WORKDIR /

Expand Down
27 changes: 19 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ifeq ($(BUILD_TYPE),debug)
BUILDFLAGS += -gcflags "-N -l"
endif

RELEASE_VER := 2.7.0
RELEASE_VER := 2.5.0-nfs
BASE_DIR := $(shell git rev-parse --show-toplevel)
GIT_SHA := $(shell git rev-parse --short HEAD)
BIN :=$(BASE_DIR)/bin
Expand Down Expand Up @@ -113,7 +113,9 @@ test:

integration-test:
@echo "Building stork integration tests"
@cd test/integration_test && GOOS=linux go test -tags integrationtest $(BUILD_OPTIONS) -v -c -o stork.test
docker run --rm -v $(shell pwd):/go/src/github.com/libopenstorage/stork $(DOCK_BUILD_CNT) \
/bin/bash -c 'cd /go/src/github.com/libopenstorage/stork/test/integration_test && \
GOOS=linux go test -tags integrationtest $(BUILD_OPTIONS) -v -c -o stork.test;'

integration-test-container:
@echo "Building container: docker build --tag $(STORK_TEST_IMG) -f Dockerfile ."
Expand All @@ -130,21 +132,30 @@ codegen:

stork:
@echo "Building the stork binary"
@cd cmd/stork && CGO_ENABLED=0 GOOS=linux go build $(BUILD_OPTIONS) -o $(BIN)/stork
docker run --rm -v $(shell pwd):/go/src/github.com/libopenstorage/stork $(DOCK_BUILD_CNT) \
/bin/bash -c 'cd /go/src/github.com/libopenstorage/stork/cmd/stork && \
CGO_ENABLED=0 GOOS=linux go build $(BUILD_OPTIONS) -o /go/src/github.com/libopenstorage/stork/bin/stork;'

cmdexecutor:
@echo "Building command executor binary"
@cd cmd/cmdexecutor && GOOS=linux go build $(BUILD_OPTIONS) -o $(BIN)/cmdexecutor
docker run --rm -v $(shell pwd):/go/src/github.com/libopenstorage/stork $(DOCK_BUILD_CNT) \
/bin/bash -c 'cd /go/src/github.com/libopenstorage/stork/cmd/cmdexecutor && \
GOOS=linux go build $(BUILD_OPTIONS) -o /go/src/github.com/libopenstorage/stork/bin/cmdexecutor;'

storkctl:
@echo "Building storkctl"
@cd cmd/storkctl && CGO_ENABLED=0 GOOS=linux go build $(BUILD_OPTIONS) -o $(BIN)/linux/storkctl
@cd cmd/storkctl && CGO_ENABLED=0 GOOS=darwin go build $(BUILD_OPTIONS) -o $(BIN)/darwin/storkctl
@cd cmd/storkctl && CGO_ENABLED=0 GOOS=windows go build $(BUILD_OPTIONS) -o $(BIN)/windows/storkctl.exe
docker run --rm -v $(shell pwd):/go/src/github.com/libopenstorage/stork $(DOCK_BUILD_CNT) \
/bin/bash -c 'cd /go/src/github.com/libopenstorage/stork/cmd/storkctl; \
CGO_ENABLED=0 GOOS=linux go build $(BUILD_OPTIONS) -o /go/src/github.com/libopenstorage/stork/bin/linux/storkctl; \
CGO_ENABLED=0 GOOS=darwin go build $(BUILD_OPTIONS) -o /go/src/github.com/libopenstorage/stork/bin/darwin/storkctl; \
CGO_ENABLED=0 GOOS=windows go build $(BUILD_OPTIONS) -o /go/src/github.com/libopenstorage/stork/bin/windows/storkctl.exe;'

px-statfs:
@echo "Building px_statfs.so"
@cd drivers/volume/portworx/px-statfs && gcc -g -shared -fPIC -o $(BIN)/px_statfs.so px_statfs.c -ldl -D__USE_LARGEFILE64
docker run --rm -v $(shell pwd):/go/src/github.com/libopenstorage/stork $(DOCK_BUILD_CNT) \
/bin/bash -c 'cd /go/src/github.com/libopenstorage/stork/drivers/volume/portworx/px-statfs && \
gcc -g -shared -fPIC -o /go/src/github.com/libopenstorage/stork/bin/px_statfs.so px_statfs.c -ldl -D__USE_LARGEFILE64;'


container: help
@echo "Building container: docker build --build-arg VERSION=$(DOCKER_HUB_STORK_TAG) --build-arg RELEASE=$(DOCKER_HUB_STORK_TAG) --tag $(STORK_IMG) -f Dockerfile . "
Expand Down
21 changes: 17 additions & 4 deletions cmd/stork/stork.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"context"
"flag"
"github.com/libopenstorage/stork/pkg/cache"
"net/http"
"os"
"os/signal"
Expand All @@ -23,6 +22,7 @@ import (
_ "github.com/libopenstorage/stork/drivers/volume/portworx"
"github.com/libopenstorage/stork/pkg/apis"
"github.com/libopenstorage/stork/pkg/applicationmanager"
"github.com/libopenstorage/stork/pkg/cache"
"github.com/libopenstorage/stork/pkg/clusterdomains"
"github.com/libopenstorage/stork/pkg/dbg"
"github.com/libopenstorage/stork/pkg/extender"
Expand All @@ -43,6 +43,7 @@ import (
"github.com/libopenstorage/stork/pkg/webhookadmission"
kdmpapi "github.com/portworx/kdmp/pkg/apis/kdmp/v1alpha1"
"github.com/portworx/kdmp/pkg/controllers/dataexport"
"github.com/portworx/kdmp/pkg/controllers/resourceexport"
"github.com/portworx/kdmp/pkg/drivers"
"github.com/portworx/kdmp/pkg/jobratelimit"
kdmpversion "github.com/portworx/kdmp/pkg/version"
Expand Down Expand Up @@ -187,12 +188,12 @@ func main() {
cli.IntFlag{
Name: "k8s-api-qps",
Value: 100,
Usage: "Restrict number of k8s api requests from stork (default: 100 QPS)",
Usage: "Restrict number of k8s API requests from stork (default: 100 QPS)",
},
cli.IntFlag{
Name: "k8s-api-burst",
Value: 100,
Usage: "Restrict number of k8s api requests from stork (default: 100 Burst)",
Usage: "Restrict number of k8s API requests from stork (default: 100 Burst)",
},
cli.BoolTFlag{
Name: "kdmp-controller",
Expand All @@ -209,6 +210,10 @@ func main() {
},
}

// Export USE_GKE_GCLOUD_AUTH_PLUGIN=True
log.Warnf("Export USE_GKE_GCLOUD_AUTH_PLUGIN=True")
os.Setenv("USE_GKE_GCLOUD_AUTH_PLUGIN", "True")

if err := app.Run(os.Args); err != nil {
log.Fatalf("Error starting stork: %v", err)
}
Expand Down Expand Up @@ -393,7 +398,7 @@ func run(c *cli.Context) {
EventRecorder: recorder,
}
resourceLock, err := resourcelock.New(
resourcelock.ConfigMapsResourceLock,
resourcelock.ConfigMapsLeasesResourceLock,
lockObjectNamespace,
lockObjectName,
k8sClient.CoreV1(),
Expand Down Expand Up @@ -547,6 +552,14 @@ func runStork(mgr manager.Manager, ctx context.Context, d volume.Driver, recorde
if err := dataexport.Init(mgr); err != nil {
log.Fatalf("Error initializing kdmp controller: %v", err)
}
resourceexport, err := resourceexport.NewController(mgr)
if err != nil {
log.Fatalf("Error initializing resource export controller: %v", err)
}

if err := resourceexport.Init(mgr); err != nil {
log.Fatalf("Error initializing resource export controller manager: %v", err)
}
}

go func() {
Expand Down
6 changes: 6 additions & 0 deletions drivers/volume/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,17 @@ func (a *aws) OwnsPVCForBackup(
pvc *v1.PersistentVolumeClaim,
cmBackupType string,
crBackupType string,
blType storkapi.BackupLocationType,
) bool {
if cmBackupType == storkapi.ApplicationBackupGeneric {
// If user has forced the backupType in config map, default to generic always
return false
}
// For AWS volume and backuplocation type is NFS, we will not own.
// It will default to kdmp
if blType == storkapi.BackupLocationNFS {
return false
}
return a.OwnsPVC(coreOps, pvc)
}

Expand Down
10 changes: 8 additions & 2 deletions drivers/volume/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"time"

Expand Down Expand Up @@ -127,7 +127,7 @@ func (a *azure) getMetadata() (map[string]string, error) {
if resp.StatusCode != 200 {
return nil, fmt.Errorf("error querying Azure metadata: Code %d returned for url %s", resp.StatusCode, req.URL)
}
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("error querying Azure metadata: %v", err)
}
Expand Down Expand Up @@ -157,11 +157,17 @@ func (a *azure) OwnsPVCForBackup(
pvc *v1.PersistentVolumeClaim,
cmBackupType string,
crBackupType string,
blType storkapi.BackupLocationType,
) bool {
if cmBackupType == storkapi.ApplicationBackupGeneric {
// If user has forced the backupType in config map, default to generic always
return false
}
// For Azure based volume and backuplocation type is NFS, we will not own.
// It will default to kdmp
if blType == storkapi.BackupLocationNFS {
return false
}
return a.OwnsPVC(coreOps, pvc)
}

Expand Down
Loading