Skip to content

Commit

Permalink
Odds and ends leftover k8s things
Browse files Browse the repository at this point in the history
  • Loading branch information
moleske committed Apr 14, 2023
1 parent faec7fd commit 51d56cd
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 38 deletions.
4 changes: 0 additions & 4 deletions app/actions/app_delete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ def delete_without_event(apps)

private

def k8s_api_client
CloudController::DependencyLocator.instance.k8s_api_client
end

def record_audit_event(app)
Repositories::AppEventRepository.new.record_app_delete_request(
app,
Expand Down
1 change: 0 additions & 1 deletion app/controllers/v3/apps_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ def create
unprocessable_space! unless space && permission_queryer.can_read_from_space?(space.id, space.organization_id)
unauthorized! unless permission_queryer.can_write_to_active_space?(space.id)
suspended! unless permission_queryer.is_space_active?(space.id)
# TODO: only fail if also not `kpack` app lifecycle
if message.lifecycle_type == VCAP::CloudController::PackageModel::DOCKER_TYPE
FeatureFlag.raise_unless_enabled!(:diego_docker)
end
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/v3/build_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class BuildPresenter < BasePresenter
class << self
# :labels and :annotations come from MetadataPresentationHelpers
def associated_resources
super + [:kpack_lifecycle_data, { buildpack_lifecycle_data: :buildpack_lifecycle_buildpacks }]
super + [{ buildpack_lifecycle_data: :buildpack_lifecycle_buildpacks }]
end
end

Expand Down
11 changes: 0 additions & 11 deletions config/cloud_controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,17 +297,6 @@ diego:
receive_timeout: 10
pid_limit: 2048

#kubernetes:
# host_url: https://main.default.svc.cluster-domain.example
# service_account:
# token_file: "spec/fixtures/service_accounts/k8s.token"
# ca_file: "spec/fixtures/certs/kubernetes_ca.crt"
# workloads_namespace: 'cf-workloads'
# kpack:
# builder_namespace: 'cf-workloads-staging'
# registry_service_account_name: 'fake-registry-service-account'
# registry_tag_base: 'gcr.io/fake-image-repository'

directories:
tmpdir: /tmp
diagnostics: /tmp
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/controllers/v3/builds_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
set_current_user_as_role(role: 'admin', org: organization, space: space, user: user)
expect(VCAP::CloudController::BuildListFetcher).to receive(:fetch_all).with(
anything,
hash_including(eager_loaded_associations: [:labels, :annotations, :kpack_lifecycle_data, { buildpack_lifecycle_data: :buildpack_lifecycle_buildpacks }])
hash_including(eager_loaded_associations: [:labels, :annotations, { buildpack_lifecycle_data: :buildpack_lifecycle_buildpacks }])
).and_call_original

get :index
Expand Down
20 changes: 0 additions & 20 deletions spec/unit/lib/cloud_controller/dependency_locator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -562,23 +562,3 @@
end
end
end

def generate_test_kubeconfig
ca_file = Tempfile.new('k8s_node_ca.crt')
ca_file.write('my crt')
ca_file.close

token_file = Tempfile.new('token.token')
token_file.write('token')
token_file.close

{
kubernetes: {
host_url: 'https://my.kubernetes.io',
service_account: {
token_file: token_file.path,
},
ca_file: ca_file.path
},
}
end

0 comments on commit 51d56cd

Please sign in to comment.