Skip to content

Commit

Permalink
Merge pull request #11 from stakater/ansible-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
rasheedamir authored Oct 27, 2023
2 parents bacbc56 + 8848eaf commit 932cba2
Show file tree
Hide file tree
Showing 52 changed files with 757 additions and 723 deletions.
10 changes: 10 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# exclude_paths included in this file are parsed relative to this file's location
# and not relative to the CWD of execution. CLI arguments passed to the --exclude
# option are parsed relative to the CWD of execution.
exclude_paths:
- .github/
- bundle
- charts
skip_list:
- skip_ansible_lint
3 changes: 3 additions & 0 deletions .github/md_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"aliveStatusCodes": [429, 200, 520]
}
9 changes: 9 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
- main

jobs:
qa:
uses: stakater/.github/.github/workflows/[email protected]
with:
MD_CONFIG: .github/md_config.json
DOC_SRC: README.md
MD_LINT_CONFIG: .markdownlint.yaml
operator-pull-request:
name: Operator Pull Request
runs-on: ubuntu-latest
Expand All @@ -22,6 +28,9 @@ jobs:
# SKIP_INTEGRATION_TEST: "true"
# run: make test

- name: Run ansible-lint
uses: ansible/[email protected]

- name: Generate Tag
id: generate_tag
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "vocabulary"]
path = vocabulary
url = [email protected]:stakater/vocabulary.git
8 changes: 8 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"MD007": { "indent": 4 },
"MD013": false,
"MD024": false,
"MD029": { "style": one },
"MD033": false,
"MD046": false,
}
9 changes: 9 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
StylesPath = "vocabulary/styles"
MinAlertLevel = warning

Vocab = "Stakater"

# Only check MarkDown files
[*.md]

BasedOnStyles = Vale
445 changes: 220 additions & 225 deletions README.md

Large diffs are not rendered by default.

164 changes: 83 additions & 81 deletions config/crd/bases/grafanacloud.stakater.com_grafanacloudoperators.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,86 +13,88 @@ spec:
- gco
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: GrafanaCloudOperator is the Schema for the grafanacloudoperators API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: Spec defines the desired state of GrafanaCloudOperator
type: object
properties:
enabled:
description: Flag to enable or disable grafana integration creation
type: boolean
provisionMode:
description: Determines the provision type of the cluster on which the operator is running
type: string
enum:
- hubAndSpoke
- standalone
clusterDeploymentLabelSelector:
description: Optional label selector to select specific ClusterDeployments for Grafana On Call integration.
type: object
properties:
matchLabels:
type: object
additionalProperties:
type: string
matchExpressions:
type: array
items:
- name: v1alpha1
schema:
openAPIV3Schema:
description: GrafanaCloudOperator is the Schema for the grafanacloudoperators API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: Spec defines the desired state of GrafanaCloudOperator
type: object
properties:
enabled:
description: Flag to enable or disable grafana integration creation
type: boolean
provisionMode:
description: Determines the provision type of the cluster on which the operator is running
type: string
enum:
- hubAndSpoke
- standalone
clusterDeploymentLabelSelector:
description: Optional label selector to select specific ClusterDeployments for Grafana On Call integration.
type: object
properties:
matchLabels:
type: object
properties:
key:
type: string
operator:
type: string
values:
type: array
items:
additionalProperties:
type: string
matchExpressions:
type: array
items:
type: object
properties:
key:
type: string
operator:
type: string
grafanaAPIToken:
description: Secret reference to the Grafana API token. Avoid putting the token directly.
type: object
properties:
secretName:
type: string
key:
type: string
x-kubernetes-preserve-unknown-fields: true
status:
description: Status defines the observed state of GrafanaCloudOperator
type: object
properties:
lastUpdated:
format: date-time
type: string
description: Timestamp for when the status was last updated
phase:
type: string
description: High-level phase of the operator processing
reason:
type: string
description: More detailed reason for the current phase
message:
type: string
description: Detailed message about the current state
x-kubernetes-preserve-unknown-fields: true
type: object
served: true
storage: true
subresources:
status: {}
values:
type: array
items:
type: string
grafanaAPIToken:
description: Secret reference to the Grafana API token. Avoid putting the token directly.
type: object
properties:
secretName:
type: string
key:
type: string
x-kubernetes-preserve-unknown-fields: true
status:
description: Status defines the observed state of GrafanaCloudOperator
type: object
properties:
lastUpdated:
format: date-time
type: string
description: Timestamp for when the status was last updated
phase:
type: string
description: High-level phase of the operator processing
reason:
type: string
description: More detailed reason for the current phase
message:
type: string
description: Detailed message about the current state
x-kubernetes-preserve-unknown-fields: true
type: object
served: true
storage: true
subresources:
status: {}
4 changes: 2 additions & 2 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# since it depends on service name and namespace that are out of this kustomize package.
# It should be run by config/default
resources:
- bases/grafanacloud.stakater.com_grafanacloudoperators.yaml
#+kubebuilder:scaffold:crdkustomizeresource
- bases/grafanacloud.stakater.com_grafanacloudoperators.yaml
# +kubebuilder:scaffold:crdkustomizeresource
18 changes: 5 additions & 13 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,15 @@ namespace: grafana-cloud-ansible-operator-system
# field above.
namePrefix: grafana-cloud-ansible-operator-

# Labels to add to all resources and selectors.
#labels:
#- includeSelectors: true
# pairs:
# someName: someValue

resources:
- ../crd
- ../rbac
- ../manager
- ../crd
- ../rbac
- ../manager
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus
# - ../prometheus

patchesStrategicMerge:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml


- manager_auth_proxy_patch.yaml
80 changes: 40 additions & 40 deletions config/default/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,44 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- arm64
- ppc64le
- s390x
- key: kubernetes.io/os
operator: In
values:
- linux
- key: kubernetes.io/arch
operator: In
values:
- amd64
- arm64
- ppc64le
- s390x
- key: kubernetes.io/os
operator: In
values:
- linux
containers:
- name: kube-rbac-proxy
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- "ALL"
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
- "--logtostderr=true"
- "--v=0"
ports:
- containerPort: 8443
protocol: TCP
name: https
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 5m
memory: 64Mi
- name: manager
args:
- "--health-probe-bind-address=:6789"
- "--metrics-bind-address=127.0.0.1:8080"
- "--leader-elect"
- "--leader-election-id=grafana-cloud-ansible-operator"
- name: kube-rbac-proxy
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- "ALL"
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
- "--logtostderr=true"
- "--v=0"
ports:
- containerPort: 8443
protocol: TCP
name: https
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 5m
memory: 64Mi
- name: manager
args:
- "--health-probe-bind-address=:6789"
- "--metrics-bind-address=127.0.0.1:8080"
- "--leader-elect"
- "--leader-election-id=grafana-cloud-ansible-operator"
2 changes: 1 addition & 1 deletion config/default/manager_config_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ spec:
template:
spec:
containers:
- name: manager
- name: manager
8 changes: 4 additions & 4 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
resources:
- manager.yaml
- manager.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: ghcr.io/stakater/grafana-cloud-ansible-operator
newTag: v0.0.5
- name: controller
newName: ghcr.io/stakater/grafana-cloud-ansible-operator
newTag: v0.0.5
Loading

0 comments on commit 932cba2

Please sign in to comment.