Repository: skupperproject/skupper
Pull request #1658 (2024-09-16 18:55:52)

Modify image references for v2
* router environment key changed to `SKUPPER_ROUTER_IMAGE`
* added new constants for the controller and the new flow-collector


Patch:
diff --git a/README.md b/README.md
index 97beec49..cbd71902 100644
--- a/README.md
+++ b/README.md
@@ -1,37 +1,49 @@
-# Skupper
+# Skupper Version 2
 
-[![skupper](https://circleci.com/gh/skupperproject/skupper.svg?style=shield)](https://app.circleci.com/pipelines/github/skupperproject/skupper)
+Skupper allows you to create a Virtual Application Network (VAN) enabling secure, location independent
+communication between systems including public cloud, private cloud, virtual machines (VMs),
+bare metal hosts, and mainframes.
 
-Skupper enables cloud communication by enabling you to create a Virtual Application Network.
+Version 1 of Skupper is working in many production environments and has significantly reduced the
+time, effort and expense of deploying applications to a hybrid multicloud.
 
-This application layer network decouples addressing from the underlying network infrastructure.
-This enables secure communication without a VPN.
+The [v2 branch](https://github.com/skupperproject/skupper/tree/v2) focuses on the development of the upcoming
+major release of the Skupper project based on feedback from users.
 
-You can use Skupper to create a network from namespaces in one or more Kubernetes clusters as described in the [Getting Started](https://skupper.io/start/index.html).
-This guide describes a simple network, however there are no restrictions on the topology created which can include redundant paths.
+The plan is to produce a number of "previews" on the branch in order to get further user feedback and refine the
+implementation of this major release. The v2 branch is intended for evaluation purposes only and should not be used
+in production environments.
 
-Connecting one Skupper site to another site enables communication both ways.
-Communication can occur using any path available on the network, that is, direct connections are not required to enable communication.
+# Highlights
 
-Skupper supports [anycast](https://en.wikipedia.org/wiki/Anycast) and [multicast](https://en.wikipedia.org/wiki/Multicast) communication using the application layer network (VAN), allowing you to configure your topology to match business requirements.
+The objective of the next Skupper major release is to better support a full declarative model so that applications
+and VANs can be more easily deployed in fully automated frameworks.
 
-Skupper does not require any special privileges, that is, you do not require the `cluster-admin` role to create networks.
+The release includes:
 
-# Useful Links
-Using Skupper
+* The introducton of Custom Resource Definitions [CRDs](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/)
+  for a more intuitive and flexible declarative interfaces for users, with an equivalent implementation for Linux.
+* Architectural improvements for the primary components (e.g. controller, cli, and non-kube executable)
+* A flexible PKI implementation allowing users to easily provide their own certificates as required
+* A network collector and console that is deployed separately from the site components
+* Simpler integrations for centralized application network definition
+
+# Interoperability with Version 1
 
-* [Getting Started](https://skupper.io/start/index.html)
-* [Examples](https://skupper.io/examples/index.html)
-* [Documentation](https://skupper.io/docs/index.html)
-* [Skupper Docker](https://github.com/skupperproject/skupper-docker) allows you run Skupper on your laptop
+Skupper v2 sites are not interoperable with v1 sites. The plan is to provide tools to assist users to
+migrate their v1 installations to a v2 deployment as the release approaches.
 
+Skupper v1 will continue to be maintained but no new significant features are planned.
+
+# Useful Links
+Using Skupper v2
 
-Developing Skupper
+* [Simple Example](https://github.com/skupperproject/skupper/blob/v2/cmd/controller/example/README.md)
+* [Network Console Collector Deployment](https://github.com/skupperproject/skupper/blob/v2/cmd/network-console-collector/resources/README.md)
+* [Redis Example](https://github.com/skupperproject/skupper-example-redis/tree/v2)
 
-* [Community](https://skupper.io/community/index.html)
-* [Site controller](cmd/site-controller/README.md)
-* [CLI](cmd/skupper/README.md) (This replaces the [Skupper CLI repo](https://github.com/skupperproject/skupper-cli))
-* [Console (Preview)](https://github.com/skupperproject/skupper-console)
+# Questions and Feedback
 
-# Licensing
-Skupper uses the [Skupper Router](https://github.com/skupperproject/skupper-router) project and is released under the same [Apache License 2.0](https://github.com/skupperproject/skupper/blob/main/LICENSE).
+For any questions, feedback or reporting of issues encountered using the v2 preview, please use
+the Skupper community mailing list or create a GitHub issue as described on the Skupper web site
+[community page](https://skupper.io/community/index.html)
diff --git a/pkg/images/image_utils.go b/pkg/images/image_utils.go
index 990f3aa9..f8db00f5 100644
--- a/pkg/images/image_utils.go
+++ b/pkg/images/image_utils.go
@@ -11,23 +11,23 @@ import (
 )
 
 const (
-	RouterImageEnvKey                 string = "QDROUTERD_IMAGE"
-	ServiceControllerImageEnvKey      string = "SKUPPER_SERVICE_CONTROLLER_IMAGE"
-	ControllerPodmanImageEnvKey       string = "SKUPPER_CONTROLLER_PODMAN_IMAGE"
-	ConfigSyncImageEnvKey             string = "SKUPPER_CONFIG_SYNC_IMAGE"
-	FlowCollectorImageEnvKey          string = "SKUPPER_FLOW_COLLECTOR_IMAGE"
-	PrometheusServerImageEnvKey       string = "PROMETHEUS_SERVER_IMAGE"
-	OauthProxyImageEnvKey             string = "OAUTH_PROXY_IMAGE"
-	RouterPullPolicyEnvKey            string = "QDROUTERD_IMAGE_PULL_POLICY"
-	ServiceControllerPullPolicyEnvKey string = "SKUPPER_SERVICE_CONTROLLER_IMAGE_PULL_POLICY"
-	ControllerPodmanPullPolicyEnvKey  string = "SKUPPER_CONTROLLER_PODMAN_IMAGE_PULL_POLICY"
-	ConfigSyncPullPolicyEnvKey        string = "SKUPPER_CONFIG_SYNC_IMAGE_PULL_POLICY"
-	FlowCollectorPullPolicyEnvKey     string = "SKUPPER_FLOW_COLLECTOR_IMAGE_PULL_POLICY"
-	PrometheusServerPullPolicyEnvKey  string = "PROMETHEUS_SERVER_IMAGE_PULL_POLICY"
-	OauthProxyPullPolicyEnvKey        string = "OAUTH_PROXY_IMAGE_PULL_POLICY"
-	SkupperImageRegistryEnvKey        string = "SKUPPER_IMAGE_REGISTRY"
-	PrometheusImageRegistryEnvKey     string = "PROMETHEUS_IMAGE_REGISTRY"
-	OauthProxyRegistryEnvKey          string = "OAUTH_PROXY_IMAGE_REGISTRY"
+	RouterImageEnvKey                  string = "SKUPPER_ROUTER_IMAGE"
+	ControllerImageEnvKey              string = "SKUPPER_CONTROLLER_IMAGE"
+	ConfigSyncImageEnvKey              string = "SKUPPER_CONFIG_SYNC_IMAGE"
+	NetworkConsoleCollectorImageEnvKey string = "SKUPPER_FLOW_COLLECTOR_IMAGE"
+	BootstrapImageEnvKey               string = "BOOTSTRAP_IMAGE"
+	PrometheusServerImageEnvKey        string = "PROMETHEUS_SERVER_IMAGE"
+	OauthProxyImageEnvKey              string = "OAUTH_PROXY_IMAGE"
+	RouterPullPolicyEnvKey             string = "SKUPPER_ROUTER_IMAGE_PULL_POLICY"
+	ConfigSyncPullPolicyEnvKey         string = "SKUPPER_CONFIG_SYNC_IMAGE_PULL_POLICY"
+	OauthProxyPullPolicyEnvKey         string = "OAUTH_PROXY_IMAGE_PULL_POLICY"
+	SkupperImageRegistryEnvKey         string = "SKUPPER_IMAGE_REGISTRY"
+	PrometheusImageRegistryEnvKey      string = "PROMETHEUS_IMAGE_REGISTRY"
+	OauthProxyRegistryEnvKey           string = "OAUTH_PROXY_IMAGE_REGISTRY"
+
+	// These constants will be soon deprecated.
+	ServiceControllerImageEnvKey string = "SKUPPER_SERVICE_CONTROLLER_IMAGE"
+	FlowCollectorImageEnvKey     string = "SKUPPER_FLOW_COLLECTOR_IMAGE"
 )
 
 func getPullPolicy(key string) string {
@@ -73,45 +73,43 @@ func AddRouterImageOverrideToEnv(env []corev1.EnvVar) []corev1.EnvVar {
 	return result
 }
 
-func GetServiceControllerImageName() string {
-	image := os.Getenv(ServiceControllerImageEnvKey)
+func GetControllerImageName() string {
+	image := os.Getenv(ControllerImageEnvKey)
 	if image == "" {
 		imageRegistry := GetImageRegistry()
-		return strings.Join([]string{imageRegistry, ServiceControllerImageName}, "/")
+		return strings.Join([]string{imageRegistry, ControllerImageName}, "/")
 	} else {
 		return image
 	}
 }
 
-func GetServiceControllerImagePullPolicy() string {
-	return getPullPolicy(ServiceControllerPullPolicyEnvKey)
-}
-
-func GetServiceControllerImageDetails() types.ImageDetails {
-	return types.ImageDetails{
-		Name:       GetServiceControllerImageName(),
-		PullPolicy: GetServiceControllerImagePullPolicy(),
+func GetNetworkConsoleCollectorImageName() string {
+	image := os.Getenv(NetworkConsoleCollectorImageEnvKey)
+	if image == "" {
+		imageRegistry := GetImageRegistry()
+		return strings.Join([]string{imageRegistry, NetworkConsoleCollectorImageName}, "/")
+	} else {
+		return image
 	}
 }
 
-func GetControllerPodmanImageName() string {
-	image := os.Getenv(ControllerPodmanImageEnvKey)
+func GetBootstrapImageName() string {
+	image := os.Getenv(BootstrapImageEnvKey)
 	if image == "" {
 		imageRegistry := GetImageRegistry()
-		return strings.Join([]string{imageRegistry, ControllerPodmanImageName}, "/")
+		return strings.Join([]string{imageRegistry, BootstrapImageName}, "/")
 	} else {
 		return image
 	}
 }
 
-func GetControllerPodmanImagePullPolicy() string {
-	return getPullPolicy(ControllerPodmanPullPolicyEnvKey)
-}
-
-func GetControllerPodmanImageDetails() types.ImageDetails {
-	return types.ImageDetails{
-		Name:       GetControllerPodmanImageName(),
-		PullPolicy: GetControllerPodmanImagePullPolicy(),
+func GetServiceControllerImageName() string {
+	image := os.Getenv(ServiceControllerImageEnvKey)
+	if image == "" {
+		imageRegistry := GetImageRegistry()
+		return strings.Join([]string{imageRegistry, ServiceControllerImageName}, "/")
+	} else {
+		return image
 	}
 }
 
@@ -146,17 +144,6 @@ func GetFlowCollectorImageName() string {
 	}
 }
 
-func GetFlowCollectorImagePullPolicy() string {
-	return getPullPolicy(FlowCollectorPullPolicyEnvKey)
-}
-
-func GetFlowCollectorImageDetails() types.ImageDetails {
-	return types.ImageDetails{
-		Name:       GetFlowCollectorImageName(),
-		PullPolicy: GetFlowCollectorImagePullPolicy(),
-	}
-}
-
 func GetPrometheusServerImageName() string {
 	image := os.Getenv(PrometheusServerImageEnvKey)
 	if image == "" {
@@ -167,17 +154,6 @@ func GetPrometheusServerImageName() string {
 	}
 }
 
-func GetPrometheusServerImagePullPolicy() string {
-	return getPullPolicy(PrometheusServerPullPolicyEnvKey)
-}
-
-func GetPrometheusServerImageDetails() types.ImageDetails {
-	return types.ImageDetails{
-		Name:       GetPrometheusServerImageName(),
-		PullPolicy: GetPrometheusServerImagePullPolicy(),
-	}
-}
-
 func GetImageRegistry() string {
 	imageRegistry := os.Getenv(SkupperImageRegistryEnvKey)
 	if imageRegistry == "" {
diff --git a/pkg/images/images.go b/pkg/images/images.go
index f6a13424..c54a6791 100644
--- a/pkg/images/images.go
+++ b/pkg/images/images.go
@@ -1,15 +1,20 @@
 package images
 
 const (
-	DefaultImageRegistry       string = "quay.io/skupper"
-	RouterImageName            string = "skupper-router:main"
+	DefaultImageRegistry             string = "quay.io/skupper"
+	RouterImageName                  string = "skupper-router:main"
+	ControllerImageName              string = "controller:v2-latest"
+	ConfigSyncImageName              string = "config-sync:v2-latest"
+	NetworkConsoleCollectorImageName string = "network-console-collector:v2-latest"
+	BootstrapImageName               string = "bootstrap:v2-latest"
+
+	PrometheusImageRegistry   string = "quay.io/prometheus"
+	PrometheusServerImageName string = "prometheus:v2.42.0"
+	OauthProxyImageRegistry   string = "quay.io/openshift"
+	OauthProxyImageName       string = "origin-oauth-proxy:4.14.0"
+
+	// These constants will be soon deprecated.
 	ServiceControllerImageName string = "service-controller:main"
-	ControllerPodmanImageName  string = "controller-podman:main"
-	ConfigSyncImageName        string = "config-sync:main"
 	FlowCollectorImageName     string = "flow-collector:main"
 	SiteControllerImageName    string = "site-controller:main"
-	PrometheusImageRegistry    string = "quay.io/prometheus"
-	PrometheusServerImageName  string = "prometheus:v2.42.0"
-	OauthProxyImageRegistry    string = "quay.io/openshift"
-	OauthProxyImageName        string = "origin-oauth-proxy:4.14.0"
 )
diff --git a/pkg/utils/configs/manifest.go b/pkg/utils/configs/manifest.go
index 4304b2fb..c0fcd3db 100644
--- a/pkg/utils/configs/manifest.go
+++ b/pkg/utils/configs/manifest.go
@@ -1,7 +1,6 @@
 package configs
 
 import (
-	"bufio"
 	"encoding/json"
 	"fmt"
 	"github.com/skupperproject/skupper/pkg/images"
@@ -45,22 +44,6 @@ func (manager *ManifestManager) GetDefaultManifestWithEnv() Manifest {
 
 func (manager *ManifestManager) CreateFile(m Manifest) error {
 	filename := "manifest.json"
-	if _, err := os.Stat(filename); err == nil {
-		fmt.Printf("The file %s already exists. Continuing will override it.\n", filename)
-		fmt.Print("Are you sure you want to proceed? [Y/n]")
-
-		reader := bufio.NewReader(os.Stdin)
-		userInput, err := reader.ReadString('\n')
-		if err != nil {
-			fmt.Println("Error reading input:", err)
-			return nil
-		}
-
-		userInput = strings.TrimRight(userInput, "\n")
-		if userInput != "" && userInput != "Y" && userInput != "y" {
-			return nil
-		}
-	}
 
 	// Encode the manifest image list as JSON.
 	manifestListJSON, err := json.MarshalIndent(m, "", "   ")
@@ -93,13 +76,8 @@ func getSkupperConfiguredImages(enableSHA bool) []SkupperImage {
 			Repository: "https://github.com/skupperproject/skupper-router",
 		},
 		{
-			Name:       images.GetServiceControllerImageName(),
-			SHA:        getSHAIfEnabled(enableSHA, images.GetServiceControllerImageName()),
-			Repository: "https://github.com/skupperproject/skupper",
-		},
-		{
-			Name:       images.GetControllerPodmanImageName(),
-			SHA:        getSHAIfEnabled(enableSHA, images.GetControllerPodmanImageName()),
+			Name:       images.GetControllerImageName(),
+			SHA:        getSHAIfEnabled(enableSHA, images.GetControllerImageName()),
 			Repository: "https://github.com/skupperproject/skupper",
 		},
 		{
@@ -108,13 +86,13 @@ func getSkupperConfiguredImages(enableSHA bool) []SkupperImage {
 			Repository: "https://github.com/skupperproject/skupper",
 		},
 		{
-			Name:       images.GetFlowCollectorImageName(),
-			SHA:        getSHAIfEnabled(enableSHA, images.GetFlowCollectorImageName()),
+			Name:       images.GetNetworkConsoleCollectorImageName(),
+			SHA:        getSHAIfEnabled(enableSHA, images.GetNetworkConsoleCollectorImageName()),
 			Repository: "https://github.com/skupperproject/skupper",
 		},
 		{
-			Name:       images.GetSiteControllerImageName(),
-			SHA:        getSHAIfEnabled(enableSHA, images.GetSiteControllerImageName()),
+			Name:       images.GetBootstrapImageName(),
+			SHA:        getSHAIfEnabled(enableSHA, images.GetBootstrapImageName()),
 			Repository: "https://github.com/skupperproject/skupper",
 		},
 		{
@@ -134,26 +112,10 @@ func getSkupperDefaultImages() []SkupperImage {
 			Name:       strings.Join([]string{images.DefaultImageRegistry, images.RouterImageName}, "/"),
 			Repository: "https://github.com/skupperproject/skupper-router",
 		},
-		{
-			Name:       strings.Join([]string{images.DefaultImageRegistry, images.ServiceControllerImageName}, "/"),
-			Repository: "https://github.com/skupperproject/skupper",
-		},
-		{
-			Name:       strings.Join([]string{images.DefaultImageRegistry, images.ControllerPodmanImageName}, "/"),
-			Repository: "https://github.com/skupperproject/skupper",
-		},
 		{
 			Name:       strings.Join([]string{images.DefaultImageRegistry, images.ConfigSyncImageName}, "/"),
 			Repository: "https://github.com/skupperproject/skupper",
 		},
-		{
-			Name:       strings.Join([]string{images.DefaultImageRegistry, images.FlowCollectorImageName}, "/"),
-			Repository: "https://github.com/skupperproject/skupper",
-		},
-		{
-			Name:       strings.Join([]string{images.DefaultImageRegistry, images.SiteControllerImageName}, "/"),
-			Repository: "https://github.com/skupperproject/skupper",
-		},
 		{
 			Name: strings.Join([]string{images.PrometheusImageRegistry, images.PrometheusServerImageName}, "/"),
 		},
@@ -187,14 +149,9 @@ func getEnvironmentVariableMap() *map[string]string {
 		envVariables[images.RouterImageEnvKey] = routerImage
 	}
 
-	serviceControllerImage := os.Getenv(images.ServiceControllerImageEnvKey)
-	if serviceControllerImage != "" {
-		envVariables[images.ServiceControllerImageEnvKey] = serviceControllerImage
-	}
-
-	controllerPodmanImage := os.Getenv(images.ControllerPodmanImageEnvKey)
-	if controllerPodmanImage != "" {
-		envVariables[images.ControllerPodmanImageEnvKey] = controllerPodmanImage
+	controllerImage := os.Getenv(images.ControllerImageEnvKey)
+	if controllerImage != "" {
+		envVariables[images.ControllerImageEnvKey] = controllerImage
 	}
 
 	configSyncImage := os.Getenv(images.ConfigSyncImageEnvKey)
@@ -202,9 +159,14 @@ func getEnvironmentVariableMap() *map[string]string {
 		envVariables[images.ConfigSyncImageEnvKey] = configSyncImage
 	}
 
-	flowCollectorImage := os.Getenv(images.FlowCollectorImageEnvKey)
-	if flowCollectorImage != "" {
-		envVariables[images.FlowCollectorImageEnvKey] = flowCollectorImage
+	flowNetworkConsoleCollectorImage := os.Getenv(images.NetworkConsoleCollectorImageEnvKey)
+	if flowNetworkConsoleCollectorImage != "" {
+		envVariables[images.NetworkConsoleCollectorImageEnvKey] = flowNetworkConsoleCollectorImage
+	}
+
+	bootstrapImage := os.Getenv(images.BootstrapImageEnvKey)
+	if bootstrapImage != "" {
+		envVariables[images.BootstrapImageEnvKey] = bootstrapImage
 	}
 
 	prometheusImage := os.Getenv(images.PrometheusServerImageEnvKey)


Test patch:
diff --git a/pkg/utils/configs/manifest_test.go b/pkg/utils/configs/manifest_test.go
index c1bed966..5893fd25 100644
--- a/pkg/utils/configs/manifest_test.go
+++ b/pkg/utils/configs/manifest_test.go
@@ -28,7 +28,7 @@ func TestManifestManager(t *testing.T) {
 						Name: "SKUPPER_CONFIG_SYNC_IMAGE_TESTING",
 					},
 					{
-						Name: "QDROUTERD_IMAGE_TESTING"},
+						Name: "SKUPPER_ROUTER_IMAGE_TESTING"},
 				},
 			},
 			expectedDefaultManifestWithEnv: Manifest{
@@ -43,7 +43,7 @@ func TestManifestManager(t *testing.T) {
 				Variables: &map[string]string{
 					images.SkupperImageRegistryEnvKey: "SKUPPER_IMAGE_REGISTRY_TESTING",
 					images.ConfigSyncImageEnvKey:      "SKUPPER_CONFIG_SYNC_IMAGE_TESTING",
-					images.RouterImageEnvKey:          "QDROUTERD_IMAGE_TESTING",
+					images.RouterImageEnvKey:          "SKUPPER_ROUTER_IMAGE_TESTING",
 				},
 			},
 		},