Compare commits
11 Commits
6a8945af21
...
1d147aad9a
Author | SHA1 | Date | |
---|---|---|---|
1d147aad9a | |||
|
e31899b7f2 | ||
|
116c1d9c4e | ||
|
0e08d3cc5e | ||
|
a58f4762d9 | ||
|
f287bd80a1 | ||
|
17fdd4a977 | ||
|
2fde884ad5 | ||
|
cf186e84fb | ||
|
bf5a0b2484 | ||
|
3ba8f49b39 |
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@ -36,7 +36,7 @@ jobs:
|
|||||||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
|
||||||
- name: Get app version from chart
|
- name: Get app version from chart
|
||||||
uses: mikefarah/yq@v4.40.2
|
uses: mikefarah/yq@v4.40.5
|
||||||
id: app_version
|
id: app_version
|
||||||
with:
|
with:
|
||||||
cmd: yq '.appVersion' charts/bitwarden-crd-operator/Chart.yaml
|
cmd: yq '.appVersion' charts/bitwarden-crd-operator/Chart.yaml
|
||||||
@ -77,7 +77,7 @@ jobs:
|
|||||||
uses: WyriHaximus/github-action-get-previous-tag@v1
|
uses: WyriHaximus/github-action-get-previous-tag@v1
|
||||||
|
|
||||||
- name: Download SBOM from github action
|
- name: Download SBOM from github action
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.ANCHORE_SBOM_ACTION_PRIOR_ARTIFACT }}
|
name: ${{ env.ANCHORE_SBOM_ACTION_PRIOR_ARTIFACT }}
|
||||||
|
|
||||||
|
2
.github/workflows/test-and-lint.yml
vendored
2
.github/workflows/test-and-lint.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: v3.11.2
|
version: v3.11.2
|
||||||
|
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.9'
|
python-version: '3.9'
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM alpine:3.18.3
|
FROM alpine:3.18.4
|
||||||
|
|
||||||
LABEL org.opencontainers.image.source=https://github.com/Lerentis/bitwarden-crd-operator
|
LABEL org.opencontainers.image.source=https://github.com/Lerentis/bitwarden-crd-operator
|
||||||
LABEL org.opencontainers.image.description="Kubernetes Operator to create k8s secrets from bitwarden"
|
LABEL org.opencontainers.image.description="Kubernetes Operator to create k8s secrets from bitwarden"
|
||||||
@ -7,7 +7,7 @@ LABEL org.opencontainers.image.licenses=MIT
|
|||||||
ARG PYTHON_VERSION=3.11.6-r0
|
ARG PYTHON_VERSION=3.11.6-r0
|
||||||
ARG PIP_VERSION=23.1.2-r0
|
ARG PIP_VERSION=23.1.2-r0
|
||||||
ARG GCOMPAT_VERSION=1.1.0-r1
|
ARG GCOMPAT_VERSION=1.1.0-r1
|
||||||
ARG LIBCRYPTO_VERSION=3.1.2-r0
|
ARG LIBCRYPTO_VERSION=3.1.3-r0
|
||||||
ARG BW_VERSION=2023.1.0
|
ARG BW_VERSION=2023.1.0
|
||||||
|
|
||||||
COPY requirements.txt /requirements.txt
|
COPY requirements.txt /requirements.txt
|
||||||
|
@ -14,7 +14,7 @@ spec:
|
|||||||
- bws
|
- bws
|
||||||
versions:
|
versions:
|
||||||
- name: v1beta4
|
- name: v1beta4
|
||||||
served: true
|
served: false
|
||||||
storage: true
|
storage: true
|
||||||
schema:
|
schema:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
@ -49,3 +49,55 @@ spec:
|
|||||||
- id
|
- id
|
||||||
- namespace
|
- namespace
|
||||||
- name
|
- name
|
||||||
|
- name: v1beta5
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
schema:
|
||||||
|
openAPIV3Schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
spec:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
content:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
element:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
secretName:
|
||||||
|
type: string
|
||||||
|
secretRef:
|
||||||
|
type: string
|
||||||
|
secretScope:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- secretName
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
labels:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
json:
|
||||||
|
x-kubernetes-preserve-unknown-fields: true
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
spec:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
foo:
|
||||||
|
type: string
|
||||||
|
bar:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- id
|
||||||
|
- namespace
|
||||||
|
- name
|
||||||
|
@ -14,7 +14,7 @@ spec:
|
|||||||
- bwt
|
- bwt
|
||||||
versions:
|
versions:
|
||||||
- name: v1beta4
|
- name: v1beta4
|
||||||
served: true
|
served: false
|
||||||
storage: true
|
storage: true
|
||||||
schema:
|
schema:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
@ -36,3 +36,42 @@ spec:
|
|||||||
- template
|
- template
|
||||||
- namespace
|
- namespace
|
||||||
- name
|
- name
|
||||||
|
- name: v1beta5
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
schema:
|
||||||
|
openAPIV3Schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
spec:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
filename:
|
||||||
|
type: string
|
||||||
|
template:
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
labels:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
json:
|
||||||
|
x-kubernetes-preserve-unknown-fields: true
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
spec:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
foo:
|
||||||
|
type: string
|
||||||
|
bar:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- filename
|
||||||
|
- template
|
||||||
|
- namespace
|
||||||
|
- name
|
||||||
|
@ -14,7 +14,7 @@ spec:
|
|||||||
- rgc
|
- rgc
|
||||||
versions:
|
versions:
|
||||||
- name: v1beta4
|
- name: v1beta4
|
||||||
served: true
|
served: false
|
||||||
storage: true
|
storage: true
|
||||||
schema:
|
schema:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
@ -42,3 +42,48 @@ spec:
|
|||||||
- usernameRef
|
- usernameRef
|
||||||
- passwordRef
|
- passwordRef
|
||||||
- registry
|
- registry
|
||||||
|
- name: v1beta5
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
schema:
|
||||||
|
openAPIV3Schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
spec:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
usernameRef:
|
||||||
|
type: string
|
||||||
|
passwordRef:
|
||||||
|
type: string
|
||||||
|
registry:
|
||||||
|
type: string
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
labels:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
json:
|
||||||
|
x-kubernetes-preserve-unknown-fields: true
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
spec:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
foo:
|
||||||
|
type: string
|
||||||
|
bar:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- id
|
||||||
|
- namespace
|
||||||
|
- name
|
||||||
|
- usernameRef
|
||||||
|
- passwordRef
|
||||||
|
- registry
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
apiVersion: "lerentis.uploadfilter24.eu/v1beta4"
|
apiVersion: "lerentis.uploadfilter24.eu/v1beta5"
|
||||||
kind: BitwardenSecret
|
kind: BitwardenSecret
|
||||||
metadata:
|
metadata:
|
||||||
name: test
|
name: test
|
||||||
@ -16,8 +16,10 @@ spec:
|
|||||||
id: "88781348-c81c-4367-9801-550360c21295"
|
id: "88781348-c81c-4367-9801-550360c21295"
|
||||||
name: "test-secret"
|
name: "test-secret"
|
||||||
namespace: "default"
|
namespace: "default"
|
||||||
|
labels:
|
||||||
|
- key: value
|
||||||
---
|
---
|
||||||
apiVersion: "lerentis.uploadfilter24.eu/v1beta4"
|
apiVersion: "lerentis.uploadfilter24.eu/v1beta5"
|
||||||
kind: BitwardenSecret
|
kind: BitwardenSecret
|
||||||
metadata:
|
metadata:
|
||||||
name: test-scope
|
name: test-scope
|
||||||
@ -30,3 +32,5 @@ spec:
|
|||||||
id: "466fc4b0-ffca-4444-8d88-b59d4de3d928"
|
id: "466fc4b0-ffca-4444-8d88-b59d4de3d928"
|
||||||
name: "test-scope"
|
name: "test-scope"
|
||||||
namespace: "default"
|
namespace: "default"
|
||||||
|
labels:
|
||||||
|
- key: value
|
@ -44,6 +44,7 @@ def create_managed_registry_secret(spec, name, namespace, logger, **kwargs):
|
|||||||
id = spec.get('id')
|
id = spec.get('id')
|
||||||
secret_name = spec.get('name')
|
secret_name = spec.get('name')
|
||||||
secret_namespace = spec.get('namespace')
|
secret_namespace = spec.get('namespace')
|
||||||
|
labels = spec.get('labels')
|
||||||
|
|
||||||
unlock_bw(logger)
|
unlock_bw(logger)
|
||||||
logger.info(f"Locking up secret with ID: {id}")
|
logger.info(f"Locking up secret with ID: {id}")
|
||||||
@ -55,9 +56,13 @@ def create_managed_registry_secret(spec, name, namespace, logger, **kwargs):
|
|||||||
"managed": "registry-credential.lerentis.uploadfilter24.eu",
|
"managed": "registry-credential.lerentis.uploadfilter24.eu",
|
||||||
"managedObject": f"{namespace}/{name}"
|
"managedObject": f"{namespace}/{name}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if not labels:
|
||||||
|
labels = {}
|
||||||
|
|
||||||
secret = kubernetes.client.V1Secret()
|
secret = kubernetes.client.V1Secret()
|
||||||
secret.metadata = kubernetes.client.V1ObjectMeta(
|
secret.metadata = kubernetes.client.V1ObjectMeta(
|
||||||
name=secret_name, annotations=annotations)
|
name=secret_name, annotations=annotations, labels=labels)
|
||||||
secret = create_dockerlogin(
|
secret = create_dockerlogin(
|
||||||
logger,
|
logger,
|
||||||
secret,
|
secret,
|
||||||
@ -66,7 +71,7 @@ def create_managed_registry_secret(spec, name, namespace, logger, **kwargs):
|
|||||||
password_ref,
|
password_ref,
|
||||||
registry)
|
registry)
|
||||||
|
|
||||||
obj = api.create_namespaced_secret(
|
api.create_namespaced_secret(
|
||||||
secret_namespace, secret
|
secret_namespace, secret
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ def create_managed_secret(spec, name, namespace, logger, body, **kwargs):
|
|||||||
id = spec.get('id')
|
id = spec.get('id')
|
||||||
secret_name = spec.get('name')
|
secret_name = spec.get('name')
|
||||||
secret_namespace = spec.get('namespace')
|
secret_namespace = spec.get('namespace')
|
||||||
|
labels = spec.get('labels')
|
||||||
|
|
||||||
unlock_bw(logger)
|
unlock_bw(logger)
|
||||||
logger.info(f"Locking up secret with ID: {id}")
|
logger.info(f"Locking up secret with ID: {id}")
|
||||||
@ -52,12 +53,16 @@ def create_managed_secret(spec, name, namespace, logger, body, **kwargs):
|
|||||||
"managed": "bitwarden-secret.lerentis.uploadfilter24.eu",
|
"managed": "bitwarden-secret.lerentis.uploadfilter24.eu",
|
||||||
"managedObject": f"{namespace}/{name}"
|
"managedObject": f"{namespace}/{name}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if not labels:
|
||||||
|
labels = {}
|
||||||
|
|
||||||
secret = kubernetes.client.V1Secret()
|
secret = kubernetes.client.V1Secret()
|
||||||
secret.metadata = kubernetes.client.V1ObjectMeta(
|
secret.metadata = kubernetes.client.V1ObjectMeta(
|
||||||
name=secret_name, annotations=annotations)
|
name=secret_name, annotations=annotations, labels=labels)
|
||||||
secret = create_kv(secret, secret_json_object, content_def)
|
secret = create_kv(secret, secret_json_object, content_def)
|
||||||
|
|
||||||
obj = api.create_namespaced_secret(
|
api.create_namespaced_secret(
|
||||||
namespace="{}".format(secret_namespace),
|
namespace="{}".format(secret_namespace),
|
||||||
body=secret
|
body=secret
|
||||||
)
|
)
|
||||||
|
@ -33,6 +33,7 @@ def create_managed_secret(spec, name, namespace, logger, body, **kwargs):
|
|||||||
filename = spec.get('filename')
|
filename = spec.get('filename')
|
||||||
secret_name = spec.get('name')
|
secret_name = spec.get('name')
|
||||||
secret_namespace = spec.get('namespace')
|
secret_namespace = spec.get('namespace')
|
||||||
|
labels = spec.get('labels')
|
||||||
|
|
||||||
unlock_bw(logger)
|
unlock_bw(logger)
|
||||||
|
|
||||||
@ -42,9 +43,13 @@ def create_managed_secret(spec, name, namespace, logger, body, **kwargs):
|
|||||||
"managed": "bitwarden-template.lerentis.uploadfilter24.eu",
|
"managed": "bitwarden-template.lerentis.uploadfilter24.eu",
|
||||||
"managedObject": f"{namespace}/{name}"
|
"managedObject": f"{namespace}/{name}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if not labels:
|
||||||
|
labels = {}
|
||||||
|
|
||||||
secret = kubernetes.client.V1Secret()
|
secret = kubernetes.client.V1Secret()
|
||||||
secret.metadata = kubernetes.client.V1ObjectMeta(
|
secret.metadata = kubernetes.client.V1ObjectMeta(
|
||||||
name=secret_name, annotations=annotations)
|
name=secret_name, annotations=annotations, labels=labels)
|
||||||
secret = create_template_secret(logger, secret, filename, template)
|
secret = create_template_secret(logger, secret, filename, template)
|
||||||
|
|
||||||
obj = api.create_namespaced_secret(
|
obj = api.create_namespaced_secret(
|
||||||
|
Loading…
Reference in New Issue
Block a user