Skip to content

Commit

Permalink
Remove federation support
Browse files Browse the repository at this point in the history
As it has been removed from upstream kubernetes, in favor of the
multicluster revamp.
  • Loading branch information
justinsb committed Feb 3, 2018
1 parent 4e284e9 commit 7dfca05
Show file tree
Hide file tree
Showing 99 changed files with 9 additions and 4,787 deletions.
15 changes: 4 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ UNIQUE:=$(shell date +%s)
GOVERSION=1.9.3
BUILD=$(GOPATH_1ST)/src/k8s.io/kops/.build
LOCAL=$(BUILD)/local
BINDATA_TARGETS=upup/models/bindata.go federation/model/bindata.go
BINDATA_TARGETS=upup/models/bindata.go
ARTIFACTS=$(BUILD)/artifacts
DIST=$(BUILD)/dist
IMAGES=$(DIST)/images
Expand Down Expand Up @@ -167,10 +167,6 @@ UPUP_MODELS_BINDATA_SOURCES:=$(shell find upup/models/ | egrep -v "upup/models/b
upup/models/bindata.go: ${GOBINDATA} ${UPUP_MODELS_BINDATA_SOURCES}
cd ${GOPATH_1ST}/src/k8s.io/kops; ${GOBINDATA} -o $@ -pkg models -ignore="\\.DS_Store" -ignore="bindata\\.go" -ignore="vfs\\.go" -prefix upup/models/ upup/models/...

FEDERATION_MODELS_BINDATA_SOURCES:=$(shell find federation/model/ | egrep -v "federation/model/bindata.go")
federation/model/bindata.go: ${GOBINDATA} ${FEDERATION_MODELS_BINDATA_SOURCES}
cd ${GOPATH_1ST}/src/k8s.io/kops; ${GOBINDATA} -o $@ -pkg model -ignore="\\.DS_Store" -ignore="bindata\\.go" -prefix federation/model/ federation/model/...

# Build in a docker container with golang 1.X
# Used to test we have not broken 1.X
# 1.8 is preferred, 1.9 is coming soon so we have a target for it
Expand Down Expand Up @@ -458,7 +454,6 @@ gofmt:
gofmt -w -s cloudmock/
gofmt -w -s cmd/
gofmt -w -s examples/
gofmt -w -s federation/
gofmt -w -s nodeup/
gofmt -w -s util/
gofmt -w -s upup/pkg/
Expand Down Expand Up @@ -557,9 +552,7 @@ apimachinery:
${GOPATH}/bin/defaulter-gen --input-dirs k8s.io/kops/pkg/apis/kops/v1alpha2 --v=0 --output-file-base=zz_generated.defaults
#go install github.com/ugorji/go/codec/codecgen
# codecgen works only if invoked from directory where the file is located.
#cd pkg/apis/kops/v1alpha2/ && ~/k8s/bin/codecgen -d 1234 -o types.generated.go instancegroup.go cluster.go federation.go
#cd pkg/apis/kops/v1alpha1/ && ~/k8s/bin/codecgen -d 1234 -o types.generated.go instancegroup.go cluster.go federation.go
#cd pkg/apis/kops/ && ~/k8s/bin/codecgen -d 1234 -o types.generated.go instancegroup.go cluster.go federation.go
#cd pkg/apis/kops/ && ~/k8s/bin/codecgen -d 1234 -o types.generated.go instancegroup.go cluster.go
${GOPATH}/bin/client-gen --input-base k8s.io/kops/pkg/apis/ --input="kops/,kops/v1alpha1,kops/v1alpha2" --clientset-path k8s.io/kops/pkg/client/clientset_generated/
${GOPATH}/bin/client-gen --clientset-name="clientset" --input-base k8s.io/kops/pkg/apis/ --input="kops/,kops/v1alpha1,kops/v1alpha2" --clientset-path k8s.io/kops/pkg/client/clientset_generated/

Expand Down Expand Up @@ -588,11 +581,11 @@ kops-server-push: kops-server-build

.PHONY: bazel-test
bazel-test:
bazel ${BAZEL_OPTIONS} test //cmd/... //pkg/... //channels/... //nodeup/... //protokube/... //dns-controller/... //tests/... //upup/... //util/... //federation/... //hack:verify-all --test_output=errors
bazel ${BAZEL_OPTIONS} test //cmd/... //pkg/... //channels/... //nodeup/... //protokube/... //dns-controller/... //tests/... //upup/... //util/... //hack:verify-all --test_output=errors

.PHONY: bazel-build
bazel-build:
bazel build //cmd/... //pkg/... //channels/... //nodeup/... //protokube/... //dns-controller/... //util/... //federation/...
bazel build //cmd/... //pkg/... //channels/... //nodeup/... //protokube/... //dns-controller/... //util/...

.PHONY: bazel-build-cli
bazel-build-cli:
Expand Down
4 changes: 0 additions & 4 deletions cmd/kops/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@ go_library(
"describe_secrets.go",
"edit.go",
"edit_cluster.go",
"edit_federation.go",
"edit_instancegroup.go",
"editor.go",
"export.go",
"export_kubecfg.go",
"gen_help_docs.go",
"get.go",
"get_cluster.go",
"get_federation.go",
"get_instancegroups.go",
"get_secrets.go",
"import.go",
Expand All @@ -47,7 +45,6 @@ go_library(
"toolbox_template.go",
"update.go",
"update_cluster.go",
"update_federation.go",
"upgrade.go",
"upgrade_cluster.go",
"validate.go",
Expand All @@ -59,7 +56,6 @@ go_library(
deps = [
"//:go_default_library",
"//cmd/kops/util:go_default_library",
"//federation:go_default_library",
"//pkg/apis/kops:go_default_library",
"//pkg/apis/kops/model:go_default_library",
"//pkg/apis/kops/registry:go_default_library",
Expand Down
10 changes: 0 additions & 10 deletions cmd/kops/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,6 @@ func RunCreate(f *util.Factory, out io.Writer, c *CreateOptions) error {
}

switch v := o.(type) {
case *kopsapi.Federation:
_, err = clientset.FederationsFor(v).Create(v)
if err != nil {
if apierrors.IsAlreadyExists(err) {
return fmt.Errorf("federation %q already exists", v.ObjectMeta.Name)
}
return fmt.Errorf("error creating federation: %v", err)
}
fmt.Fprintf(&sb, "Created federation/%q\n", v.ObjectMeta.Name)

case *kopsapi.Cluster:
// Adding a PerformAssignments() call here as the user might be trying to use
// the new `-f` feature, with an old cluster definition.
Expand Down
4 changes: 0 additions & 4 deletions cmd/kops/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ var (
# Edit a instance group configuration.
kops edit ig --name k8s-cluster.example.com \
--state=s3://kops-state-1234 nodes
# Edit a cluster federation configuration.
kops edit federation k8s-cluster.example.com --state=s3://kops-state-1234
`))
)

Expand All @@ -59,7 +56,6 @@ func NewCmdEdit(f *util.Factory, out io.Writer) *cobra.Command {
// create subcommands
cmd.AddCommand(NewCmdEditCluster(f, out))
cmd.AddCommand(NewCmdEditInstanceGroup(f, out))
cmd.AddCommand(NewCmdEditFederation(f, out))

return cmd
}
155 changes: 0 additions & 155 deletions cmd/kops/edit_federation.go

This file was deleted.

1 change: 0 additions & 1 deletion cmd/kops/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ func NewCmdGet(f *util.Factory, out io.Writer) *cobra.Command {

// create subcommands
cmd.AddCommand(NewCmdGetCluster(f, out, options))
cmd.AddCommand(NewCmdGetFederations(f, out, options))
cmd.AddCommand(NewCmdGetInstanceGroups(f, out, options))
cmd.AddCommand(NewCmdGetSecrets(f, out, options))

Expand Down
Loading

0 comments on commit 7dfca05

Please sign in to comment.