Skip to content

Commit 7520acb

Browse files
committed
Restructuring repository based on feedback from Matt Bishop
1 parent 19ac3f5 commit 7520acb

File tree

78 files changed

+373
-1082
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+373
-1082
lines changed

src/sm-operator/.devcontainer/common/devcontainer.json renamed to .devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "BW k8s Operator",
33
"image": "mcr.microsoft.com/devcontainers/go:1.21",
44
"runArgs": ["--network=host"], // needed for kind
5-
"postCreateCommand": "sudo .devcontainer/common/postCreateCommand.sh",
5+
"postCreateCommand": "sudo .devcontainer/postCreateCommand.sh",
66
"customizations": {
77
"vscode": {
88
"extensions": [

src/sm-operator/.devcontainer/common/postCreateCommand.sh renamed to .devcontainer/postCreateCommand.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
#!/usr/bin/env bash
22
apt-get update
33
apt-get install -y kubernetes-client musl-tools # kubectl
4-
kind delete cluster --name sm-operator && kind create cluster --name sm-operator --config .devcontainer/common/kind-config.yaml
5-
# kind export kubeconfig
4+
kind delete cluster --name sm-operator && kind create cluster --name sm-operator --config .devcontainer/kind-config.yaml
65

76
PATH="$PATH:/usr/local/go/bin" make setup
87
PATH="$PATH:/usr/local/go/bin" make install
98

10-
# shellcheck disable=SC2016
119
echo '
1210
devcontainer setup complete!
1311
File renamed without changes.
File renamed without changes.

.github/workflows/build.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ jobs:
3636
id: test
3737
run: |
3838
sudo apt update && sudo apt install musl-tools -y
39-
cd src/sm-operator
4039
make setup
4140
make test
4241
go tool cover -html=cover.out -o=cover.html
@@ -45,7 +44,7 @@ jobs:
4544
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
4645
with:
4746
name: cover.html
48-
path: src/sm-operator/cover.html
47+
path: cover.html
4948
if-no-files-found: error
5049

5150
- name: Generate Docker image tag
@@ -66,8 +65,7 @@ jobs:
6665
- name: Build Docker image
6766
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
6867
with:
69-
context: src/sm-operator
70-
file: src/sm-operator/Dockerfile
68+
file: Dockerfile
7169
platforms: linux/amd64,linux/arm64
7270
push: true
7371
tags: ${{ steps.image-name.outputs.name }}
@@ -80,7 +78,6 @@ jobs:
8078
env:
8179
IMAGE: ${{ steps.image-name.outputs.name }}
8280
run: |
83-
cd src/sm-operator
8481
make deploy IMG=$IMAGE
8582
8683
#Setup image pull secret (Until repo is made public)
@@ -114,6 +111,5 @@ jobs:
114111
115112
- name: Clean-up
116113
run: |
117-
cd src/sm-operator
118114
make undeploy
119115
kind delete cluster

.github/workflows/build_ghcr.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
id: test
3636
run: |
3737
sudo apt update && sudo apt install musl-tools -y
38-
cd src/sm-operator
3938
make setup
4039
make test
4140
go tool cover -html=cover.out -o=cover.html
@@ -45,7 +44,7 @@ jobs:
4544
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
4645
with:
4746
name: cover.html
48-
path: src/sm-operator/cover.html
47+
path: cover.html
4948
if-no-files-found: error
5049

5150
- name: Generate Docker image tag
@@ -66,8 +65,7 @@ jobs:
6665
- name: Build Docker image
6766
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
6867
with:
69-
context: src/sm-operator
70-
file: src/sm-operator/Dockerfile
68+
file: Dockerfile
7169
platforms: linux/amd64,linux/arm64
7270
push: true
7371
tags: ${{ steps.image-name.outputs.name }}
@@ -80,7 +78,6 @@ jobs:
8078
env:
8179
IMAGE: ${{ steps.image-name.outputs.name }}
8280
run: |
83-
cd src/sm-operator
8481
make deploy IMG=$IMAGE
8582
8683
#Setup image pull secret (Until repo is made public)
@@ -114,6 +111,5 @@ jobs:
114111
115112
- name: Clean-up
116113
run: |
117-
cd src/sm-operator
118114
make undeploy
119115
kind delete cluster

.github/workflows/bump_version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545

4646
- name: Bump Version
4747
run: |
48-
sed -i -E '/^VERSION\s+\?=\s+[^\s]+/!b;cVERSION ?= ${{ github.event.inputs.version_number }}' src/sm-operator/Makefile
48+
sed -i -E '/^VERSION\s+\?=\s+[^\s]+/!b;cVERSION ?= ${{ github.event.inputs.version_number }}' Makefile
4949
5050
- name: Setup git
5151
run: |

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Get Version
3939
id: version
4040
run: |
41-
VERSION=$(sed -nE 's/^VERSION\s+\?=\s+([^\s]+)/\1/p' src/sm-operator/Makefile)
41+
VERSION=$(sed -nE 's/^VERSION\s+\?=\s+([^\s]+)/\1/p' Makefile)
4242
echo "version=$VERSION" >> $GITHUB_OUTPUT
4343
4444
- name: Get branch name

.gitignore

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,33 @@ Thumbs.db
2323
node_modules
2424
npm-debug.log
2525

26-
src/sm-operator/bin/*
27-
src/sm-operator/sm-operator.tar
28-
src/sm-operator/bw-sdk/internal/cinterface/lib/*
29-
src/sm-operator/cmd/__debug_bin*
26+
# Binaries for programs and plugins
27+
*.exe
28+
*.exe~
29+
*.dll
30+
*.so
31+
*.dylib
32+
bin/*
33+
Dockerfile.cross
34+
35+
# Test binary, build with `go test -c`
36+
*.test
37+
38+
# Output of the go coverage tool, specifically when used with LiteIDE
39+
*.out
40+
41+
# Kubernetes Generated files - skip generated files, except for vendored files
42+
43+
!vendor/**/zz_generated.*
44+
45+
# editor and IDE paraphernalia
46+
.idea
47+
*.swp
48+
*.swo
49+
*~
50+
51+
sm-operator.tar
52+
bw-sdk/internal/cinterface/lib/*
53+
**/__debug_bin*
3054
**/temp.zip
3155
**/.env
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

LICENSE.txt

Lines changed: 181 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,182 @@
1-
Source code in this repository is covered by one of two licenses: (i) the
2-
GNU General Public License (GPL) v3.0 (ii) the Bitwarden License v1.0. The
3-
default license throughout the repository is GPL v3.0 unless the header
4-
specifies another license. Bitwarden Licensed code is found only in the
5-
/bitwarden_license directory.
6-
7-
GPL v3.0:
8-
https://github.com/bitwarden/server/blob/main/LICENSE_GPL.txt
9-
10-
Bitwarden License v1.0:
11-
https://github.com/bitwarden/server/blob/main/LICENSE_BITWARDEN.txt
12-
13-
No grant of any rights in the trademarks, service marks, or logos of Bitwarden is
14-
made (except as may be necessary to comply with the notice requirements as
15-
applicable), and use of any Bitwarden trademarks must comply with Bitwarden
16-
Trademark Guidelines
1+
BITWARDEN LICENSE AGREEMENT
2+
Version 1, 4 September 2020
3+
4+
PLEASE CAREFULLY READ THIS BITWARDEN LICENSE AGREEMENT ("AGREEMENT"). THIS
5+
AGREEMENT CONSTITUTES A LEGALLY BINDING AGREEMENT BETWEEN YOU AND BITWARDEN,
6+
INC. ("BITWARDEN") AND GOVERNS YOUR USE OF THE COMMERCIAL MODULES (DEFINED
7+
BELOW). BY COPYING OR USING THE COMMERCIAL MODULES, YOU AGREE TO THIS AGREEMENT.
8+
IF YOU DO NOT AGREE WITH THIS AGREEMENT, YOU MAY NOT COPY OR USE THE COMMERCIAL
9+
MODULES. IF YOU ARE COPYING OR USING THE COMMERCIAL MODULES ON BEHALF OF A LEGAL
10+
ENTITY, YOU REPRESENT AND WARRANT THAT YOU HAVE AUTHORITY TO AGREE TO THIS
11+
AGREEMENT ON BEHALF OF SUCH ENTITY. IF YOU DO NOT HAVE SUCH AUTHORITY, DO NOT
12+
COPY OR USE THE COMMERCIAL MODULES IN ANY MANNER.
13+
14+
This Agreement is entered into by and between Bitwarden and you, or the legal
15+
entity on behalf of whom you are acting (as applicable, "You" or "Your").
16+
17+
1. DEFINITIONS
18+
19+
"Bitwarden Software" means the Bitwarden client software, libraries, and
20+
Commercial Modules.
21+
22+
"Commercial Modules" means the modules designed to work with and enhance the
23+
Bitwarden Software to which this Agreement is linked, referenced, or appended.
24+
25+
2. LICENSES, RESTRICTIONS AND THIRD PARTY CODE
26+
27+
2.1 Commercial Module License. Subject to Your compliance with this Agreement,
28+
Bitwarden hereby grants to You a limited, non-exclusive, non-transferable,
29+
royalty-free license to use the Commercial Modules for the sole purposes of
30+
internal development and internal testing, and only in a non-production
31+
environment.
32+
33+
2.2 Reservation of Rights. As between Bitwarden and You, Bitwarden owns all
34+
right, title and interest in and to the Bitwarden Software, and except as
35+
expressly set forth in Sections 2.1, no other license to the Bitwarden Software
36+
is granted to You under this Agreement, by implication, estoppel, or otherwise.
37+
38+
2.3 Restrictions. You agree not to: (i) except as expressly permitted in
39+
Section 2.1, sell, rent, lease, distribute, sublicense, loan or otherwise
40+
transfer the Commercial Modules to any third party; (ii) alter or remove any
41+
trademarks, service mark, and logo included with the Commercial Modules, or
42+
(iii) use the Commercial Modules to create a competing product or service.
43+
Bitwarden is not obligated to provide maintenance and support services for the
44+
Bitwarden Software licensed under this Agreement.
45+
46+
2.4 Third Party Software. The Commercial Modules may contain or be provided
47+
with third party open source libraries, components, utilities and other open
48+
source software (collectively, "Open Source Software"). Notwithstanding anything
49+
to the contrary herein, use of the Open Source Software will be subject to the
50+
license terms and conditions applicable to such Open Source Software. To the
51+
extent any condition of this Agreement conflicts with any license to the Open
52+
Source Software, the Open Source Software license will govern with respect to
53+
such Open Source Software only.
54+
55+
2.5 This Agreement does not grant any rights in the trademarks, service marks, or
56+
logos of any Contributor (except as may be necessary to comply with the notice
57+
requirements in Section 2.3), and use of any Bitwarden trademarks must comply with
58+
Bitwarden Trademark Guidelines
1759
<https://github.com/bitwarden/server/blob/main/TRADEMARK_GUIDELINES.md>.
60+
61+
3. TERMINATION
62+
63+
3.1 Termination. This Agreement will automatically terminate upon notice from
64+
Bitwarden, which notice may be by email or posting in the location where the
65+
Commercial Modules are made available.
66+
67+
3.2 Effect of Termination. Upon any termination of this Agreement, for any
68+
reason, You will promptly cease use of the Commercial Modules and destroy any
69+
copies thereof. For the avoidance of doubt, termination of this Agreement will
70+
not affect Your right to Bitwarden Software, other than the Commercial Modules,
71+
made available pursuant to an Open Source Software license.
72+
73+
3.3 Survival. Sections 1, 2.2 -2.4, 3.2, 3.3, 4, and 5 will survive any
74+
termination of this Agreement.
75+
76+
4. DISCLAIMER AND LIMITATION OF LIABILITY
77+
78+
4.1 Disclaimer of Warranties. TO THE MAXIMUM EXTENT PERMITTED UNDER APPLICABLE
79+
LAW, THE BITWARDEN SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
80+
EXPRESS OR IMPLIED REGARDING OR RELATING TO THE BITWARDEN SOFTWARE, INCLUDING
81+
ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
82+
TITLE, AND NON-INFRINGEMENT. FURTHER, BITWARDEN DOES NOT WARRANT RESULTS OF USE
83+
OR THAT THE BITWARDEN SOFTWARE WILL BE ERROR FREE OR THAT THE USE OF THE
84+
BITWARDEN SOFTWARE WILL BE UNINTERRUPTED.
85+
86+
4.2 Limitation of Liability. IN NO EVENT WILL BITWARDEN OR ITS LICENSORS BE
87+
LIABLE TO YOU OR ANY THIRD PARTY UNDER THIS AGREEMENT FOR (I) ANY AMOUNTS IN
88+
EXCESS OF US $25 OR (II) FOR ANY SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF
89+
ANY KIND, INCLUDING FOR ANY LOSS OF PROFITS, LOSS OF USE, BUSINESS INTERRUPTION,
90+
LOSS OF DATA, COST OF SUBSTITUTE GOODS OR SERVICES, WHETHER ALLEGED AS A BREACH
91+
OF CONTRACT OR TORTIOUS CONDUCT, INCLUDING NEGLIGENCE, EVEN IF BITWARDEN HAS
92+
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
93+
94+
5. MISCELLANEOUS
95+
96+
5.1 Assignment. You may not assign or otherwise transfer this Agreement or any
97+
rights or obligations hereunder, in whole or in part, whether by operation of
98+
law or otherwise, to any third party without Bitwarden's prior written consent.
99+
Any purported transfer, assignment or delegation without such prior written
100+
consent will be null and void and of no force or effect. Bitwarden may assign
101+
this Agreement to any successor to its business or assets to which this
102+
Agreement relates, whether by merger, sale of assets, sale of stock,
103+
reorganization or otherwise. Subject to this Section 5.1, this Agreement will be
104+
binding upon and inure to the benefit of the parties hereto, and their
105+
respective successors and permitted assigns.
106+
107+
5.2 Entire Agreement; Modification; Waiver. This Agreement represents the
108+
entire agreement between the parties, and supersedes all prior agreements and
109+
understandings, written or oral, with respect to the matters covered by this
110+
Agreement, and is not intended to confer upon any third party any rights or
111+
remedies hereunder. You acknowledge that You have not entered in this Agreement
112+
based on any representations other than those contained herein. No modification
113+
of or amendment to this Agreement, nor any waiver of any rights under this
114+
Agreement, will be effective unless in writing and signed by both parties. The
115+
waiver of one breach or default or any delay in exercising any rights will not
116+
constitute a waiver of any subsequent breach or default.
117+
118+
5.3 Governing Law. This Agreement will in all respects be governed by the laws
119+
of the State of California without reference to its principles of conflicts of
120+
laws. The parties hereby agree that all disputes arising out of this Agreement
121+
will be subject to the exclusive jurisdiction of and venue in the federal and
122+
state courts within Los Angeles County, California. You hereby consent to the
123+
personal and exclusive jurisdiction and venue of these courts. The parties
124+
hereby disclaim and exclude the application hereto of the United Nations
125+
Convention on Contracts for the International Sale of Goods.
126+
127+
5.4 Severability. If any provision of this Agreement is held invalid or
128+
unenforceable under applicable law by a court of competent jurisdiction, it will
129+
be replaced with the valid provision that most closely reflects the intent of
130+
the parties and the remaining provisions of the Agreement will remain in full
131+
force and effect.
132+
133+
5.5 Relationship of the Parties. Nothing in this Agreement is to be construed
134+
as creating an agency, partnership, or joint venture relationship between the
135+
parties hereto. Neither party will have any right or authority to assume or
136+
create any obligations or to make any representations or warranties on behalf of
137+
any other party, whether express or implied, or to bind the other party in any
138+
respect whatsoever.
139+
140+
5.6 Notices. All notices permitted or required under this Agreement will be in
141+
writing and will be deemed to have been given when delivered in person
142+
(including by overnight courier), or three (3) business days after being mailed
143+
by first class, registered or certified mail, postage prepaid, to the address of
144+
the party specified in this Agreement or such other address as either party may
145+
specify in writing.
146+
147+
5.7 U.S. Government Restricted Rights. If Commercial Modules is being licensed
148+
by the U.S. Government, the Commercial Modules is deemed to be "commercial
149+
computer software" and "commercial computer documentation" developed exclusively
150+
at private expense, and (a) if acquired by or on behalf of a civilian agency,
151+
will be subject solely to the terms of this computer software license as
152+
specified in 48 C.F.R. 12.212 of the Federal Acquisition Regulations and its
153+
successors; and (b) if acquired by or on behalf of units of the Department of
154+
Defense ("DOD") will be subject to the terms of this commercial computer
155+
software license as specified in 48 C.F.R. 227.7202-2, DOD FAR Supplement and
156+
its successors.
157+
158+
5.8 Injunctive Relief. A breach or threatened breach by You of Section 2 may
159+
cause irreparable harm for which damages at law may not provide adequate relief,
160+
and therefore Bitwarden will be entitled to seek injunctive relief in any
161+
applicable jurisdiction without being required to post a bond.
162+
163+
5.9 Export Law Assurances. You understand that the Commercial Modules is
164+
subject to export control laws and regulations. You may not download or
165+
otherwise export or re-export the Commercial Modules or any underlying
166+
information or technology except in full compliance with all applicable laws and
167+
regulations, in particular, but without limitation, United States export control
168+
laws. None of the Commercial Modules or any underlying information or technology
169+
may be downloaded or otherwise exported or re- exported: (a) into (or to a
170+
national or resident of) any country to which the United States has embargoed
171+
goods; or (b) to anyone on the U.S. Treasury Department's list of specially
172+
designated nationals or the U.S. Commerce Department's list of prohibited
173+
countries or debarred or denied persons or entities. You hereby agree to the
174+
foregoing and represents and warrants that You are not located in, under control
175+
of, or a national or resident of any such country or on any such list.
176+
177+
5.10 Construction. The titles and section headings used in this Agreement are
178+
for ease of reference only and will not be used in the interpretation or
179+
construction of this Agreement. No rule of construction resolving any ambiguity
180+
in favor of the non-drafting party will be applied hereto. The word "including",
181+
when used herein, is illustrative rather than exclusive and means "including,
182+
without limitation."

0 commit comments

Comments
 (0)