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

fix(cvc): set the bind address using a go flag in cvc server config #332

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 1 addition & 3 deletions build/cvc-operator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ RUN apk add --no-cache \
ca-certificates

COPY cvc-operator /usr/local/bin/cvc-operator
COPY entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh

ARG ARCH
ARG DBUILD_DATE
Expand All @@ -38,5 +36,5 @@ LABEL org.label-schema.build-date=$DBUILD_DATE
LABEL org.label-schema.vcs-url=$DBUILD_REPO_URL
LABEL org.label-schema.url=$DBUILD_SITE_URL

ENTRYPOINT entrypoint.sh
ENTRYPOINT ["/usr/local/bin/cvc-operator"]
EXPOSE 5757
45 changes: 0 additions & 45 deletions build/cvc-operator/Dockerfile.arm64

This file was deleted.

4 changes: 1 addition & 3 deletions build/cvc-operator/cvc-operator.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ LABEL org.label-schema.vcs-url=$DBUILD_REPO_URL
LABEL org.label-schema.url=$DBUILD_SITE_URL

COPY --from=build /go/src/github.com/openebs/cstor-operator/bin/cvc-operator/cvc-operator /usr/local/bin/cvc-operator
COPY --from=build /go/src/github.com/openebs/cstor-operator/build/cvc-operator/entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh

ENTRYPOINT entrypoint.sh
ENTRYPOINT ["/usr/local/bin/cvc-operator"]
EXPOSE 5757
21 changes: 0 additions & 21 deletions build/cvc-operator/entrypoint.sh

This file was deleted.

8 changes: 8 additions & 0 deletions deploy/cstor-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ spec:
- name: cvc-operator
imagePullPolicy: IfNotPresent
image: openebs/cvc-operator:ci
args:
- "--v=2"
- "--leader-election=false"
- "--bind=$(OPENEBS_CVC_POD_IP)"
env:
# OPENEBS_IO_BASE_DIR is used to configure base directory for openebs on host path.
# Where OpenEBS can store required files. Default base path will be /var/openebs
Expand All @@ -104,6 +108,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: OPENEBS_CVC_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: OPENEBS_SERVICEACCOUNT_NAME
valueFrom:
fieldRef:
Expand Down
9 changes: 5 additions & 4 deletions pkg/controllers/cstorvolumeconfig/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ import (
"flag"
"os"
"os/signal"

"github.com/pkg/errors"
"k8s.io/klog"

"time"

clientset "github.com/openebs/api/v2/pkg/client/clientset/versioned"
Expand All @@ -33,10 +29,12 @@ import (
server "github.com/openebs/cstor-operators/pkg/server"
cvcserver "github.com/openebs/cstor-operators/pkg/server/cstorvolumeconfig"
"github.com/openebs/cstor-operators/pkg/snapshot"
"github.com/pkg/errors"
kubeinformers "k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/klog"
)

prateekpandey14 marked this conversation as resolved.
Show resolved Hide resolved
var (
Expand Down Expand Up @@ -174,7 +172,10 @@ func setupCVCServer(k8sclientset kubernetes.Interface, openebsClientset clientse
// Update BindAddress if address is provided as a option
if bindAddr != nil && *bindAddr != "" {
config.BindAddr = *bindAddr
} else {
klog.Fatalln("bindAddr does not have an IP configure, check the `bind` container arg")
}

config.Port = &port
err := config.NormalizeAddrs()
if err != nil {
Expand Down