Skip to content

Commit

Permalink
Deprecate colour codes, stop sending them to Submariner
Browse files Browse the repository at this point in the history
These aren't used, let's drop them.

Signed-off-by: Stephen Kitt <[email protected]>
  • Loading branch information
skitt committed Jan 18, 2022
1 parent 7f203c3 commit 0d0e16f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
2 changes: 0 additions & 2 deletions api/submariner/v1alpha1/submariner_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ type (
)

const (
DefaultColorCode = "blue"
K8s KubernetesType = "k8s"
OCP = "ocp"
EKS = "eks"
Expand Down Expand Up @@ -219,7 +218,6 @@ func (s *Submariner) UnmarshalJSON(data []byte) error {
Spec: SubmarinerSpec{
Repository: DefaultRepo,
Version: DefaultSubmarinerVersion,
ColorCodes: DefaultColorCode,
},
}

Expand Down
21 changes: 4 additions & 17 deletions pkg/subctl/cmd/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var (
ikePort int
preferredServer bool
forceUDPEncaps bool
colorCodes string
ignoredColorCodes string
natTraversal bool
ignoreRequirements bool
globalnetEnabled bool
Expand Down Expand Up @@ -93,7 +93,8 @@ func addJoinFlags(cmd *cobra.Command) {
cmd.Flags().StringVar(&clusterCIDR, "clustercidr", "", "cluster CIDR")
cmd.Flags().StringVar(&repository, "repository", "", "image repository")
cmd.Flags().StringVar(&imageVersion, "version", "", "image version")
cmd.Flags().StringVar(&colorCodes, "colorcodes", submariner.DefaultColorCode, "color codes")
cmd.Flags().StringVar(&ignoredColorCodes, "colorcodes", "", "color codes")
_ = cmd.Flags().MarkDeprecated("colorcodes", "--colorcodes has no effect and is deprecated")
cmd.Flags().IntVar(&nattPort, "nattport", 4500, "IPsec NATT port")
cmd.Flags().IntVar(&ikePort, "ikeport", 500, "IPsec IKE port")
cmd.Flags().BoolVar(&natTraversal, "natt", true, "enable NAT traversal for IPsec")
Expand Down Expand Up @@ -190,18 +191,9 @@ func joinSubmarinerCluster(subctlData *datafile.SubctlData) {
})
}

if colorCodes == "" {
qs = append(qs, &survey.Question{
Name: "colorCodes",
Prompt: &survey.Input{Message: "What color codes should be used (e.g. \"blue\")?"},
Validate: survey.Required,
})
}

if len(qs) > 0 {
answers := struct {
ClusterID string
ColorCodes string
ClusterID string
}{}

err := survey.Ask(qs, &answers)
Expand All @@ -211,10 +203,6 @@ func joinSubmarinerCluster(subctlData *datafile.SubctlData) {
if len(answers.ClusterID) > 0 {
clusterID = answers.ClusterID
}

if len(answers.ColorCodes) > 0 {
colorCodes = answers.ColorCodes
}
}

clientConfig, err := restConfigProducer.ClientConfig().ClientConfig()
Expand Down Expand Up @@ -526,7 +514,6 @@ func populateSubmarinerSpec(subctlData *datafile.SubctlData, brokerSecret, pskSe
Broker: "k8s",
NatEnabled: natTraversal,
Debug: submarinerDebug,
ColorCodes: colorCodes,
ClusterID: clusterID,
ServiceCIDR: crServiceCIDR,
ClusterCIDR: crClusterCIDR,
Expand Down
4 changes: 0 additions & 4 deletions scripts/kind-e2e/lib_operator_verify_subm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function create_subm_vars() {

# FIXME: Actually act on this size request in controller
subm_gateway_size=3
subm_colorcodes=blue
subm_debug=false
subm_broker=k8s
ce_ipsec_debug=false
Expand Down Expand Up @@ -208,7 +207,6 @@ function verify_subm_cr() {
validate_equals '.spec.version' $subm_gateway_image_tag
validate_equals '.spec.broker' $subm_broker
echo "Generated cluster id: $(jq -r '.spec.clusterID' $json_file)"
validate_equals '.spec.colorCodes' $subm_colorcodes
validate_equals '.spec.debug' $subm_debug
validate_equals '.spec.namespace' $subm_ns
validate_equals '.spec.natEnabled' $natEnabled
Expand Down Expand Up @@ -269,7 +267,6 @@ function verify_subm_gateway_pod() {
validate_pod_container_env 'SUBMARINER_NAMESPACE' $subm_ns
validate_pod_container_env 'SUBMARINER_SERVICECIDR' ${service_CIDRs[$cluster]}
validate_pod_container_env 'SUBMARINER_CLUSTERCIDR' ${cluster_CIDRs[$cluster]}
validate_pod_container_env 'SUBMARINER_COLORCODES' $subm_colorcodes
validate_pod_container_env 'SUBMARINER_DEBUG' $subm_debug
validate_pod_container_env 'SUBMARINER_NATENABLED' $natEnabled
validate_pod_container_env 'SUBMARINER_BROKER' $subm_broker
Expand Down Expand Up @@ -376,7 +373,6 @@ function verify_subm_gateway_container() {
grep "BROKER_K8S_REMOTENAMESPACE=$SUBMARINER_BROKER_NS" $env_file
grep "SUBMARINER_SERVICECIDR=${service_CIDRs[$cluster]}" $env_file
grep "SUBMARINER_CLUSTERCIDR=${cluster_CIDRs[$cluster]}" $env_file
grep "SUBMARINER_COLORCODES=$subm_colorcode" $env_file
grep "SUBMARINER_NATENABLED=$natEnabled" $env_file
grep "HOME=/root" $env_file

Expand Down

0 comments on commit 0d0e16f

Please sign in to comment.