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

feat: store config in XDG conform location #236

Merged

Conversation

patrickpichler
Copy link
Contributor

@patrickpichler patrickpichler commented Apr 10, 2023

Closes #235

📑 Description

The config file is now located in an folder according to the XDG
specification (XDG_CONFIG_HOME).

Since this is a breaking change, there is a check in place, which
informs the end user to please migrate to the new config location, if
the a file at the old config path has been located.

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

The config location will change. There is a check in place, which will display a warning to the end user.

@patrickpichler patrickpichler requested a review from a team as a code owner April 10, 2023 16:35
@patrickpichler patrickpichler force-pushed the feature/235/use-xdg-config-home branch from 674f032 to 3118abf Compare April 10, 2023 16:35
@patrickpichler patrickpichler changed the title feature: Store config in XDG conform location feat: Store config in XDG conform location Apr 10, 2023
@patrickpichler patrickpichler force-pushed the feature/235/use-xdg-config-home branch from 3118abf to b25294a Compare April 10, 2023 16:37
@patrickpichler patrickpichler changed the title feat: Store config in XDG conform location feat: Store config in XDG conform location Apr 10, 2023
@patrickpichler patrickpichler changed the title feat: Store config in XDG conform location feat: store config in XDG conform location Apr 10, 2023
cmd/root.go Outdated Show resolved Hide resolved
@patrickpichler patrickpichler force-pushed the feature/235/use-xdg-config-home branch from b25294a to 0601402 Compare April 10, 2023 17:11
cmd/root.go Outdated Show resolved Hide resolved
cmd/root.go Outdated Show resolved Hide resolved
cmd/root.go Outdated Show resolved Hide resolved
cmd/root.go Outdated Show resolved Hide resolved
@patrickpichler patrickpichler requested a review from a team as a code owner April 11, 2023 12:13
@AlexsJones
Copy link
Member

Thanks for updating @patrickpichler I think we need some conflicts sorted and the DCO signed -cheers!

@AlexsJones
Copy link
Member

Hey @patrickpichler thanks again, is this ready for review?

The config file is now located in an folder according to the XDG
specification (`XDG_CONFIG_HOME`).

Migration is performed automatically.

This fixes k8sgpt-ai#235.

Signed-off-by: Patrick Pichler <git@patrickpichler.dev>
@patrickpichler patrickpichler force-pushed the feature/235/use-xdg-config-home branch from 528a0e9 to dee4355 Compare April 15, 2023 11:19
@patrickpichler
Copy link
Contributor Author

@AlexsJones it is now ready to review 🙂

Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
Copy link
Member

@AlexsJones AlexsJones left a comment

Choose a reason for hiding this comment

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

Works beautifully, thank you

❯ go run main.go filter list
go: downloading github.com/adrg/xdg v0.4.0
Performing config file migration from `/Users/alex/.k8sgpt.yaml` to `/Users/alex/Library/Application Support/k8sgpt/k8sgpt.yaml`
Active:
> StatefulSet
> NetworkPolicy
> Node
> Service
> Ingress
> PersistentVolumeClaim
> CronJob
> ReplicaSet
> Pod
> Deployment
> VulnerabilityReport (integration)
Unused:
> PodDisruptionBudget
> HorizontalPodAutoScaler

@AlexsJones AlexsJones merged commit 8615ea2 into k8sgpt-ai:main Apr 16, 2023
@patrickpichler patrickpichler deleted the feature/235/use-xdg-config-home branch April 16, 2023 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

feature: Store config in XDG conform location
4 participants