Skip to content

Commit

Permalink
Upgrade operator SDK and Add Folder Sync feature (#11)
Browse files Browse the repository at this point in the history
* Update operator sdk & go modules

* Add tests from updated sdk

* Update docker file

Build lastpass-cli as the more recent stable versions are available as distro packages

* add pull policy to helm chart

* Generate manifests

Generate CRDs and Roles using controller-gen

* Operator-SDK Layout

Reorganized files to match newer operator-sdk layout.

* Scaffold Lastpass Group Types.

Created crd type files and manifests for lastpass group types

* Sync lastpass group

Added ability to sync entire lastpass folder, not including subfolders

* add missing crd

Add missing lastpassgroup crd to chart folder for helm deployment
  • Loading branch information
robertoeguia authored Aug 24, 2024
1 parent aa5913b commit d1d09b7
Show file tree
Hide file tree
Showing 60 changed files with 2,608 additions and 1,079 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ bin
*.swp
*.swo
*~

.vscode/
38 changes: 28 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.17 as builder
FROM golang:1.21 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand All @@ -10,24 +10,42 @@ COPY go.sum go.sum
RUN go mod download -x

# Copy the go source
COPY main.go main.go
COPY cmd/main.go cmd/main.go
COPY api/ api/
COPY controllers/ controllers/
COPY internal/controller/ internal/controller/
COPY pkg/ pkg/
COPY version/ version/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager cmd/main.go

# Download lastpass-cli
FROM golang:1.17 as lastpass-cli
FROM ubuntu:22.04 as lastpass-cli

ENV LASTPASS_VERSION=1.3.3-4
ENV LASTPASS_VERSION=1.5.0

# https://github.com/lastpass/lastpass-cli
RUN apt update && apt install -y \
lastpass-cli=${LASTPASS_VERSION} \
&& rm -rf /var/lib/apt/lists/*
# https://github.com/lastpass/lastpass-cli?tab=readme-ov-file#building
RUN apt update && apt --no-install-recommends -yqq install \
bash-completion \
build-essential \
cmake \
libcurl4 \
libcurl4-openssl-dev \
libssl-dev \
libxml2 \
libxml2-dev \
libssl3 \
pkg-config \
ca-certificates \
xclip \
wget

RUN wget -O lastpass-cli.tar.gz https://github.com/lastpass/lastpass-cli/releases/download/v${LASTPASS_VERSION}/lastpass-cli-${LASTPASS_VERSION}.tar.gz; \
tar -xf lastpass-cli.tar.gz

WORKDIR /lastpass-cli-${LASTPASS_VERSION}

RUN make && make install

RUN mkdir -p /usr/lib/lastpass-cli \
&& ldd /usr/bin/lpass | grep '=>' | awk '{ print $3 }' | xargs cp -t /usr/lib/lastpass-cli
Expand Down
Loading

0 comments on commit d1d09b7

Please sign in to comment.