Skip to content

Commit

Permalink
Change the structure of kodata and read the yamls with the version (#115
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Vincent authored Jun 1, 2020
1 parent 722da9f commit d04dd33
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pkg/reconciler/knativeeventing/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
knereconciler "knative.dev/operator/pkg/client/injection/reconciler/operator/v1alpha1/knativeeventing"
"knative.dev/operator/pkg/reconciler"
"knative.dev/operator/pkg/reconciler/common"
"knative.dev/operator/version"
kubeclient "knative.dev/pkg/client/injection/kube/client"
deploymentinformer "knative.dev/pkg/client/injection/kube/informers/apps/v1/deployment"
"knative.dev/pkg/configmap"
Expand All @@ -52,7 +53,7 @@ func NewController(ctx context.Context, cmw configmap.Watcher) *controller.Impl
}

koDataDir := os.Getenv("KO_DATA_PATH")
config, err := mfc.NewManifest(filepath.Join(koDataDir, "knative-eventing/"),
config, err := mfc.NewManifest(filepath.Join(koDataDir, "knative-eventing", version.EventingVersion),
injection.GetConfig(ctx),
mf.UseLogger(zapr.NewLogger(logger.Desugar()).WithName("manifestival")))
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion pkg/reconciler/knativeserving/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
"knative.dev/operator/pkg/reconciler"
"knative.dev/operator/pkg/reconciler/common"
servingcommon "knative.dev/operator/pkg/reconciler/knativeserving/common"
"knative.dev/operator/version"
deploymentinformer "knative.dev/pkg/client/injection/kube/informers/apps/v1/deployment"
"knative.dev/pkg/configmap"
"knative.dev/pkg/controller"
Expand Down Expand Up @@ -65,7 +66,7 @@ func NewController(ctx context.Context, cmw configmap.Watcher) *controller.Impl
}

koDataDir := os.Getenv("KO_DATA_PATH")
config, err := mfc.NewManifest(filepath.Join(koDataDir, "knative-serving/"),
config, err := mfc.NewManifest(filepath.Join(koDataDir, "knative-serving", version.ServingVersion),
injection.GetConfig(ctx),
mf.UseLogger(zapr.NewLogger(logger.Desugar()).WithName("manifestival")))
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions version/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

func TestManifestVersionServingSame(t *testing.T) {
_, b, _, _ := runtime.Caller(0)
manifest, err := mf.NewManifest(filepath.Join(filepath.Dir(b)+"/..", "cmd/operator/kodata/knative-serving/"))
manifest, err := mf.NewManifest(filepath.Join(filepath.Dir(b)+"/..", "cmd/operator/kodata/knative-serving", ServingVersion))
if err != nil {
t.Fatal("Failed to load manifest", err)
}
Expand All @@ -45,7 +45,7 @@ func TestManifestVersionServingSame(t *testing.T) {

func TestManifestVersionEventingSame(t *testing.T) {
_, b, _, _ := runtime.Caller(0)
manifest, err := mf.NewManifest(filepath.Join(filepath.Dir(b)+"/..", "cmd/operator/kodata/knative-eventing/"))
manifest, err := mf.NewManifest(filepath.Join(filepath.Dir(b)+"/..", "cmd/operator/kodata/knative-eventing", EventingVersion))
if err != nil {
t.Fatal("Failed to load manifest", err)
}
Expand Down

0 comments on commit d04dd33

Please sign in to comment.