Skip to content

Commit

Permalink
remove snap support
Browse files Browse the repository at this point in the history
  • Loading branch information
d-rk committed Feb 10, 2025
1 parent 7986adc commit 08c783a
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 67 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: '1.23'
-
name: setup-snapcraft
# FIXME: the mkdirs are a hack for https://github.com/goreleaser/goreleaser/issues/1715
run: |
sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
mkdir -p $HOME/.cache/snapcraft/download
mkdir -p $HOME/.cache/snapcraft/stage-packages
-
name: Docker login
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
Expand All @@ -41,5 +33,3 @@ jobs:
# create personal access token: https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
# docker run --rm -it snapcore/snapcraft snapcraft export-login --snaps kafkactl --channels edge,beta,candidate,stable -
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ kafkactl.exe
.kafkactl.yml
kafkactl.yml

### Snap
snap.login

### logs
*.log
/kafkactl-completion.bash
24 changes: 0 additions & 24 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,30 +40,6 @@ release:
disable: false
draft: false

snapcrafts:
- id: default
publish: true
summary: A command-line interface for interaction with Apache Kafka
description: |
A Commandline interface for Apache Kafka which provides useful features adapted from kubectl for Kubernetes.
Multiple kafka brokers can be configured in a config file and the active broker is also persisted within the config.
In addition kafkactl supports auto-completion for its commands as well as topic names.
grade: stable
confinement: strict
license: Apache-2.0
apps:
kafkactl:
plugs: ["home", "network", "dot-kube", "config-kafkactl"]
completer: kafkactl-completion.bash
plugs:
dot-kube:
interface: personal-files
read:
- $HOME/.kube
config-kafkactl:
interface: personal-files
write:
- $HOME/.config/kafkactl/config.yml
brews:
-
repository:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Removed
- [#231](https://github.com/deviceinsight/kafkactl/issues/231) Remove support for installing kafkactl via snap.

## 5.4.0 - 2024-11-28
### Added
- [#215](https://github.com/deviceinsight/kafkactl/pull/215) Add `--context` option to set command's context
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ clean:
# manually executing goreleaser:
# export GITHUB_TOKEN=xyz
# export AUR_SSH_PRIVATE_KEY=$(cat /path/to/id_aur)
# snapcraft login
# docker login
# goreleaser --clean (--skip-validate)
#
Expand Down
15 changes: 0 additions & 15 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ Download the .deb or .rpm from the https://github.com/deviceinsight/kafkactl/rel

There's a kafkactl https://aur.archlinux.org/packages/kafkactl/[AUR package] available for Arch. Install it with your AUR helper of choice (e.g. https://github.com/Jguer/yay[yay]):

*snap*:

[,bash]
----
snap install kafkactl
----

[,bash]
----
yay -S kafkactl
Expand Down Expand Up @@ -234,8 +227,6 @@ The config file location is resolved by
** `$HOME/.config/kafkactl/config.yml`
** `$HOME/.kafkactl/config.yml`
** `$APPDATA/kafkactl/config.yml`
** `$SNAP_REAL_HOME/.kafkactl/config.yml`
** `$SNAP_DATA/kafkactl/config.yml`
** `/etc/kafkactl/config.yml`

[#_project_config_files]
Expand Down Expand Up @@ -267,8 +258,6 @@ according to <<_config_file_read_order, the config file read order>>.

==== bash

*NOTE:* if you installed via snap, bash completion should work automatically.

----
source <(kafkactl completion bash)
----
Expand Down Expand Up @@ -386,10 +375,6 @@ a bash available. The second option uses a docker image build from scratch and s
Which option is more suitable, will depend on your use-case.
____

____
:warning: currently _kafkactl_ must *NOT* be installed via _snap_ in order for the kubernetes feature to work. The snap runs in a sandbox and is therefore unable to access the `kubectl` binary.
____

== Configuration via environment variables

Every key in the `config.yml` can be overwritten via environment variables. The corresponding environment variable
Expand Down
14 changes: 0 additions & 14 deletions internal/global/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ var configPaths = []string{
"$HOME/.config/kafkactl",
"$HOME/.kafkactl",
"$APPDATA/kafkactl",
"$SNAP_REAL_HOME/.config/kafkactl",
"$SNAP_DATA/kafkactl",
"/etc/kafkactl",
}

Expand Down Expand Up @@ -125,10 +123,6 @@ func (c *config) Init() {
configFile = &envConfig
}

if c.flags.Verbose && os.Getenv("SNAP_NAME") != "" {
output.Debugf("Running snap version %s on %s", os.Getenv("SNAP_VERSION"), os.Getenv("SNAP_ARCH"))
}

mapEnvVariables()

if err := c.loadConfig(viper.GetViper(), configFile); err != nil {
Expand Down Expand Up @@ -272,14 +266,6 @@ func generateDefaultConfig() error {
if os.Getenv("KAFKA_CTL_CONFIG") != "" {
// use config file provided via env
cfgFile = os.Getenv("KAFKA_CTL_CONFIG")
} else if os.Getenv("SNAP_REAL_HOME") != "" {
// use different configFile when running in snap
for _, configPath := range configPaths {
if strings.Contains(configPath, "$SNAP_REAL_HOME") {
cfgFile = filepath.Join(os.ExpandEnv(configPath), "config.yml")
break
}
}
} else if runtime.GOOS == "windows" {
// use different configFile when running on windows
for _, configPath := range configPaths {
Expand Down

0 comments on commit 08c783a

Please sign in to comment.