Skip to content

Commit

Permalink
Merge branch 'master' into PWX-35924
Browse files Browse the repository at this point in the history
  • Loading branch information
svijaykumar-px authored Feb 21, 2024
2 parents 57345ba + b8577dd commit f186d1f
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 37 deletions.
14 changes: 1 addition & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,8 @@ before_install:
- sudo mv opm /usr/local/bin/opm
script:
- |
echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USER}" --password-stdin
if [ "${TRAVIS_BRANCH}" == "master" ]; then
export DOCKER_HUB_OPERATOR_TAG=master
export DOCKER_HUB_OPERATOR_TEST_TAG=master
else
export DOCKER_HUB_OPERATOR_TAG=`git rev-parse --short HEAD`
export DOCKER_HUB_OPERATOR_TEST_TAG=`git rev-parse --short HEAD`
fi
make vendor-update all test verify-bundle-dir container integration-test integration-test-container &&
make vendor-update all test verify-bundle-dir &&
if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
make deploy;
make integration-test-deploy;
if [ "${TRAVIS_BRANCH}" == "master" ]; then
make bundle catalog
fi
Expand All @@ -29,5 +19,3 @@ notifications:
email:
on_success: always
on_failure: always
after_success:
- bash <(curl -s https://codecov.io/bash)
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,8 @@ ifndef BASE_REGISTRY_IMG
$(warning BASE_REGISTRY_IMG not defined, using '$(BASE_REGISTRY_IMG)' instead)
endif

HAS_GOMODULES := $(shell go help mod why 2> /dev/null)

ifdef HAS_GOMODULES
export GO111MODULE=on
export GOFLAGS=-mod=vendor
else
$(error operator can only be built with go 1.11+ which supports go modules)
endif

ifndef PKGS
PKGS := $(shell GOFLAGS=-mod=vendor go list ./... 2>&1 | grep -v 'pkg/client/informers/externalversions' | grep -v versioned | grep -v 'pkg/apis/core')
Expand Down
14 changes: 14 additions & 0 deletions build.jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pipeline {
agent {
label "px-operator-builder"
}

stages {
stage("Build Operator") {
steps {
build(job: "${PX_OPERATOR_BUILD_JOB_NAME}", parameters: [string(name: "GIT_BRANCH", value: GIT_BRANCH)])
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ metadata:
capabilities: Auto Pilot
categories: "Storage"
description: Cloud native storage solution for production workloads
containerImage: portworx/px-operator:23.10.3-dev
containerImage: registry.connect.redhat.com/portworx/openstorage-operator@sha256:d1a7a6e1335945d2ac856fbfdddb9ffef2ca3c23242a0cb909f7aefe94cad484
repository: https://github.com/libopenstorage/operator
createdAt: 2024-01-23T06:47:42Z
createdAt: 2024-02-08T23:01:07Z
support: Portworx, Inc
certified: "true"
console.openshift.io/plugins: '["portworx"]'
Expand Down Expand Up @@ -62,7 +62,7 @@ spec:
keywords: ["portworx", "persistent storage", "storage", "cloud native", "open source"]
relatedImages:
- name: portworx-operator
image: portworx/px-operator:23.10.3-dev
image: registry.connect.redhat.com/portworx/openstorage-operator@sha256:d1a7a6e1335945d2ac856fbfdddb9ffef2ca3c23242a0cb909f7aefe94cad484
labels:
operated-by: portworx-operator
selector:
Expand Down Expand Up @@ -219,7 +219,7 @@ spec:
topologyKey: kubernetes.io/hostname
containers:
- name: portworx-operator
image: portworx/px-operator:23.10.3-dev
image: registry.connect.redhat.com/portworx/openstorage-operator@sha256:d1a7a6e1335945d2ac856fbfdddb9ffef2ca3c23242a0cb909f7aefe94cad484
imagePullPolicy: Always
command:
- /operator
Expand Down
2 changes: 1 addition & 1 deletion drivers/storage/portworx/component/autopilot.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ var (
},
{
Name: "ca-cert-volume",
MountPath: "/etc/ssl/certs",
MountPath: "/etc/ssl/px-custom/1",
ReadOnly: true,
VolumeSource: v1.VolumeSource{
Secret: &v1.SecretVolumeSource{
Expand Down
25 changes: 15 additions & 10 deletions drivers/storage/portworx/component/disruption_budget.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,22 @@ func (c *disruptionBudget) createPortworxPodDisruptionBudget(
}

var minAvailable int
if err != nil || userProvidedMinValue < 0 {
c.sdkConn, err = pxutil.GetPortworxConn(c.sdkConn, c.k8sClient, cluster.Namespace)
if err != nil {
return err
}
c.sdkConn, err = pxutil.GetPortworxConn(c.sdkConn, c.k8sClient, cluster.Namespace)
if err != nil {
return err
}

storageNodesCount, err := pxutil.CountStorageNodes(cluster, c.sdkConn, c.k8sClient)
if err != nil {
c.closeSdkConn()
return err
}
storageNodesCount, err := pxutil.CountStorageNodes(cluster, c.sdkConn, c.k8sClient)
if err != nil {
c.closeSdkConn()
return err
}

// Set minAvailable value to storagenodes-1 if no value is provided,
// or if the user provided value is lesser than 0
// or greater than or equal to the number of storage nodes.
if userProvidedMinValue < 0 || userProvidedMinValue >= storageNodesCount {
logrus.Warnf("Value for px-storage pod disruption budget not provided or is invalid, using default calculated value %d: ", storageNodesCount-1)
minAvailable = storageNodesCount - 1
} else {
minAvailable = userProvidedMinValue
Expand Down
15 changes: 14 additions & 1 deletion drivers/storage/portworx/components_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12061,6 +12061,19 @@ func TestPodDisruptionBudgetEnabled(t *testing.T) {
require.Equal(t, 4, storagePDB.Spec.MinAvailable.IntValue())

// TestCase: Update storage PDB if overwritten using annotation
cluster.Annotations[pxutil.AnnotationStoragePodDisruptionBudget] = "3"

err = driver.PreInstall(cluster)
require.NoError(t, err)

storagePDB = &policyv1.PodDisruptionBudget{}
err = testutil.Get(k8sClient, storagePDB, component.StoragePodDisruptionBudgetName, cluster.Namespace)
require.NoError(t, err)

require.Equal(t, 3, storagePDB.Spec.MinAvailable.IntValue())

// TestCase: Ignore annotation and go back to default PDB calculation
// if annotation value is greater than or equal to storagenodes
cluster.Annotations[pxutil.AnnotationStoragePodDisruptionBudget] = "10"

err = driver.PreInstall(cluster)
Expand All @@ -12070,7 +12083,7 @@ func TestPodDisruptionBudgetEnabled(t *testing.T) {
err = testutil.Get(k8sClient, storagePDB, component.StoragePodDisruptionBudgetName, cluster.Namespace)
require.NoError(t, err)

require.Equal(t, 10, storagePDB.Spec.MinAvailable.IntValue())
require.Equal(t, 4, storagePDB.Spec.MinAvailable.IntValue())

// TestCase: Use NonQuorumMember flag to determine storage node count
cluster.Annotations[pxutil.AnnotationStoragePodDisruptionBudget] = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ spec:
name: autopilot
volumeMounts:
- name: ca-cert-volume
mountPath: /etc/ssl/certs
mountPath: /etc/ssl/px-custom/1
readOnly: true
- name: config-volume
mountPath: /etc/config
Expand Down
2 changes: 1 addition & 1 deletion drivers/storage/portworx/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ func GetPortworxConn(sdkConn *grpc.ClientConn, k8sClient client.Client, namespac
}

// note, using symbolic name for the `endpoint`, as SSL certificates won't have K8s service IP
endpoint := PortworxServiceName + "." + namespace + ".svc.cluster.local"
endpoint := PortworxServiceName + "." + namespace
sdkPort := defaultSDKPort

// Get the ports from service
Expand Down

0 comments on commit f186d1f

Please sign in to comment.