Skip to content

Commit ff6c07f

Browse files
authored
Cherry pick commits for v0.1.1 release (#695)
* pkg/scaffold: remove TODO for metrics port (#679) * pkg/scaffold: fix hardcoded crd version (#690) Have CRD and CR examples match, so examples work for new users. Fixes #689 * Release versioning (#684) * release.sh: fix TOML_TMPL_FILE path * doc/release-versioning.md: update release versioning doc * pkg/scaffold/gopkgtoml,version: update branch to v0.1.x
1 parent ec5387c commit ff6c07f

File tree

8 files changed

+65
-16
lines changed

8 files changed

+65
-16
lines changed

doc/release-versioning.md

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ Minor version changes will not break compatibility between the previous minor ve
2424
We expect to release patches for minor releases, so we create a patch trunk to branch from. The naming convention follows "v2.1.x", where the major version is 2, minor is 1, and "x" is a patch version placeholder.
2525

2626
```bash
27-
$ MAV_MIN_VER="v${MAJOR_VERSION}.${NEW_MINOR_VERSION}"
28-
$ git checkout -b "${MAJ_MIN_VER}.x" tags/"v${MAJ_MIN_VER}.0"
27+
$ export MAJ_MIN_VER="${MAJOR_VERSION}.${NEW_MINOR_VERSION}"
28+
$ git checkout -b "v${MAJ_MIN_VER}.x" tags/"v${MAJ_MIN_VER}.0"
2929
$ git push [email protected]:operator-framework/operator-sdk.git "v${MAJ_MIN_VER}.x"
3030
```
3131

@@ -116,9 +116,64 @@ Patch releases should have the following format:
116116
...
117117
```
118118

119+
# Release Signing
120+
121+
When a new release is created, the tag for the commit it signed with a maintainer's gpg key and
122+
the binaries for the release are also signed by the same key. All keys used by maintainers will
123+
be available via public gpg keyservers such as [pgp.mit.edu][mit-keyserver]. To verify a git
124+
tag signature, use this command:
125+
126+
```sh
127+
$ git verify-tag --verbose ${TAG_NAME}
128+
```
129+
130+
To verify a release binary using the provided asc files, place the binary and corresponding asc
131+
file into the same directory and use the corresponding command:
132+
133+
```sh
134+
# macOS
135+
$ gpg --verify operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin.asc
136+
# GNU/Linux
137+
$ gpg --verify operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu.asc
138+
```
139+
140+
If you do not have the maintainers public key on your machine, you will get an error message similar
141+
to this:
142+
143+
```sh
144+
$ git verify-tag ${TAG_NAME}
145+
gpg: Signature made Wed 31 Oct 2018 02:57:31 PM PDT
146+
gpg: using RSA key 4AEE18F83AFDEB23
147+
gpg: Can't check signature: public key not found
148+
```
149+
150+
To download the key, use this command, replacing `${KEY_ID}` with the RSA key string provided in the output
151+
of the previous command:
152+
153+
```sh
154+
$ gpg --recv-key ${KEY_ID}
155+
```
156+
157+
Now you should be able to verify the tags and/or binaries
158+
159+
## For maintainers
160+
For new maintainers who have not done a release and do not have their gpg key on a public
161+
keyserver, you must add your public key to a keyserver. To do this, output your armored
162+
public key using this command:
163+
164+
```sh
165+
$ gpg --armor --export ${GPG_EMAIL} > mykey.asc
166+
```
167+
168+
Then, copy and paste the content of the outputted file into the `Submit a key` section on
169+
the [MIT PGP Public Key Server][mit-keyserver] or any other public keyserver that forwards
170+
the key to other public keyservers. Once that is done, other people can download your public
171+
key and you are ready to sign releases.
172+
119173
[link-semver]:https://semver.org/
120174
[link-github-milestones]: https://help.github.com/articles/about-milestones/
121175
[doc-maintainers]:../MAINTAINERS
122176
[link-github-gpg-key-upload]:https://github.com/settings/keys
123177
[link-git-config-gpg-key]:https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work
124-
[doc-kube-version]:https://github.com/operator-framework/operator-sdk#prerequisites
178+
[doc-kube-version]:https://github.com/operator-framework/operator-sdk#prerequisites
179+
[mit-keyserver]:https://pgp.mit.edu

pkg/scaffold/cmd.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ func main() {
6767
log.Fatalf("failed to get watch namespace: %v", err)
6868
}
6969
70-
// TODO: Expose metrics port after SDK uses controller-runtime's dynamic client
71-
// sdk.ExposeMetricsPort()
72-
7370
// Get a config to talk to the apiserver
7471
cfg, err := config.GetConfig()
7572
if err != nil {

pkg/scaffold/cmd_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ func main() {
6363
log.Fatalf("failed to get watch namespace: %v", err)
6464
}
6565
66-
// TODO: Expose metrics port after SDK uses controller-runtime's dynamic client
67-
// sdk.ExposeMetricsPort()
68-
6966
// Get a config to talk to the apiserver
7067
cfg, err := config.GetConfig()
7168
if err != nil {

pkg/scaffold/crd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ spec:
5555
plural: {{ .Resource.Resource }}
5656
singular: {{ .Resource.LowerKind }}
5757
scope: Namespaced
58-
version: v1alpha1
58+
version: {{ .Resource.Version }}
5959
`

pkg/scaffold/gopkgtoml.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ required = [
7676
[[constraint]]
7777
name = "github.com/operator-framework/operator-sdk"
7878
# The version rule is used for a specific release and the master branch for in between releases.
79-
# branch = "master" #osdk_branch_annotation
80-
version = "=v0.1.0" #osdk_version_annotation
79+
branch = "v0.1.x" #osdk_branch_annotation
80+
# version = "=v0.1.0" #osdk_version_annotation
8181
8282
[prune]
8383
go-tests = true

pkg/scaffold/gopkgtoml_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ required = [
7575
[[constraint]]
7676
name = "github.com/operator-framework/operator-sdk"
7777
# The version rule is used for a specific release and the master branch for in between releases.
78-
# branch = "master" #osdk_branch_annotation
79-
version = "=v0.1.0" #osdk_version_annotation
78+
branch = "v0.1.x" #osdk_branch_annotation
79+
# version = "=v0.1.0" #osdk_version_annotation
8080
8181
[prune]
8282
go-tests = true

release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fi
2626
# Detect whether versions in code were updated.
2727
CURR_VER="$(git describe --dirty --tags)"
2828
VER_FILE="version/version.go"
29-
TOML_TMPL_FILE="pkg/generator/templates.go"
29+
TOML_TMPL_FILE="pkg/scaffold/gopkgtoml.go"
3030
CURR_VER_VER_FILE="$(sed -nr 's/Version = "(.+)"/\1/p' "$VER_FILE" | tr -d '\s\t\n')"
3131
CURR_VER_TMPL_FILE="$(sed -nr 's/.*".*v(.+)".*#osdk_version_annotation/v\1/p' "$TOML_TMPL_FILE" | tr -d '\s\t\n')"
3232
if [ "$VER" != "$CURR_VER_VER_FILE" ] \

version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
package version
1616

1717
var (
18-
Version = "v0.1.0"
18+
Version = "v0.1.0+git"
1919
)

0 commit comments

Comments
 (0)