-
Notifications
You must be signed in to change notification settings - Fork 9
operator: create basic bundle #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9d4687c
operator: create basic bundle
mangelajo 34a8df2
operator: add missing schema to use the route api
mangelajo 4bc5ebc
operator: increase operator memory to avoid crash loop with OOM
mangelajo 006e645
operator: update rbac around route/custom-host
mangelajo 53ec401
operator: fix linter
mangelajo f34355e
operator: handle missing descriptions
mangelajo e4c4bd4
operator: add ci for build and check-bundle
mangelajo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,95 @@ | ||
| name: Check Bundle | ||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - 'release-*' | ||
|
|
||
| jobs: | ||
| check-bundle: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: 1.24 | ||
|
|
||
| - name: Cache bin directory (deploy/operator) | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: deploy/operator/bin/ | ||
| key: ${{ runner.os }}-operator-bin-${{ hashFiles('deploy/operator/go.mod') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-operator-bin- | ||
|
|
||
| - name: Get version | ||
| run: | | ||
| if [ "${{ github.event_name }}" == "pull_request" ]; then | ||
| BASE_BRANCH="${{ github.base_ref }}" | ||
| if [ "$BASE_BRANCH" == "main" ]; then | ||
| TAG="latest" | ||
| elif [[ "$BASE_BRANCH" =~ ^release- ]]; then | ||
| TAG="$BASE_BRANCH" | ||
| else | ||
| echo "::error::Unknown base branch: $BASE_BRANCH" | ||
| exit 1 | ||
| fi | ||
| else | ||
| echo "::error::Unsupported event: ${{ github.event_name }}" | ||
| exit 1 | ||
| fi | ||
| echo "TAG=${TAG}" >> $GITHUB_ENV | ||
| echo "TAG=${TAG}" | ||
|
|
||
| - name: Run make bundle | ||
| working-directory: deploy/operator | ||
| run: | | ||
| make bundle IMG="quay.io/jumpstarter-dev/jumpstarter-operator:${TAG}" | ||
|
|
||
| - name: Check for uncommitted changes | ||
| run: | | ||
| DIFF=$(git diff) | ||
| if [ -n "$DIFF" ]; then | ||
| # Filter out createdAt timestamp lines and context lines, check if any actual changes remain | ||
| FILTERED_DIFF=$(echo "$DIFF" | grep -vE '^(---|\+\+\+|@@|index|diff)' | grep -vE '^[+-].*createdAt:.*[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z' || true) | ||
| # Check if there are any non-timestamp, non-context changes | ||
| if [ -n "$FILTERED_DIFF" ] && [ -n "$(echo "$FILTERED_DIFF" | grep -E '^[+-]' || true)" ]; then | ||
| echo "::error::Uncommitted changes detected after running 'make bundle'. Please commit all bundle changes before pushing." | ||
| echo "::error::This can be done by running 'make bundle IMG=\"quay.io/jumpstarter-dev/jumpstarter-operator:${TAG}\"" | ||
| git diff | ||
| exit 1 | ||
| else | ||
| echo "Only timestamp changes detected (ignored). Bundle files are up to date." | ||
| # Reset the timestamp changes to keep the repo clean | ||
| git checkout -- . | ||
| fi | ||
| else | ||
| echo "No uncommitted changes detected. Bundle files are up to date." | ||
| fi | ||
|
|
||
| - name: Ensure clean state before build-installer | ||
| run: | | ||
| # Reset any remaining changes from root | ||
| git checkout -- . || true | ||
|
|
||
| - name: Run make build-installer | ||
| working-directory: deploy/operator | ||
| run: | | ||
| make build-installer | ||
|
|
||
| - name: Check for uncommitted changes after build-installer | ||
| run: | | ||
| if [ -n "$(git diff)" ]; then | ||
| echo "::error::Uncommitted changes detected after running 'make build-installer'. Please commit all installer changes before pushing." | ||
| echo "::error::This can be done by running 'make build-installer'" | ||
| git diff | ||
| exit 1 | ||
| else | ||
| echo "No uncommitted changes detected. Installer files are up to date." | ||
| fi | ||
|
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,20 @@ | ||
| FROM scratch | ||
|
|
||
| # Core bundle labels. | ||
| LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 | ||
| LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ | ||
| LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ | ||
| LABEL operators.operatorframework.io.bundle.package.v1=jumpstarter-operator | ||
| LABEL operators.operatorframework.io.bundle.channels.v1=alpha | ||
| LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.41.1 | ||
| LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 | ||
| LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v4 | ||
|
|
||
| # Labels for testing. | ||
| LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1 | ||
| LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/ | ||
|
|
||
| # Copy files to locations specified by labels. | ||
| COPY bundle/manifests /manifests/ | ||
| COPY bundle/metadata /metadata/ | ||
| COPY bundle/tests/scorecard /tests/scorecard/ |
20 changes: 20 additions & 0 deletions
20
.../bundle/manifests/jumpstarter-operator-controller-manager-metrics-service_v1_service.yaml
This file contains hidden or 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,20 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| creationTimestamp: null | ||
| labels: | ||
| app.kubernetes.io/managed-by: kustomize | ||
| app.kubernetes.io/name: jumpstarter-operator | ||
| control-plane: controller-manager | ||
| name: jumpstarter-operator-controller-manager-metrics-service | ||
| spec: | ||
| ports: | ||
| - name: https | ||
| port: 8443 | ||
| protocol: TCP | ||
| targetPort: 8443 | ||
| selector: | ||
| app.kubernetes.io/name: jumpstarter-operator | ||
| control-plane: controller-manager | ||
| status: | ||
| loadBalancer: {} |
21 changes: 21 additions & 0 deletions
21
...jumpstarter-operator-jumpstarter-admin-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
This file contains hidden or 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,21 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| creationTimestamp: null | ||
| labels: | ||
| app.kubernetes.io/managed-by: kustomize | ||
| app.kubernetes.io/name: jumpstarter-operator | ||
| name: jumpstarter-operator-jumpstarter-admin-role | ||
| rules: | ||
| - apiGroups: | ||
| - operator.jumpstarter.dev | ||
| resources: | ||
| - jumpstarters | ||
| verbs: | ||
| - '*' | ||
| - apiGroups: | ||
| - operator.jumpstarter.dev | ||
| resources: | ||
| - jumpstarters/status | ||
| verbs: | ||
| - get |
27 changes: 27 additions & 0 deletions
27
...umpstarter-operator-jumpstarter-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
This file contains hidden or 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,27 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| creationTimestamp: null | ||
| labels: | ||
| app.kubernetes.io/managed-by: kustomize | ||
| app.kubernetes.io/name: jumpstarter-operator | ||
| name: jumpstarter-operator-jumpstarter-editor-role | ||
| rules: | ||
| - apiGroups: | ||
| - operator.jumpstarter.dev | ||
| resources: | ||
| - jumpstarters | ||
| verbs: | ||
| - create | ||
| - delete | ||
| - get | ||
| - list | ||
| - patch | ||
| - update | ||
| - watch | ||
| - apiGroups: | ||
| - operator.jumpstarter.dev | ||
| resources: | ||
| - jumpstarters/status | ||
| verbs: | ||
| - get |
23 changes: 23 additions & 0 deletions
23
...umpstarter-operator-jumpstarter-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
This file contains hidden or 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,23 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| creationTimestamp: null | ||
| labels: | ||
| app.kubernetes.io/managed-by: kustomize | ||
| app.kubernetes.io/name: jumpstarter-operator | ||
| name: jumpstarter-operator-jumpstarter-viewer-role | ||
| rules: | ||
| - apiGroups: | ||
| - operator.jumpstarter.dev | ||
| resources: | ||
| - jumpstarters | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| - apiGroups: | ||
| - operator.jumpstarter.dev | ||
| resources: | ||
| - jumpstarters/status | ||
| verbs: | ||
| - get |
13 changes: 13 additions & 0 deletions
13
...nifests/jumpstarter-operator-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml
This file contains hidden or 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,13 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| creationTimestamp: null | ||
| labels: | ||
| app.kubernetes.io/managed-by: kustomize | ||
| app.kubernetes.io/name: jumpstarter-operator | ||
| name: jumpstarter-operator-metrics-reader | ||
| rules: | ||
| - nonResourceURLs: | ||
| - /metrics | ||
| verbs: | ||
| - get | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing labels, I think it will be better to include them for easier cleanup/consistency with other roles.