Skip to content

Change data-source-validator to volume-data-source-validator #11

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

Merged
merged 1 commit into from
Aug 30, 2021
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: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

.PHONY: all data-source-validator clean test
.PHONY: all volume-data-source-validator clean test

CMDS=data-source-validator
CMDS=volume-data-source-validator
all: build

include release-tools/build.make
7 changes: 0 additions & 7 deletions cmd/data-source-validator/Dockerfile

This file was deleted.

7 changes: 7 additions & 0 deletions cmd/volume-data-source-validator/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM gcr.io/distroless/base:latest
LABEL maintainers="Kubernetes Authors"
LABEL description="Volume Data Source Validator Controller"
ARG binary=./bin/volume-data-source-validator

COPY ${binary} volume-data-source-validator
ENTRYPOINT ["/volume-data-source-validator"]
15 changes: 8 additions & 7 deletions deploy/kubernetes/rbac-data-source-validator.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# RBAC file for the data-source-validator controller
# RBAC file for the volume-data-source-validator controller
#
# The data-source-validator controller does asynchronous validation of PVC data sources
# The volume-data-source-validator controller does asynchronous validation of PVC data
# sources.
# It should be installed as part of the base Kubernetes distribution in an appropriate
# namespace for components implementing base system functionality. For installing with
# Vanilla Kubernetes, kube-system makes sense for the namespace.

apiVersion: v1
kind: ServiceAccount
metadata:
name: data-source-validator
name: volume-data-source-validator
namespace: kube-system

---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: data-source-validator
name: volume-data-source-validator
rules:
- apiGroups: [populator.storage.k8s.io]
resources: [volumepopulators]
Expand All @@ -31,12 +32,12 @@ rules:
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: data-source-validator
name: volume-data-source-validator
subjects:
- kind: ServiceAccount
name: data-source-validator
name: volume-data-source-validator
namespace: kube-system
roleRef:
kind: ClusterRole
name: data-source-validator
name: volume-data-source-validator
apiGroup: rbac.authorization.k8s.io
19 changes: 10 additions & 9 deletions deploy/kubernetes/setup-data-source-validator.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This YAML file shows how to deploy the data-source-validator controller
# This YAML file shows how to deploy the volume-data-source-validator controller

# The data-source-validator controller does asynchronous validation of PVC data sources
# The volume-data-source-validator controller does asynchronous validation of PVC data
# sources.
# It should be installed as part of the base Kubernetes distribution in an appropriate
# namespace for components implementing base system functionality. For installing with
# Vanilla Kubernetes, kube-system makes sense for the namespace.
Expand All @@ -9,23 +10,23 @@
kind: StatefulSet
apiVersion: apps/v1
metadata:
name: data-source-validator
name: volume-data-source-validator
namespace: kube-system
spec:
serviceName: data-source-validator
serviceName: volume-data-source-validator
replicas: 1
selector:
matchLabels:
app: data-source-validator
app: volume-data-source-validator
template:
metadata:
labels:
app: data-source-validator
app: volume-data-source-validator
spec:
serviceAccount: data-source-validator
serviceAccount: volume-data-source-validator
containers:
- name: data-source-validator
image: data-source-validator:latest
- name: volume-data-source-validator
image: volume-data-source-validator:latest
args:
- "--v=5"
- "--leader-election=false"
Expand Down
7 changes: 4 additions & 3 deletions pkg/data-source-validator/data_source_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
"k8s.io/klog/v2"

volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v4/apis/volumesnapshot/v1"

popv1alpha1 "github.com/kubernetes-csi/volume-data-source-validator/client/apis/volumepopulator/v1alpha1"
)

Expand Down Expand Up @@ -75,7 +76,7 @@ func NewDataSourceValidator(
broadcaster.StartLogging(klog.Infof)
broadcaster.StartRecordingToSink(&corev1.EventSinkImpl{Interface: client.CoreV1().Events(v1.NamespaceAll)})
var eventRecorder record.EventRecorder
eventRecorder = broadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: fmt.Sprintf("data-source-validator")})
eventRecorder = broadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: fmt.Sprintf("volume-data-source-validator")})

ctrl := &populatorController{
dynClient: dynClient,
Expand Down Expand Up @@ -105,8 +106,8 @@ func NewDataSourceValidator(
func (ctrl *populatorController) Run(workers int, stopCh <-chan struct{}) {
defer ctrl.queue.ShutDown()

klog.Infof("Starting data-source-validator controller")
defer klog.Infof("Shutting down data-source-validator controller")
klog.Infof("Starting volume-data-source-validator controller")
defer klog.Infof("Shutting down volume-data-source-validator controller")

if !cache.WaitForCacheSync(stopCh, ctrl.popListerSynced, ctrl.pvcListerSynced) {
klog.Errorf("Cannot sync caches")
Expand Down