Skip to content

Commit

Permalink
Remove channelv2 post install (#4018)
Browse files Browse the repository at this point in the history
* cleanup: remove the channelv2 post install code

Signed-off-by: Calum Murray <[email protected]>

* cleanup: remove the extra permissions needed for post installs

Signed-off-by: Calum Murray <[email protected]>

* cleanup: remove the upgrade test code needed for post installs

Signed-off-by: Calum Murray <[email protected]>

---------

Signed-off-by: Calum Murray <[email protected]>
  • Loading branch information
Cali0707 authored Jul 30, 2024
1 parent a1824c9 commit e9ac303
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 321 deletions.
43 changes: 0 additions & 43 deletions control-plane/cmd/post-install/kafka_channel_deployment_deleter.go

This file was deleted.

This file was deleted.

56 changes: 1 addition & 55 deletions control-plane/cmd/post-install/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,58 +16,4 @@

package main

import (
"context"
"flag"
"fmt"
"log"

"k8s.io/client-go/kubernetes"

"knative.dev/pkg/environment"
"knative.dev/pkg/logging"
"knative.dev/pkg/signals"
)

func main() {
ctx := signals.NewContext()

config, err := logging.NewConfigFromMap(nil)
if err != nil {
log.Fatal("Failed to create logging config: ", err)
}

logger, _ := logging.NewLoggerFromConfig(config, "kafka-broker-post-install")
defer logger.Sync()

logging.WithLogger(ctx, logger)

if err := run(ctx); err != nil {
logger.Fatal(err)
}
}

func run(ctx context.Context) error {
env := environment.ClientConfig{}
env.InitFlags(flag.CommandLine)
flag.Parse()

config, err := env.GetRESTConfig()
if err != nil {
return fmt.Errorf("failed to get kubeconfig: %w", err)
}

deploymentDeleter := &kafkaDeploymentDeleter{
k8s: kubernetes.NewForConfigOrDie(config),
}

if err := deploymentDeleter.DeleteChannelDeployments(ctx); err != nil {
return fmt.Errorf("channel migration failed: %v", err)
}

if err := deploymentDeleter.DeleteBrokerDeployments(ctx); err != nil {
return fmt.Errorf("broker migration failed: %v", err)
}

return nil
}
func main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,4 @@ metadata:
name: knative-kafka-controller-post-install
labels:
app.kubernetes.io/version: devel
rules:
# we need to be able to delete old deployments
- apiGroups:
- "apps"
resources:
- "deployments"
verbs:
- "delete"
- "list"
# we need to get statefulsets
- apiGroups:
- "apps"
resources:
- "statefulsets"
verbs:
- "get"
- "list"
rules: []
113 changes: 0 additions & 113 deletions test/upgrade/installation/channelv2_downgrade.go

This file was deleted.

2 changes: 0 additions & 2 deletions test/upgrade/installation/stable.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,5 @@ import (
func LatestStable(glob environment.GlobalEnvironment) pkgupgrade.Operation {
return pkgupgrade.NewOperation("LatestStable", func(c pkgupgrade.Context) {
runShellFunc("install_latest_release", c)
cleanupChannelv2Deployments(c, glob)
cleanupChannelv2ConsumerGroups(c, glob)
})
}

0 comments on commit e9ac303

Please sign in to comment.