Skip to content
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

fix: properly indent service annotations (#25388) #25463

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

rfairburn
Copy link
Contributor

When then was more than 1 annotation on the service, it would not be properly indented.

$ cat test-values.yaml 
serviceAnnotations:
  foo: bar
  bar: baz
  baz: qux
$ helm template fleet . -f test-values.yaml --show-only templates/service.yaml
---
# Source: fleet/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  labels:
    app: fleet
    chart: fleet
    heritage: Helm
    release: fleet
  annotations:
    bar: baz
    baz: qux
    foo: bar
  name: fleet-service
  namespace: fleet
spec:
  selector:
    app: fleet
    chart: fleet
    heritage: Helm
    release: fleet
  ports:
  - name: fleet
    port: 8080
    targetPort: 8080

before:

$ git checkout main
$ helm template fleet . -f test-values.yaml --show-only templates/service.yaml
---
# Source: fleet/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  labels:
    app: fleet
    chart: fleet
    heritage: Helm
    release: fleet
  annotations:
    bar: baz
  baz: qux
  foo: bar
  name: fleet-service
  namespace: fleet
spec:
  selector:
    app: fleet
    chart: fleet
    heritage: Helm
    release: fleet
  ports:
  - name: fleet
    port: 8080
    targetPort: 8080

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

<!-- Note that API documentation changes are now addressed by the product design team. -->

- [ ] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`.
  See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files) for more information.
- [ ] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements)
- [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for new osquery data ingestion features.
- [ ] If paths of existing endpoints are modified without backwards compatibility, checked the frontend/CLI for any necessary changes
- [ ] If database migrations are included, checked table schema to confirm autoupdate
- For database migrations:
  - [ ] Checked schema for all modified table for columns that will auto-update timestamps during migration.
  - [ ] Confirmed that updating the timestamps is acceptable, and will not cause unwanted side effects.
  - [ ] Ensured the correct collation is explicitly set for character columns (`COLLATE utf8mb4_unicode_ci`).
- [ ] Added/updated automated tests
- [ ] A detailed QA plan exists on the associated ticket (if it isn't there, work with the product group's QA engineer to add it)
- [ ] Manual QA for all new/changed functionality
- For Orbit and Fleet Desktop changes:
   - [ ] Orbit runs on macOS, Linux and Windows. Check if the orbit feature/bugfix should only apply to one platform (`runtime.GOOS`).
   - [ ] Manual QA must be performed in the three main OSs, macOS, Windows and Linux.
   - [ ] Auto-update manual QA, from released version of component to new version (see [tools/tuf/test](../tools/tuf/test/README.md)).

When then was more than 1 annotation on the service, it would not be
properly indented.

```
$ cat test-values.yaml 
serviceAnnotations:
  foo: bar
  bar: baz
  baz: qux
$ helm template fleet . -f test-values.yaml --show-only templates/service.yaml
---
# Source: fleet/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  labels:
    app: fleet
    chart: fleet
    heritage: Helm
    release: fleet
  annotations:
    bar: baz
    baz: qux
    foo: bar
  name: fleet-service
  namespace: fleet
spec:
  selector:
    app: fleet
    chart: fleet
    heritage: Helm
    release: fleet
  ports:
  - name: fleet
    port: 8080
    targetPort: 8080
```

before:

```
$ git checkout main
$ helm template fleet . -f test-values.yaml --show-only templates/service.yaml
---
# Source: fleet/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  labels:
    app: fleet
    chart: fleet
    heritage: Helm
    release: fleet
  annotations:
    bar: baz
  baz: qux
  foo: bar
  name: fleet-service
  namespace: fleet
spec:
  selector:
    app: fleet
    chart: fleet
    heritage: Helm
    release: fleet
  ports:
  - name: fleet
    port: 8080
    targetPort: 8080
Copy link
Member

@lukeheath lukeheath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, my bad! Thanks.

@lukeheath lukeheath merged commit 544d254 into rc-minor-fleet-v4.63.0 Jan 15, 2025
6 checks passed
@lukeheath lukeheath deleted the helm-update-to-rc-v4.63.0 branch January 15, 2025 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants