Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
senthilrch committed Nov 18, 2018
2 parents 8997e3f + 5013561 commit 08c214e
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build Status](https://travis-ci.org/senthilrch/kube-fledged.svg?branch=master)](https://travis-ci.org/senthilrch/kube-fledged)
[![Coverage Status](https://coveralls.io/repos/github/senthilrch/kube-fledged/badge.svg?branch=master)](https://coveralls.io/github/senthilrch/kube-fledged?branch=master)
[![Go Report Card](https://goreportcard.com/report/github.com/senthilrch/kube-fledged)](https://goreportcard.com/report/github.com/senthilrch/kube-fledged)
[![Go Report Card](https://goreportcard.com/badge/github.com/senthilrch/kube-fledged)](https://goreportcard.com/report/github.com/senthilrch/kube-fledged)

**_kube-fledged_** is a kubernetes add-on for creating and managing a cache of container images directly on the worker nodes of a kubernetes cluster. It allows a user to define a list
of images and onto which worker nodes those images should be cached (i.e. pre-pulled). As a result, application pods start almost instantly, since the images need not be pulled from the registry.
Expand Down
53 changes: 53 additions & 0 deletions cmd/app/controller_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
Copyright 2018 The kube-fledged authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package app

import (
"testing"
"time"

fakefledgedclientset "github.com/senthilrch/kube-fledged/pkg/client/clientset/versioned/fake"
fledgedinformers "github.com/senthilrch/kube-fledged/pkg/client/informers/externalversions"
"k8s.io/apimachinery/pkg/runtime"
kubeinformers "k8s.io/client-go/informers"
fakeclientset "k8s.io/client-go/kubernetes/fake"
)

//const controllerAgentName = "fledged"
//const fledgedNameSpace = "kube-fledged"
//const fledgedFinalizer = "fledged"
const noResync time.Duration = time.Second * 0
const imageCacheRefreshFrequency time.Duration = time.Second * 0
const imagePullDeadlineDuration time.Duration = time.Second * 5

func TestNewController(t *testing.T) {
fakekubeclientset := fakeclientset.NewSimpleClientset([]runtime.Object{}...)
fakefledgedclientset := fakefledgedclientset.NewSimpleClientset([]runtime.Object{}...)
kubeInformerFactory := kubeinformers.NewSharedInformerFactory(fakekubeclientset, noResync)
fledgedInformerFactory := fledgedinformers.NewSharedInformerFactory(fakefledgedclientset, noResync)

controller := NewController(fakekubeclientset, fakefledgedclientset,
kubeInformerFactory.Core().V1().Nodes(),
fledgedInformerFactory.Fledged().V1alpha1().ImageCaches(),
imageCacheRefreshFrequency, imagePullDeadlineDuration)
t.Logf("New controller created successfully: %v", controller)

//stopCh := make(chan struct{})
//if err := controller.Run(1, stopCh); err != nil {
// t.Errorf("Error running controller: %s", err.Error())
//}
}

0 comments on commit 08c214e

Please sign in to comment.