-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from seungkyua/20220530_upgrade_transformer
- Loading branch information
Showing
9 changed files
with
675 additions
and
451 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,10 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Go 1.14 | ||
- name: Set up Go 1.16 | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14 | ||
go-version: 1.16 | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
@@ -23,8 +23,7 @@ jobs: | |
env: | ||
GO111MODULE: "on" | ||
run: | | ||
kustomize_version=$(sed -nr 's/\* kustomize [^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p' README.md) | ||
go get sigs.k8s.io/kustomize/kustomize/v3@v$kustomize_version | ||
go get sigs.k8s.io/kustomize/kustomize/[email protected] | ||
- name: Build | ||
run: | | ||
|
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 |
---|---|---|
|
@@ -12,4 +12,4 @@ | |
*.out | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
# vendor/ | ||
vendor/ |
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 |
---|---|---|
@@ -1,31 +1,61 @@ | ||
FROM alpine:latest | ||
|
||
MAINTAINER SKTelecom 5GX Cloud Labs | ||
FROM golang:1.16.15-alpine3.15 AS builder | ||
LABEL AUTHOR Seungkyu Ahn ([email protected]) | ||
|
||
ENV KUSTOMIZE_VER v4.2.0 | ||
ENV HOME /root | ||
ENV GO111MODULE on | ||
ENV PATH /usr/local/go/bin:$PATH | ||
ENV GOROOT /usr/local/go | ||
ENV GOPATH $HOME/golang | ||
# on means using vendor directory | ||
ENV GO111MODULE on | ||
# CGO_ENABLED=1 default value means using link | ||
ENV CGO_ENABLED 1 | ||
|
||
RUN mkdir -p $HOME/golang | ||
RUN mkdir -p $HOME/.config/kustomize/plugin/openinfradev.github.com/v1/helmvaluestransformer | ||
|
||
RUN apk update && apk add --no-cache curl git jq openssh libc6-compat build-base bash | ||
RUN apk update && apk add git curl tar bash build-base | ||
|
||
|
||
WORKDIR $HOME | ||
COPY . $HOME/kustomize-helm-transformer | ||
RUN cat kustomize-helm-transformer/README.md | grep -m 1 "* kustomize" | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p' > .kustomize_version | ||
RUN cat kustomize-helm-transformer/README.md | grep -m 1 "* go" | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p' > .golang_version | ||
|
||
WORKDIR /usr/local | ||
RUN curl -fL https://dl.google.com/go/go$(cat $HOME/.golang_version).linux-amd64.tar.gz | tar xz | ||
|
||
RUN go get sigs.k8s.io/kustomize/kustomize/v3@v$(cat $HOME/.kustomize_version) | ||
RUN mv $GOPATH/bin/kustomize /usr/local/bin/ | ||
# install kustomize from source | ||
WORKDIR $HOME | ||
RUN git clone https://github.com/kubernetes-sigs/kustomize.git | ||
WORKDIR $HOME/kustomize | ||
RUN git checkout -b tags_${KUSTOMIZE_VER} tags/kustomize/${KUSTOMIZE_VER} | ||
WORKDIR $HOME/kustomize/kustomize | ||
RUN unset GOPATH && unset GO111MODULES && go install . | ||
RUN cp $HOME/go/bin/kustomize /usr/local/bin/ | ||
|
||
|
||
# plugin copy | ||
RUN rm -rf $HOME/kustomize/plugin/* | ||
RUN cp -r $HOME/kustomize-helm-transformer/plugin/openinfradev.github.com $HOME/kustomize/plugin/ | ||
|
||
|
||
WORKDIR $HOME/kustomize/plugin/openinfradev.github.com/v1/helmvaluestransformer | ||
RUN rm -rf vendor && rm -f go.mod go.sum | ||
RUN mv kustomize-${KUSTOMIZE_VER}-go.mod go.mod | ||
# update go.mod and go.sum | ||
RUN unset GOPATH && unset GO111MODULES && go mod tidy | ||
|
||
|
||
WORKDIR $HOME/kustomize | ||
RUN unset GOPATH && unset GO111MODULES && ./hack/buildExternalGoPlugins.sh ./plugin | ||
|
||
|
||
|
||
|
||
|
||
FROM alpine:edge | ||
LABEL AUTHOR Seungkyu Ahn ([email protected]) | ||
|
||
RUN apk add --no-cache bash git | ||
|
||
USER root | ||
|
||
WORKDIR $HOME/kustomize-helm-transformer/plugin/openinfradev.github.com/v1/helmvaluestransformer/ | ||
RUN go test | ||
RUN mv HelmValuesTransformer.so $HOME/.config/kustomize/plugin/openinfradev.github.com/v1/helmvaluestransformer/ | ||
RUN mkdir -p /root/.config/kustomize/plugin/openinfradev.github.com/v1/helmvaluestransformer | ||
COPY --from=builder /root/kustomize/plugin/openinfradev.github.com/v1/helmvaluestransformer/HelmValuesTransformer.so /root/.config/kustomize/plugin/openinfradev.github.com/v1/helmvaluestransformer/ | ||
COPY --from=builder /usr/local/bin/kustomize /usr/local/bin/kustomize | ||
WORKDIR /root | ||
|
||
WORKDIR / | ||
CMD ["kustomize"] |
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,38 @@ | ||
apiVersion: helm.fluxcd.io/v1 | ||
kind: HelmRelease | ||
metadata: | ||
name: glance | ||
spec: | ||
chart: | ||
name: glance | ||
repository: http://helm-chart-repository | ||
version: 1.0.0 | ||
releaseName: glance | ||
targetNamespace: openstack | ||
values: | ||
bootstrap: | ||
enabled: true | ||
structured: | ||
images: | ||
cirros: | ||
id: 201084fc-c276-4744-8504-cb974dbb3610 | ||
image_file: cirros-0.4.0-x86_64-disk.img | ||
name: Cirros 0.4.0 64-bit | ||
private: false | ||
source_url: http://download.cirros-cloud.net/0.4.0/ | ||
conf: | ||
ceph: | ||
admin_keyring: admin_keyring | ||
enabled: true | ||
glance: | ||
DEFAULT: | ||
show_image_direct_url: true | ||
show_multiple_locations: true | ||
glance_store: | ||
rbd_store_pool: images | ||
rbd_store_user: glance | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: elasticsearch-data | ||
spec: | ||
storageClassName: ceph |
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
31 changes: 18 additions & 13 deletions
31
plugin/openinfradev.github.com/v1/helmvaluestransformer/go.mod
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 |
---|---|---|
@@ -1,17 +1,22 @@ | ||
module github.com/openinfradev/kustomize-helm-transformer/openinfradev.github.com/v1 | ||
module github.com/openinfradev/kustomize-helm-transformer/plugin/openinfradev.github.com/v1/helmvaluestransformer | ||
|
||
go 1.14 | ||
go 1.16 | ||
|
||
require ( | ||
github.com/google/go-cmp v0.5.2 // indirect | ||
github.com/kr/text v0.2.0 // indirect | ||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
github.com/stretchr/testify v1.6.1 // indirect | ||
golang.org/x/net v0.0.0-20200625001655-4c5254603344 // indirect | ||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect | ||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect | ||
k8s.io/client-go v0.18.10 // indirect | ||
sigs.k8s.io/kustomize/api v0.6.5 | ||
sigs.k8s.io/kustomize/kyaml v0.9.4 | ||
github.com/evanphx/json-patch v5.6.0+incompatible // indirect | ||
github.com/go-errors/errors v1.4.2 // indirect | ||
github.com/go-openapi/jsonreference v0.20.0 // indirect | ||
github.com/go-openapi/swag v0.21.1 // indirect | ||
github.com/google/gnostic v0.6.9 // indirect | ||
github.com/imdario/mergo v0.3.13 // indirect | ||
github.com/mailru/easyjson v0.7.7 // indirect | ||
github.com/pkg/errors v0.9.1 | ||
github.com/xlab/treeprint v1.1.0 // indirect | ||
go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd // indirect | ||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
k8s.io/kube-openapi v0.0.0-20220413171646-5e7f5fdc6da6 // indirect | ||
sigs.k8s.io/kustomize/api v0.11.5 | ||
sigs.k8s.io/kustomize/kyaml v0.13.7 | ||
sigs.k8s.io/yaml v1.3.0 | ||
) |
Oops, something went wrong.