From 4dd732b3daf552009519ae03cee0e10cc10e5a3d Mon Sep 17 00:00:00 2001 From: fibonacci1729 Date: Sun, 31 Jul 2016 23:52:09 -0600 Subject: [PATCH] add configmaps stub impl. of storage driver --- pkg/storage/driver/cfgmaps.go | 53 ++++++++++++++++++++++++++++++ pkg/storage/driver/cfgmaps_test.go | 40 ++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 pkg/storage/driver/cfgmaps.go create mode 100644 pkg/storage/driver/cfgmaps_test.go diff --git a/pkg/storage/driver/cfgmaps.go b/pkg/storage/driver/cfgmaps.go new file mode 100644 index 000000000..a83954479 --- /dev/null +++ b/pkg/storage/driver/cfgmaps.go @@ -0,0 +1,53 @@ +/* +Copyright 2016 The Kubernetes Authors All rights reserved. + +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 driver // import "k8s.io/helm/pkg/storage/driver" + +import ( + rspb "k8s.io/helm/pkg/proto/hapi/release" +) + +type ConfigMaps struct { + *Memory // simple cache +} + +func NewConfigMaps() *ConfigMaps { + return &ConfigMaps{Memory: NewMemory()} +} + +// Get retrieves the releases named by key from the ConfigMap +func (cfg *ConfigMaps) Get(key string) (*rspb.Release, error) { + return nil, ErrNotImplemented +} + +// All returns all releases whose status is not Status_DELETED. +func (cfg *ConfigMaps) All(key string, opts ...interface{}) ([]*rspb.Release, error) { + return nil, ErrNotImplemented +} + +// Create creates a new release or error. +func (cfg *ConfigMaps) Create(rls *rspb.Release) error { + return ErrNotImplemented +} + +// Update updates a release or error. +func (cfg *ConfigMaps) Update(rls *rspb.Release) error { + return ErrNotImplemented +} + +// Delete deletes a release or error. +func (cfg *ConfigMaps) Delete(key string) (*rspb.Release, error) { + return nil, ErrNotImplemented +} diff --git a/pkg/storage/driver/cfgmaps_test.go b/pkg/storage/driver/cfgmaps_test.go new file mode 100644 index 000000000..dd8f39200 --- /dev/null +++ b/pkg/storage/driver/cfgmaps_test.go @@ -0,0 +1,40 @@ +/* +Copyright 2016 The Kubernetes Authors All rights reserved. + +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 driver // import "k8s.io/helm/pkg/storage/driver" + +import ( + "testing" +) + +func TestConfigMapsGet(t *testing.T) { + t.Skip("ConfigMapsGet") +} + +func TestConfigMapsAll(t *testing.T) { + t.Skip("ConfigMapsAll") +} + +func TestConfigMapsCreate(t *testing.T) { + t.Skip("ConfigMapsCreate") +} + +func TestConfigMapsUpdate(t *testing.T) { + t.Skip("ConfigMapsUpdate") +} + +func TestConfigMapsDelete(t *testing.T) { + t.Skip("ConfigMapsDelete") +}