-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Metadata Syncer for vsphere CSI Driver
- Loading branch information
1 parent
c00454d
commit 25600fe
Showing
8 changed files
with
650 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
Copyright 2019 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package main | ||
|
||
import ( | ||
"flag" | ||
"os" | ||
|
||
"k8s.io/klog" | ||
|
||
metadatasyncer "sigs.k8s.io/vsphere-csi-driver/pkg/syncer" | ||
) | ||
|
||
// main is ignored when this package is built as a go plug-in. | ||
func main() { | ||
klog.InitFlags(nil) | ||
flag.Parse() | ||
metadataSyncer := metadatasyncer.NewInformer() | ||
if err := metadataSyncer.Init(); err != nil { | ||
klog.Errorf("Error initializing Metadata Syncer") | ||
os.Exit(1) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
################################################################################ | ||
## BUILD ARGS ## | ||
################################################################################ | ||
# This build arg allows the specification of a custom Golang image. | ||
ARG GOLANG_IMAGE=golang:1.12.6 | ||
|
||
# This build arg allows the specification of a custom base image. | ||
ARG BASE_IMAGE=photon:2.0 | ||
|
||
################################################################################ | ||
## BUILD STAGE ## | ||
################################################################################ | ||
FROM ${GOLANG_IMAGE} as builder | ||
|
||
ARG GOPROXY | ||
|
||
WORKDIR /build | ||
|
||
COPY go.mod go.sum ./ | ||
|
||
COPY pkg/ pkg/ | ||
|
||
COPY cmd/ cmd/ | ||
|
||
ENV CGO_ENABLED=0 | ||
|
||
ENV GOPROXY ${GOPROXY:-} | ||
|
||
RUN go build -o vsphere-syncer ./cmd/syncer | ||
|
||
################################################################################ | ||
## MAIN STAGE ## | ||
################################################################################ | ||
FROM ${BASE_IMAGE} | ||
|
||
COPY --from=builder /build/vsphere-syncer /bin/vsphere-syncer | ||
|
||
ENTRYPOINT ["/bin/vsphere-syncer"] |
Oops, something went wrong.